Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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  /// Constructor copying only elements defined in eIds.
73  MULTI_REGIONS_EXPORT ExpList1D( const ExpList1D &In,
74  const std::vector<unsigned int> &eIDs,
75  const bool DeclareCoeffPhysArrays = true);
76 
77  /// Construct an ExpList1D from a given graph.
80  const LibUtilities::BasisKey &Ba,
81  const SpatialDomains::MeshGraphSharedPtr &graph1D);
82 
83  /// This constructor sets up a list of local expansions based on an
84  /// input graph1D.
88  const bool DeclareCoeffPhysArrays = true);
89 
90 
91  /// This constructor sets up a list of local expansions based on an
92  /// input compositeMap
96  const SpatialDomains::CompositeMap &domain,
97  const bool DeclareCoeffPhysArrays = true,
98  const std::string var = "DefaultVar",
99  bool SetToOneSpaceDimension = false);
100 
101 
102  /// Specialised constructor for Neumann boundary conditions in
103  /// DisContField2D and ContField2D.
105  const LibUtilities::SessionReaderSharedPtr &pSession,
106  const SpatialDomains::CompositeMap &domain,
107  const SpatialDomains::MeshGraphSharedPtr &graph2D,
108  const bool DeclareCoeffPhysArrays = true,
109  const std::string variable = "DefaultVar");
110 
111 
113  const LibUtilities::SessionReaderSharedPtr &pSession,
114  const SpatialDomains::CompositeMap &domain,
115  const SpatialDomains::MeshGraphSharedPtr &graph1D,
116  int i,
117  const bool DeclareCoeffPhysArrays = true);
118 
119  /// Specialised constructor for trace expansions.
121  const LibUtilities::SessionReaderSharedPtr &pSession,
122  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
123  const Array<OneD,const SpatialDomains
124  ::BoundaryConditionShPtr> &bndCond,
125  const LocalRegions::ExpansionVector &locexp,
126  const SpatialDomains::MeshGraphSharedPtr &graph2D,
127  const PeriodicMap &periodicEdges,
128  const bool DeclareCoeffPhysArrays = true,
129  const std::string variable = "DefaultVar");
130 
131  /// Destructor.
133 
134  /// Performs the post-processing on a specified element.
137  Array<OneD,NekDouble> &inarray,
138  Array<OneD,NekDouble> &outarray,
139  NekDouble h,
140  int elmId = 0);
141 
142  /// Evaluates the global spectral/hp expansion at some arbitray set
143  /// of points.
145  Array<OneD,NekDouble> &inarray1,
146  Array<OneD,NekDouble> &inarray2,
147  NekDouble h, int nmodes,
148  Array<OneD,NekDouble> &outarray);
149 
150  /// Set up the normals on each expansion.
151  //MULTI_REGIONS_EXPORT void SetUpPhysNormals();
152  //const StdRegions::StdExpansionVector &locexp);
153 
155 
156  protected:
157  /// Upwind the \a Fwd and \a Bwd states based on the velocity
158  /// field given by \a Vec.
159  void v_Upwind(
160  const Array<OneD, const Array<OneD, NekDouble> > &Vec,
161  const Array<OneD, const NekDouble> &Fwd,
162  const Array<OneD, const NekDouble> &Bwd,
164 
165  /// Upwind the \a Fwd and \a Bwd states based on the one-
166  /// dimensional normal velocity field given by \a Vn.
167  void v_Upwind(
169  const Array<OneD, const NekDouble> &Fwd,
170  const Array<OneD, const NekDouble> &Bwd,
171  Array<OneD, NekDouble> &Upwind);
172 
173  /// Populate \a normals with the normals of all expansions.
174  void v_GetNormals(Array<OneD, Array<OneD, NekDouble> > &normals);
175 
176  private:
177  /// Definition of the total number of degrees of freedom and
178  /// quadrature points. Sets up the storage for \a m_coeff and \a
179  /// m_phys.
180  void SetCoeffPhysOffsets(void);
181 
182  virtual void v_ReadGlobalOptimizationParameters();
183 
184  /// Set up the normals on each expansion.
185  virtual void v_SetUpPhysNormals();
186  /// const StdRegions::StdExpansionVector &locexp);
187 
188  virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip);
189 
191 
193  };
194 
195  /// Empty ExpList1D object.
198 
199  } //end of namespace
200 } //end of namespace
201 
202 #endif//NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
203 
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:949
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:1986
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:971
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:846
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
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
Definition: ExpList1D.cpp:709
static const Array< OneD, ExpList1DSharedPtr > NullExpList1DSharedPtrArray
Empty ExpList1D object.
Definition: ExpList1D.h:197
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
Array< OneD, NekDouble > m_normSign
Definition: ExpList1D.h:192
void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
Definition: ExpList1D.cpp:1074
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:747
virtual void v_ReadGlobalOptimizationParameters()
Definition: ExpList1D.cpp:1184
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:208
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
const StdRegions::StdExpansionVector &locexp);
Definition: ExpList1D.cpp:1203
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:733
void ParNormalSign(Array< OneD, NekDouble > &normsign)
Set up the normals on each expansion.
Describes the specification for a Basis.
Definition: Basis.h:50