Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // 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 1D definition
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
37 #define NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
38 
40 #include <vector>
41 #include <MultiRegions/ExpList.h>
42 #include <LocalRegions/SegExp.h>
44 
45 namespace Nektar
46 {
47  namespace MultiRegions
48  {
49  // Forward declarations for typedefs
50  class ExpList1D;
51 
52  /// Shared pointer to an ExpList1D object.
53  typedef boost::shared_ptr<ExpList1D> ExpList1DSharedPtr;
54  /// Vector of pointers to ExpList1D objects.
55  typedef std::vector<ExpList1DSharedPtr> ExpList1DVector;
56  /// Iterator for the vector of ExpList1D pointers.
58 
59  /// This class is the abstraction of a one-dimensional multi-elemental
60  /// expansions which is merely a collection of local expansions.
61  class ExpList1D: public ExpList
62  {
63  public:
64  /// The default constructor.
66 
67  /// The copy constructor.
69  const ExpList1D &In,
70  const bool DeclareCoeffPhysArrays = true);
71 
72 
73  /// Constructor copying only elements defined in eIds.
74  MULTI_REGIONS_EXPORT ExpList1D( const ExpList1D &In,
75  const std::vector<unsigned int> &eIDs,
76  const bool DeclareCoeffPhysArrays = true,
79 
80  /// Construct an ExpList1D from a given graph.
83  const LibUtilities::BasisKey &Ba,
87 
88  /// This constructor sets up a list of local expansions based on an
89  /// input graph1D.
93  const bool DeclareCoeffPhysArrays = true,
96 
97 
98  /// This constructor sets up a list of local expansions based on an
99  /// input compositeMap
101  const LibUtilities::SessionReaderSharedPtr &pSession,
102  const SpatialDomains::MeshGraphSharedPtr &graph1D,
103  const SpatialDomains::CompositeMap &domain,
104  const bool DeclareCoeffPhysArrays = true,
105  const std::string var = "DefaultVar",
106  bool SetToOneSpaceDimension = false,
107  const Collections::ImplementationType ImpType
109 
110 
111 
112  /// Specialised constructor for Neumann boundary conditions in
113  /// DisContField2D and ContField2D.
115  const LibUtilities::SessionReaderSharedPtr &pSession,
116  const SpatialDomains::CompositeMap &domain,
117  const SpatialDomains::MeshGraphSharedPtr &graph2D,
118  const bool DeclareCoeffPhysArrays = true,
119  const std::string variable = "DefaultVar",
120  const Collections::ImplementationType ImpType
122 
123 
125  const LibUtilities::SessionReaderSharedPtr &pSession,
126  const SpatialDomains::CompositeMap &domain,
127  const SpatialDomains::MeshGraphSharedPtr &graph1D,
128  int i,
129  const bool DeclareCoeffPhysArrays = true,
130  const Collections::ImplementationType ImpType
132 
133  /// Specialised constructor for trace expansions.
135  const LibUtilities::SessionReaderSharedPtr &pSession,
136  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
137  const Array<OneD,const SpatialDomains
138  ::BoundaryConditionShPtr> &bndCond,
139  const LocalRegions::ExpansionVector &locexp,
140  const SpatialDomains::MeshGraphSharedPtr &graph2D,
141  const PeriodicMap &periodicEdges,
142  const bool DeclareCoeffPhysArrays = true,
143  const std::string variable = "DefaultVar",
144  const Collections::ImplementationType ImpType
146 
147 
148  /// Destructor.
150 
151  /// Performs the post-processing on a specified element.
154  Array<OneD,NekDouble> &inarray,
155  Array<OneD,NekDouble> &outarray,
156  NekDouble h,
157  int elmId = 0);
158 
159  /// Evaluates the global spectral/hp expansion at some arbitray set
160  /// of points.
162  Array<OneD,NekDouble> &inarray1,
163  Array<OneD,NekDouble> &inarray2,
164  NekDouble h, int nmodes,
165  Array<OneD,NekDouble> &outarray);
166 
167  /// Set up the normals on each expansion.
168  //MULTI_REGIONS_EXPORT void SetUpPhysNormals();
169  //const StdRegions::StdExpansionVector &locexp);
170 
172 
173  protected:
174  /// Upwind the \a Fwd and \a Bwd states based on the velocity
175  /// field given by \a Vec.
176  void v_Upwind(
177  const Array<OneD, const Array<OneD, NekDouble> > &Vec,
178  const Array<OneD, const NekDouble> &Fwd,
179  const Array<OneD, const NekDouble> &Bwd,
181 
182  /// Upwind the \a Fwd and \a Bwd states based on the one-
183  /// dimensional normal velocity field given by \a Vn.
184  void v_Upwind(
186  const Array<OneD, const NekDouble> &Fwd,
187  const Array<OneD, const NekDouble> &Bwd,
188  Array<OneD, NekDouble> &Upwind);
189 
190  /// Populate \a normals with the normals of all expansions.
191  void v_GetNormals(Array<OneD, Array<OneD, NekDouble> > &normals);
192 
193  private:
194  virtual void v_ReadGlobalOptimizationParameters();
195 
196  /// Set up the normals on each expansion.
197  virtual void v_SetUpPhysNormals();
198  /// const StdRegions::StdExpansionVector &locexp);
199 
200  virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip);
201 
203 
205  };
206 
207  /// Empty ExpList1D object.
210 
211  } //end of namespace
212 } //end of namespace
213 
214 #endif//NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
215 
ExpList1D()
The default constructor.
Definition: ExpList1D.cpp:77
#define MULTI_REGIONS_EXPORT
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
virtual void v_SetUpPhysNormals()
Set up the normals on each expansion.
Definition: ExpList1D.cpp:922
std::vector< ExpansionSharedPtr > ExpansionVector
Definition: Expansion.h:70
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
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:944
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:101
boost::shared_ptr< ExpList1D > ExpList1DSharedPtr
Shared pointer to an ExpList1D object.
Definition: ExpList1D.h:50
std::vector< ExpList1DSharedPtr > ExpList1DVector
Vector of pointers to ExpList1D objects.
Definition: ExpList1D.h:55
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:819
boost::shared_ptr< Kernel > KernelSharedPtr
Definition: kernel.h:215
double NekDouble
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::map< int, Composite > CompositeMap
Definition: MeshGraph.h:115
static const Array< OneD, ExpList1DSharedPtr > NullExpList1DSharedPtrArray
Empty ExpList1D object.
Definition: ExpList1D.h:209
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
Array< OneD, NekDouble > m_normSign
Definition: ExpList1D.h:204
void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
Definition: ExpList1D.cpp:1047
This class is the abstraction of a one-dimensional multi-elemental expansions which is merely a colle...
Definition: ExpList1D.h:61
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:720
virtual void v_ReadGlobalOptimizationParameters()
Definition: ExpList1D.cpp:1157
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:219
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
const StdRegions::StdExpansionVector &locexp);
Definition: ExpList1D.cpp:1176
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:442
std::vector< ExpList1DSharedPtr >::iterator ExpList1DVectorIter
Iterator for the vector of ExpList1D pointers.
Definition: ExpList1D.h:57
virtual ~ExpList1D()
Destructor.
Definition: ExpList1D.cpp:706
void ParNormalSign(Array< OneD, NekDouble > &normsign)
Set up the normals on each expansion.
Describes the specification for a Basis.
Definition: Basis.h:50