Nektar++
ExpList3DHomogeneous1D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File ExpList3DHomogeneous1D.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: A 3D field which is homogeneous in 1 direction and so
32 // uses much of the functionality from a ExpList2D and its daughters
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef EXPLIST3DHOMO1D_H
37 #define EXPLIST3DHOMO1D_H
38 
39 #include <boost/core/ignore_unused.hpp>
40 
42 #include <vector>
44 
45 namespace Nektar
46 {
47  namespace MultiRegions
48  {
49 
50  // Forward declaration for typedefs
51  class ExpList3DHomogeneous1D;
52 
53  /// Shared pointer to an ExpList3DHomogeneous1D object.
54  typedef std::shared_ptr<ExpList3DHomogeneous1D> ExpList3DHomogeneous1DSharedPtr;
55  /// Vector of pointers to ExpList3DHomogeneous1D objects.
56  typedef std::vector< ExpList3DHomogeneous1DSharedPtr > ExpList3DHomogeneous1DVector;
57 
58  /// Abstraction of a two-dimensional multi-elemental expansion which
59  /// is merely a collection of local expansions.
61  {
62  public:
63  /// Default constructor.
65 
68  const LibUtilities::BasisKey &HomoBasis,
69  const NekDouble lhom,
70  const bool useFFT,
71  const bool dealiasing);
72 
73  /// Sets up a list of local expansions based on an input mesh.
76  const LibUtilities::BasisKey &HomoBasis,
77  const NekDouble lhom,
78  const bool useFFT,
79  const bool dealiasing,
81  const std::string &var = "DefaultVar",
84 
85 
86  /// Sets up a list of local expansions based on an mesh expansion
89  const LibUtilities::BasisKey &HomoBasis,
90  const NekDouble lhom,
91  const bool useFFT,
92  const bool dealiasing,
93  const SpatialDomains::ExpansionInfoMap &expansions,
96 
97  /// Copy constructor.
99  const ExpList3DHomogeneous1D &In,
100  const bool DeclarePlanesSetCoeffPhys = true);
101 
102  /// Constructor copying only elements defined in eIds.
104  const ExpList3DHomogeneous1D &In,
105  const std::vector<unsigned int> &eIDs,
106  const bool DeclarePlanesSetCoeffPhys = true,
107  const Collections::ImplementationType ImpType
109 
110  /// Destructor.
112 
113  /// This function calculates the coordinates of all the elemental
114  /// quadrature points \f$\boldsymbol{x}_i\f$.
115  inline void GetCoords(Array<OneD, NekDouble> &coord_0,
118 
119  MULTI_REGIONS_EXPORT void GetCoords(const int eid,
123 
124  protected:
125 
126  /// Definition of the total number of degrees of freedom and
127  /// quadrature points. Sets up the storage for \a m_coeff and \a
128  /// m_phys.
129  void SetCoeffPhys(void);
130 
131  // virtual functions
132  virtual void v_GetCoords(Array<OneD, NekDouble> &coord_0,
133  Array<OneD, NekDouble> &coord_1,
134  Array<OneD, NekDouble> &coord_2);
135 
136  virtual void v_WriteTecplotConnectivity(std::ostream &outfile,
137  int expansion);
138 
139  virtual void v_WriteVtkPieceHeader(std::ostream &outfile,
140  int expansion, int istrip);
141 
142  virtual NekDouble v_L2(
143  const Array<OneD, const NekDouble> &inarray,
145 
147 
148  virtual void v_GetPeriodicEntities(
149  PeriodicMap &periodicVerts,
150  PeriodicMap &periodicEdges,
151  PeriodicMap &periodicFaces)
152  {
153  boost::ignore_unused(periodicFaces);
154  m_planes[0]->GetPeriodicEntities(periodicVerts,periodicEdges);
155  }
156 
157  private:
158 
160 
161  };
162 
164  Array<OneD, NekDouble> &coord_1,
165  Array<OneD, NekDouble> &coord_2)
166 
167  {
168  v_GetCoords(coord_0,coord_1,coord_2);
169  }
170  } //end of namespace
171 } //end of namespace
172 
173 #endif//EXPLIST3DHOMO1D_H
174 
#define MULTI_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:50
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
void GenExpList3DHomogeneous1D(const SpatialDomains::ExpansionInfoMap &expansions, const Collections::ImplementationType ImpType)
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2)
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
void GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
This function calculates the coordinates of all the elemental quadrature points .
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Array< OneD, ExpListSharedPtr > m_planes
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::vector< ExpList3DHomogeneous1DSharedPtr > ExpList3DHomogeneous1DVector
Vector of pointers to ExpList3DHomogeneous1D objects.
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::shared_ptr< ExpList3DHomogeneous1D > ExpList3DHomogeneous1DSharedPtr
Shared pointer to an ExpList3DHomogeneous1D object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
Definition: MeshGraph.h:143
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
static Array< OneD, NekDouble > NullNekDouble1DArray
double NekDouble