Nektar++
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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Expansion list 2D header definition
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef EXPLIST2D_H
36 #define EXPLIST2D_H
37 
39 #include <vector>
40 #include <MultiRegions/ExpList.h>
42 
43 namespace Nektar
44 {
45  namespace MultiRegions
46  {
47  // Forward declaration for typedefs
48  class ExpList2D;
49 
50  /// Shared pointer to an ExpList2D object.
51  typedef std::shared_ptr<ExpList2D> ExpList2DSharedPtr;
52  /// Vector of pointers to ExpList2D objects.
53  typedef std::vector< ExpList2DSharedPtr > ExpList2DVector;
54 
55  /// Abstraction of a two-dimensional multi-elemental expansion which
56  /// is merely a collection of local expansions.
57  class ExpList2D: public ExpList
58  {
59  public:
60  /// Default constructor.
62 
63  /// Copy constructor.
64  MULTI_REGIONS_EXPORT ExpList2D( const ExpList2D &In,
65  const bool DeclareCoeffPhysArrays = true);
66 
67  /// Constructor copying only elements defined in eIds.
68  MULTI_REGIONS_EXPORT ExpList2D( const ExpList2D &In,
69  const std::vector<unsigned int> &eIDs,
70  const bool DeclareCoeffPhysArrays = true,
73 
74  /// Sets up a list of local expansions based on an input mesh.
78  const bool DelcareCoeffPhysArrays = true,
79  const std::string &var = "DefaultVar",
82 
83  /// Sets up a list of local expansions based on an expansion Map
86  const SpatialDomains::ExpansionMap &expansions,
87  const bool DeclareCoeffPhysArrays = true,
90 
91  /// Sets up a list of local expansions based on an input mesh
92  /// and separately defined basiskeys
95  const LibUtilities::BasisKey &TriBa,
96  const LibUtilities::BasisKey &TriBb,
97  const LibUtilities::BasisKey &QuadBa,
98  const LibUtilities::BasisKey &QuadBb,
102  const Collections::ImplementationType ImpType
104 
105  //Specialized constructor for trace expansions.
107  const LibUtilities::SessionReaderSharedPtr &pSession,
108  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
110  &bndCond,
111  const LocalRegions::ExpansionVector &locexp,
112  const SpatialDomains::MeshGraphSharedPtr &graph3D,
113  const PeriodicMap &periodicFaces,
114  const bool DeclareCoeffPhysArrays = true,
115  const std::string variable = "DefaultVar",
116  const Collections::ImplementationType ImpType
118 
119  /// Specialised constructor for Neumann boundary conditions in
120  /// DisContField3D and ContField3D.
122  const LibUtilities::SessionReaderSharedPtr &pSession,
123  const SpatialDomains::CompositeMap &domain,
124  const SpatialDomains::MeshGraphSharedPtr &graph3D,
125  const std::string variable = "DefaultVar",
126  const LibUtilities::CommSharedPtr comm =
128  const Collections::ImplementationType ImpType
130 
131  /// Destructor.
133 
134  protected:
135  /// Upwind the \a Fwd and \a Bwd states based on the one-
136  /// dimensional normal velocity field given by \a Vn.
139  const Array<OneD, const NekDouble> &Fwd,
140  const Array<OneD, const NekDouble> &Bwd,
142 
143  void v_GetNormals(
144  Array<OneD, Array<OneD, NekDouble> > &normals);
145 
146  private:
147  /// Set up the normals on each expansion.
148  virtual void v_SetUpPhysNormals();
149 
150  virtual void v_ReadGlobalOptimizationParameters();
151 
152  virtual void v_WriteVtkPieceHeader(
153  std::ostream &outfile, int expansion, int istrip);
154 
155  virtual void v_PhysInterp1DScaled(
156  const NekDouble scale,
157  const Array<OneD, NekDouble> &inarray,
158  Array<OneD, NekDouble> &outarray);
159 
161  const NekDouble scale,
162  const Array<OneD, NekDouble> &inarray,
163  Array<OneD, NekDouble> &outarray);
164  };
165 
166  /// Empty ExpList2D object.
169  } //end of namespace
170 } //end of namespace
171 
172 #endif//EXPLIST2D_H
173 
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:53
#define MULTI_REGIONS_EXPORT
std::map< int, CompositeSharedPtr > CompositeMap
Definition: MeshGraph.h:137
std::shared_ptr< ExpList2D > ExpList2DSharedPtr
Shared pointer to an ExpList2D object.
Definition: ExpList2D.h:48
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList2D.cpp:1219
virtual ~ExpList2D()
Destructor.
Definition: ExpList2D.cpp:80
std::vector< ExpansionSharedPtr > ExpansionVector
Definition: Expansion.h:67
static const Array< OneD, ExpList2DSharedPtr > NullExpList2DSharedPtrArray
Empty ExpList2D object.
Definition: ExpList2D.h:168
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:2249
virtual void v_SetUpPhysNormals()
Set up the normals on each expansion.
Definition: ExpList2D.cpp:1112
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:103
double NekDouble
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Definition: ExpList2D.cpp:1145
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:1037
virtual void v_ReadGlobalOptimizationParameters()
Definition: ExpList2D.cpp:1125
ExpList2D()
Default constructor.
Definition: ExpList2D.cpp:70
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Definition: ExpList2D.h:57
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:930
std::vector< ExpList2DSharedPtr > ExpList2DVector
Vector of pointers to ExpList2D objects.
Definition: ExpList2D.h:53
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: ExpList2D.cpp:1251
Describes the specification for a Basis.
Definition: Basis.h:49
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::map< int, ExpansionShPtr > ExpansionMap
Definition: MeshGraph.h:152