Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ExpList2D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File ExpList2D.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Expansion list 2D header definition
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef EXPLIST2D_H
37 #define EXPLIST2D_H
38 
40 #include <vector>
41 #include <MultiRegions/ExpList.h>
43 
44 namespace Nektar
45 {
46  namespace MultiRegions
47  {
48  // Forward declaration for typedefs
49  class ExpList2D;
50 
51  /// Shared pointer to an ExpList2D object.
52  typedef boost::shared_ptr<ExpList2D> ExpList2DSharedPtr;
53  /// Vector of pointers to ExpList2D objects.
54  typedef std::vector< ExpList2DSharedPtr > ExpList2DVector;
55  /// Iterator for the vector of ExpList2D pointers.
57 
58  /// Abstraction of a two-dimensional multi-elemental expansion which
59  /// is merely a collection of local expansions.
60  class ExpList2D: public ExpList
61  {
62  public:
63  /// Default constructor.
65 
66  /// Copy constructor.
67  MULTI_REGIONS_EXPORT ExpList2D( const ExpList2D &In,
68  const bool DeclareCoeffPhysArrays = true);
69 
70  /// Constructor copying only elements defined in eIds.
71  MULTI_REGIONS_EXPORT ExpList2D( const ExpList2D &In,
72  const std::vector<unsigned int> &eIDs,
73  const bool DeclareCoeffPhysArrays = true,
76 
77  /// Sets up a list of local expansions based on an input mesh.
81  const bool DelcareCoeffPhysArrays = true,
82  const std::string &var = "DefaultVar",
85 
86  /// Sets up a list of local expansions based on an expansion Map
89  const SpatialDomains::ExpansionMap &expansions,
90  const bool DeclareCoeffPhysArrays = true,
93 
94  /// Sets up a list of local expansions based on an input mesh
95  /// and separately defined basiskeys
98  const LibUtilities::BasisKey &TriBa,
99  const LibUtilities::BasisKey &TriBb,
100  const LibUtilities::BasisKey &QuadBa,
101  const LibUtilities::BasisKey &QuadBb,
102  const SpatialDomains::MeshGraphSharedPtr &graph2D,
105  const Collections::ImplementationType ImpType
107 
108  //Specialized constructor for trace expansions.
110  const LibUtilities::SessionReaderSharedPtr &pSession,
111  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
113  &bndCond,
114  const LocalRegions::ExpansionVector &locexp,
115  const SpatialDomains::MeshGraphSharedPtr &graph3D,
116  const PeriodicMap &periodicFaces,
117  const bool DeclareCoeffPhysArrays = true,
118  const std::string variable = "DefaultVar",
119  const Collections::ImplementationType ImpType
121 
122  /// Specialised constructor for Neumann boundary conditions in
123  /// DisContField3D and ContField3D.
125  const LibUtilities::SessionReaderSharedPtr &pSession,
126  const SpatialDomains::CompositeMap &domain,
127  const SpatialDomains::MeshGraphSharedPtr &graph3D,
128  const std::string variable = "DefaultVar",
129  const Collections::ImplementationType ImpType
131 
132  /// Destructor.
134 
135  protected:
136  /// Upwind the \a Fwd and \a Bwd states based on the one-
137  /// dimensional normal velocity field given by \a Vn.
140  const Array<OneD, const NekDouble> &Fwd,
141  const Array<OneD, const NekDouble> &Bwd,
143 
144  void v_GetNormals(
145  Array<OneD, Array<OneD, NekDouble> > &normals);
146 
147  private:
148  /// Set up the normals on each expansion.
149  virtual void v_SetUpPhysNormals();
150 
151  virtual void v_ReadGlobalOptimizationParameters();
152 
153  virtual void v_WriteVtkPieceHeader(
154  std::ostream &outfile, int expansion, int istrip);
155 
156  virtual void v_PhysInterp1DScaled(
157  const NekDouble scale,
158  const Array<OneD, NekDouble> &inarray,
159  Array<OneD, NekDouble> &outarray);
160 
162  const NekDouble scale,
163  const Array<OneD, NekDouble> &inarray,
164  Array<OneD, NekDouble> &outarray);
165  };
166 
167  /// Empty ExpList2D object.
170  } //end of namespace
171 } //end of namespace
172 
173 #endif//EXPLIST2D_H
174 
#define MULTI_REGIONS_EXPORT
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList2D.cpp:1228
virtual ~ExpList2D()
Destructor.
Definition: ExpList2D.cpp:79
std::vector< ExpansionSharedPtr > ExpansionVector
Definition: Expansion.h:70
static const Array< OneD, ExpList2DSharedPtr > NullExpList2DSharedPtrArray
Empty ExpList2D object.
Definition: ExpList2D.h:169
void Upwind(const Array< OneD, const Array< OneD, NekDouble > > &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Definition: ExpList.h:2125
virtual void v_SetUpPhysNormals()
Set up the normals on each expansion.
Definition: ExpList2D.cpp:1123
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:101
std::vector< ExpList2DSharedPtr >::iterator ExpList2DVectorIter
Iterator for the vector of ExpList2D pointers.
Definition: ExpList2D.h:56
double NekDouble
boost::shared_ptr< ExpList2D > ExpList2DSharedPtr
Shared pointer to an ExpList2D object.
Definition: ExpList2D.h:49
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::map< int, Composite > CompositeMap
Definition: MeshGraph.h:115
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList2D.cpp:1156
void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
For each local element, copy the normals stored in the element list into the array normals...
Definition: ExpList2D.cpp:1048
virtual void v_ReadGlobalOptimizationParameters()
Definition: ExpList2D.cpp:1136
ExpList2D()
Default constructor.
Definition: ExpList2D.cpp:69
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Definition: ExpList2D.h:60
void v_Upwind(const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Upwind the Fwd and Bwd states based on the one- dimensional normal velocity field given by Vn...
Definition: ExpList2D.cpp:941
std::vector< ExpList2DSharedPtr > ExpList2DVector
Vector of pointers to ExpList2D objects.
Definition: ExpList2D.h:54
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList2D.cpp:1260
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:442
Describes the specification for a Basis.
Definition: Basis.h:50
std::map< int, ExpansionShPtr > ExpansionMap
Definition: MeshGraph.h:174