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  /// 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 SpatialDomains::CompositeMap &domain,
101  const SpatialDomains::MeshGraphSharedPtr &graph2D,
102  const bool DeclareCoeffPhysArrays = true,
103  const std::string variable = "DefaultVar");
104 
105 
107  const LibUtilities::SessionReaderSharedPtr &pSession,
108  const SpatialDomains::CompositeMap &domain,
109  const SpatialDomains::MeshGraphSharedPtr &graph1D,
110  int i,
111  const bool DeclareCoeffPhysArrays = true);
112 
113  /// Specialised constructor for trace expansions.
115  const LibUtilities::SessionReaderSharedPtr &pSession,
116  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
117  const Array<OneD,const SpatialDomains
118  ::BoundaryConditionShPtr> &bndCond,
119  const LocalRegions::ExpansionVector &locexp,
120  const SpatialDomains::MeshGraphSharedPtr &graph2D,
121  const PeriodicMap &periodicEdges,
122  const bool DeclareCoeffPhysArrays = true,
123  const std::string variable = "DefaultVar");
124 
125  /// Destructor.
127 
128  /// Performs the post-processing on a specified element.
131  Array<OneD,NekDouble> &inarray,
132  Array<OneD,NekDouble> &outarray,
133  NekDouble h,
134  int elmId = 0);
135 
136  /// Evaluates the global spectral/hp expansion at some arbitray set
137  /// of points.
139  Array<OneD,NekDouble> &inarray1,
140  Array<OneD,NekDouble> &inarray2,
141  NekDouble h, int nmodes,
142  Array<OneD,NekDouble> &outarray);
143 
144  /// Set up the normals on each expansion.
145  //MULTI_REGIONS_EXPORT void SetUpPhysNormals();
146  //const StdRegions::StdExpansionVector &locexp);
147 
148  MULTI_REGIONS_EXPORT void ParNormalSign(Array<OneD, NekDouble> &normsign);
149 
150  protected:
151  /// Upwind the \a Fwd and \a Bwd states based on the velocity
152  /// field given by \a Vec.
153  void v_Upwind(
154  const Array<OneD, const Array<OneD, NekDouble> > &Vec,
155  const Array<OneD, const NekDouble> &Fwd,
156  const Array<OneD, const NekDouble> &Bwd,
157  Array<OneD, NekDouble> &Upwind);
158 
159  /// Upwind the \a Fwd and \a Bwd states based on the one-
160  /// dimensional normal velocity field given by \a Vn.
161  void v_Upwind(
162  const Array<OneD, const NekDouble> &Vn,
163  const Array<OneD, const NekDouble> &Fwd,
164  const Array<OneD, const NekDouble> &Bwd,
165  Array<OneD, NekDouble> &Upwind);
166 
167  /// Populate \a normals with the normals of all expansions.
168  void v_GetNormals(Array<OneD, Array<OneD, NekDouble> > &normals);
169 
170  private:
171  /// Definition of the total number of degrees of freedom and
172  /// quadrature points. Sets up the storage for \a m_coeff and \a
173  /// m_phys.
174  void SetCoeffPhysOffsets(void);
175 
176  virtual void v_ReadGlobalOptimizationParameters();
177 
178  /// Set up the normals on each expansion.
179  virtual void v_SetUpPhysNormals();
180  /// const StdRegions::StdExpansionVector &locexp);
181 
182  virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion);
183 
185 
186  Array<OneD, NekDouble> m_normSign;
187  };
188 
189  /// Empty ExpList1D object.
190  const static Array<OneD, ExpList1DSharedPtr>
192 
193  } //end of namespace
194 } //end of namespace
195 
196 #endif//NEKTAR_LIB_MULTIREGIONS_EXPLIST1D_H
197