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 // 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  /// Construct an ExpList1D from a given graph.
75  const LibUtilities::BasisKey &Ba,
76  const SpatialDomains::MeshGraphSharedPtr &graph1D);
77 
78  /// This constructor sets up a list of local expansions based on an
79  /// input graph1D.
83  const bool DeclareCoeffPhysArrays = true);
84 
85 
86  /// This constructor sets up a list of local expansions based on an
87  /// input compositeMap
91  const SpatialDomains::CompositeMap &domain,
92  const bool DeclareCoeffPhysArrays = true,
93  const std::string var = "DefaultVar",
94  bool SetToOneSpaceDimension = false);
95 
96 
97  /// Specialised constructor for Neumann boundary conditions in
98  /// DisContField2D and ContField2D.
100  const LibUtilities::SessionReaderSharedPtr &pSession,
101  const SpatialDomains::CompositeMap &domain,
102  const SpatialDomains::MeshGraphSharedPtr &graph2D,
103  const bool DeclareCoeffPhysArrays = true,
104  const std::string variable = "DefaultVar");
105 
106 
108  const LibUtilities::SessionReaderSharedPtr &pSession,
109  const SpatialDomains::CompositeMap &domain,
110  const SpatialDomains::MeshGraphSharedPtr &graph1D,
111  int i,
112  const bool DeclareCoeffPhysArrays = true);
113 
114  /// Specialised constructor for trace expansions.
116  const LibUtilities::SessionReaderSharedPtr &pSession,
117  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
118  const Array<OneD,const SpatialDomains
119  ::BoundaryConditionShPtr> &bndCond,
120  const LocalRegions::ExpansionVector &locexp,
121  const SpatialDomains::MeshGraphSharedPtr &graph2D,
122  const PeriodicMap &periodicEdges,
123  const bool DeclareCoeffPhysArrays = true,
124  const std::string variable = "DefaultVar");
125 
126  /// Destructor.
128 
129  /// Performs the post-processing on a specified element.
132  Array<OneD,NekDouble> &inarray,
133  Array<OneD,NekDouble> &outarray,
134  NekDouble h,
135  int elmId = 0);
136 
137  /// Evaluates the global spectral/hp expansion at some arbitray set
138  /// of points.
140  Array<OneD,NekDouble> &inarray1,
141  Array<OneD,NekDouble> &inarray2,
142  NekDouble h, int nmodes,
143  Array<OneD,NekDouble> &outarray);
144 
145  /// Set up the normals on each expansion.
146  //MULTI_REGIONS_EXPORT void SetUpPhysNormals();
147  //const StdRegions::StdExpansionVector &locexp);
148 
150 
151  protected:
152  /// Upwind the \a Fwd and \a Bwd states based on the velocity
153  /// field given by \a Vec.
154  void v_Upwind(
155  const Array<OneD, const Array<OneD, NekDouble> > &Vec,
156  const Array<OneD, const NekDouble> &Fwd,
157  const Array<OneD, const NekDouble> &Bwd,
159 
160  /// Upwind the \a Fwd and \a Bwd states based on the one-
161  /// dimensional normal velocity field given by \a Vn.
162  void v_Upwind(
164  const Array<OneD, const NekDouble> &Fwd,
165  const Array<OneD, const NekDouble> &Bwd,
166  Array<OneD, NekDouble> &Upwind);
167 
168  /// Populate \a normals with the normals of all expansions.
169  void v_GetNormals(Array<OneD, Array<OneD, NekDouble> > &normals);
170 
171  private:
172  /// Definition of the total number of degrees of freedom and
173  /// quadrature points. Sets up the storage for \a m_coeff and \a
174  /// m_phys.
175  void SetCoeffPhysOffsets(void);
176 
177  virtual void v_ReadGlobalOptimizationParameters();
178 
179  /// Set up the normals on each expansion.
180  virtual void v_SetUpPhysNormals();
181  /// const StdRegions::StdExpansionVector &locexp);
182 
183  virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip);
184 
186 
188  };
189 
190  /// Empty ExpList1D object.
193 
194  } //end of namespace
195 } //end of namespace
196 
197 #endif//NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
198 
ExpList1D()
The default constructor.
Definition: ExpList1D.cpp:75
std::map< int, vector< PeriodicEntity > > PeriodicMap
#define MULTI_REGIONS_EXPORT
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:50
virtual void v_SetUpPhysNormals()
Set up the normals on each expansion.
Definition: ExpList1D.cpp:925
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:1924
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:947
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:822
boost::shared_ptr< Kernel > KernelSharedPtr
Definition: kernel.h:215
double NekDouble
std::map< int, Composite > CompositeMap
Definition: MeshGraph.h:112
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
Definition: ExpList1D.cpp:685
static const Array< OneD, ExpList1DSharedPtr > NullExpList1DSharedPtrArray
Empty ExpList1D object.
Definition: ExpList1D.h:192
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
Array< OneD, NekDouble > m_normSign
Definition: ExpList1D.h:187
void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
Definition: ExpList1D.cpp:1050
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:723
virtual void v_ReadGlobalOptimizationParameters()
Definition: ExpList1D.cpp:1160
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:206
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
const StdRegions::StdExpansionVector &locexp);
Definition: ExpList1D.cpp:1179
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:432
std::vector< ExpList1DSharedPtr >::iterator ExpList1DVectorIter
Iterator for the vector of ExpList1D pointers.
Definition: ExpList1D.h:57
virtual ~ExpList1D()
Destructor.
Definition: ExpList1D.cpp:709
void ParNormalSign(Array< OneD, NekDouble > &normsign)
Set up the normals on each expansion.
Describes the specification for a Basis.
Definition: Basis.h:50