Nektar++
ExpList1D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File ExpList1D.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 1D definition
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
36 #define NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
37 
39 #include <vector>
40 #include <MultiRegions/ExpList.h>
41 #include <LocalRegions/SegExp.h>
43 
44 namespace Nektar
45 {
46  namespace MultiRegions
47  {
48  // Forward declarations for typedefs
49  class ExpList1D;
50 
51  /// Shared pointer to an ExpList1D object.
52  typedef std::shared_ptr<ExpList1D> ExpList1DSharedPtr;
53  /// Vector of pointers to ExpList1D objects.
54  typedef std::vector<ExpList1DSharedPtr> ExpList1DVector;
55 
56  /// This class is the abstraction of a one-dimensional multi-elemental
57  /// expansions which is merely a collection of local expansions.
58  class ExpList1D: public ExpList
59  {
60  public:
61  /// The default constructor.
63 
64  /// The copy constructor.
66  const ExpList1D &In,
67  const bool DeclareCoeffPhysArrays = true);
68 
69 
70  /// Constructor copying only elements defined in eIds.
71  MULTI_REGIONS_EXPORT ExpList1D( const ExpList1D &In,
72  const std::vector<unsigned int> &eIDs,
73  const bool DeclareCoeffPhysArrays = true,
76 
77  /// Construct an ExpList1D from a given graph.
80  const LibUtilities::BasisKey &Ba,
84 
85  /// This constructor sets up a list of local expansions based on an
86  /// input graph1D.
90  const bool DeclareCoeffPhysArrays = true,
93 
94 
95  /// This constructor sets up a list of local expansions based on an
96  /// input compositeMap
100  const SpatialDomains::CompositeMap &domain,
101  const bool DeclareCoeffPhysArrays = true,
102  const std::string var = "DefaultVar",
103  bool SetToOneSpaceDimension = false,
104  const Collections::ImplementationType ImpType
106 
107 
108 
109  /// Specialised constructor for Neumann boundary conditions in
110  /// DisContField2D and ContField2D.
112  const LibUtilities::SessionReaderSharedPtr &pSession,
113  const SpatialDomains::CompositeMap &domain,
114  const SpatialDomains::MeshGraphSharedPtr &graph2D,
115  const bool DeclareCoeffPhysArrays = true,
116  const std::string variable = "DefaultVar",
117  const LibUtilities::CommSharedPtr comm
119  const Collections::ImplementationType ImpType
121 
123  const LibUtilities::SessionReaderSharedPtr &pSession,
124  const SpatialDomains::CompositeMap &domain,
125  const SpatialDomains::MeshGraphSharedPtr &graph1D,
126  int i,
127  const bool DeclareCoeffPhysArrays = true,
128  const Collections::ImplementationType ImpType
130 
131  /// Specialised constructor for trace expansions.
133  const LibUtilities::SessionReaderSharedPtr &pSession,
134  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
135  const Array<OneD,const SpatialDomains
136  ::BoundaryConditionShPtr> &bndCond,
137  const LocalRegions::ExpansionVector &locexp,
138  const SpatialDomains::MeshGraphSharedPtr &graph2D,
139  const PeriodicMap &periodicEdges,
140  const bool DeclareCoeffPhysArrays = true,
141  const std::string variable = "DefaultVar",
142  const Collections::ImplementationType ImpType
144 
145 
146  /// Destructor.
148 
149  /// Performs the post-processing on a specified element.
152  Array<OneD,NekDouble> &inarray,
153  Array<OneD,NekDouble> &outarray,
154  NekDouble h,
155  int elmId = 0);
156 
157  /// Evaluates the global spectral/hp expansion at some arbitray set
158  /// of points.
160  Array<OneD,NekDouble> &inarray1,
161  Array<OneD,NekDouble> &inarray2,
162  NekDouble h, int nmodes,
163  Array<OneD,NekDouble> &outarray);
164 
165  /// Set up the normals on each expansion.
166  //MULTI_REGIONS_EXPORT void SetUpPhysNormals();
167  //const StdRegions::StdExpansionVector &locexp);
168 
170 
171  protected:
172  /// Upwind the \a Fwd and \a Bwd states based on the velocity
173  /// field given by \a Vec.
174  void v_Upwind(
175  const Array<OneD, const Array<OneD, NekDouble> > &Vec,
176  const Array<OneD, const NekDouble> &Fwd,
177  const Array<OneD, const NekDouble> &Bwd,
179 
180  /// Upwind the \a Fwd and \a Bwd states based on the one-
181  /// dimensional normal velocity field given by \a Vn.
182  void v_Upwind(
184  const Array<OneD, const NekDouble> &Fwd,
185  const Array<OneD, const NekDouble> &Bwd,
186  Array<OneD, NekDouble> &Upwind);
187 
188  /// Populate \a normals with the normals of all expansions.
189  void v_GetNormals(Array<OneD, Array<OneD, NekDouble> > &normals);
190 
191  private:
192  virtual void v_ReadGlobalOptimizationParameters();
193 
194  /// Set up the normals on each expansion.
195  virtual void v_SetUpPhysNormals();
196  /// const StdRegions::StdExpansionVector &locexp);
197 
198  virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip);
199 
200  };
201 
202  /// Empty ExpList1D object.
205 
206  } //end of namespace
207 } //end of namespace
208 
209 #endif//NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
210 
ExpList1D()
The default constructor.
Definition: ExpList1D.cpp:78
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< Kernel > KernelSharedPtr
Definition: kernel.h:214
virtual void v_SetUpPhysNormals()
Set up the normals on each expansion.
Definition: ExpList1D.cpp:921
std::vector< ExpansionSharedPtr > ExpansionVector
Definition: Expansion.h:67
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
void v_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)
Upwind the Fwd and Bwd states based on the velocity field given by Vec.
Definition: ExpList1D.cpp:943
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:103
std::vector< ExpList1DSharedPtr > ExpList1DVector
Vector of pointers to ExpList1D objects.
Definition: ExpList1D.h:54
void PeriodicEval(Array< OneD, NekDouble > &inarray1, Array< OneD, NekDouble > &inarray2, NekDouble h, int nmodes, Array< OneD, NekDouble > &outarray)
Evaluates the global spectral/hp expansion at some arbitray set of points.
Definition: ExpList1D.cpp:818
double NekDouble
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:219
static const Array< OneD, ExpList1DSharedPtr > NullExpList1DSharedPtrArray
Empty ExpList1D object.
Definition: ExpList1D.h:204
void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
Definition: ExpList1D.cpp:1046
This class is the abstraction of a one-dimensional multi-elemental expansions which is merely a colle...
Definition: ExpList1D.h:58
void PostProcess(LibUtilities::KernelSharedPtr kernel, Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray, NekDouble h, int elmId=0)
Performs the post-processing on a specified element.
Definition: ExpList1D.cpp:719
virtual void v_ReadGlobalOptimizationParameters()
Definition: ExpList1D.cpp:1156
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
const StdRegions::StdExpansionVector &locexp);
Definition: ExpList1D.cpp:1175
virtual ~ExpList1D()
Destructor.
Definition: ExpList1D.cpp:705
void ParNormalSign(Array< OneD, NekDouble > &normsign)
Set up the normals on each expansion.
std::shared_ptr< ExpList1D > ExpList1DSharedPtr
Shared pointer to an ExpList1D object.
Definition: ExpList1D.h:49
Describes the specification for a Basis.
Definition: Basis.h:49
std::shared_ptr< SessionReader > SessionReaderSharedPtr