Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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);
74 
75  /// Sets up a list of local expansions based on an input mesh.
79  const bool DelcareCoeffPhysArrays = true,
80  const std::string &var = "DefaultVar");
81 
82  /// Sets up a list of local expansions based on an expansion Map
85  const SpatialDomains::ExpansionMap &expansions,
86  const bool DeclareCoeffPhysArrays = true);
87 
88  /// Sets up a list of local expansions based on an input mesh
89  /// and separately defined basiskeys
92  const LibUtilities::BasisKey &TriBa,
93  const LibUtilities::BasisKey &TriBb,
94  const LibUtilities::BasisKey &QuadBa,
95  const LibUtilities::BasisKey &QuadBb,
99 
100  //Specialized constructor for trace expansions.
102  const LibUtilities::SessionReaderSharedPtr &pSession,
103  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
105  &bndCond,
106  const LocalRegions::ExpansionVector &locexp,
107  const SpatialDomains::MeshGraphSharedPtr &graph3D,
108  const PeriodicMap &periodicFaces,
109  const bool DeclareCoeffPhysArrays = true,
110  const std::string variable = "DefaultVar");
111 
112  /// Specialised constructor for Neumann boundary conditions in
113  /// DisContField3D and ContField3D.
115  const LibUtilities::SessionReaderSharedPtr &pSession,
116  const SpatialDomains::CompositeMap &domain,
117  const SpatialDomains::MeshGraphSharedPtr &graph3D,
118  const std::string variable = "DefaultVar");
119 
120  /// Destructor.
122 
123  protected:
124  /// Upwind the \a Fwd and \a Bwd states based on the one-
125  /// dimensional normal velocity field given by \a Vn.
128  const Array<OneD, const NekDouble> &Fwd,
129  const Array<OneD, const NekDouble> &Bwd,
131 
132  void v_GetNormals(
133  Array<OneD, Array<OneD, NekDouble> > &normals);
134 
135  private:
136  /// Definition of the total number of degrees of freedom and
137  /// quadrature points and offsets to access datax
138  void SetCoeffPhysOffsets(void);
139 
140  /// Set up the normals on each expansion.
141  virtual void v_SetUpPhysNormals();
142 
143  virtual void v_ReadGlobalOptimizationParameters();
144 
145  virtual void v_WriteVtkPieceHeader(
146  std::ostream &outfile, int expansion, int istrip);
147 
148  virtual void v_PhysInterp1DScaled(
149  const NekDouble scale,
150  const Array<OneD, NekDouble> &inarray,
151  Array<OneD, NekDouble> &outarray);
152 
154  const NekDouble scale,
155  const Array<OneD, NekDouble> &inarray,
156  Array<OneD, NekDouble> &outarray);
157  };
158 
159  /// Empty ExpList2D object.
162  } //end of namespace
163 } //end of namespace
164 
165 #endif//EXPLIST2D_H
166 
#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:1267
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:161
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:1986
virtual void v_SetUpPhysNormals()
Set up the normals on each expansion.
Definition: ExpList2D.cpp:1162
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
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
Definition: ExpList2D.cpp:1121
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:1195
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:1039
virtual void v_ReadGlobalOptimizationParameters()
Definition: ExpList2D.cpp:1175
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:932
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:1299
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