Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExpList2D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File ExpList2D.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 2D header definition
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef EXPLIST2D_H
37 #define EXPLIST2D_H
38 
40 #include <vector>
41 #include <MultiRegions/ExpList.h>
43 
44 namespace Nektar
45 {
46  namespace MultiRegions
47  {
48  // Forward declaration for typedefs
49  class ExpList2D;
50 
51  /// Shared pointer to an ExpList2D object.
52  typedef boost::shared_ptr<ExpList2D> ExpList2DSharedPtr;
53  /// Vector of pointers to ExpList2D objects.
54  typedef std::vector< ExpList2DSharedPtr > ExpList2DVector;
55  /// Iterator for the vector of ExpList2D pointers.
57 
58  /// Abstraction of a two-dimensional multi-elemental expansion which
59  /// is merely a collection of local expansions.
60  class ExpList2D: public ExpList
61  {
62  public:
63  /// Default constructor.
65 
66  /// Copy constructor.
67  MULTI_REGIONS_EXPORT ExpList2D( const ExpList2D &In,
68  const bool DeclareCoeffPhysArrays = true);
69 
70  /// Sets up a list of local expansions based on an input mesh.
74  const bool DelcareCoeffPhysArrays = true,
75  const std::string &var = "DefaultVar");
76 
77  /// Sets up a list of local expansions based on an expansion Map
80  const SpatialDomains::ExpansionMap &expansions,
81  const bool DeclareCoeffPhysArrays = true);
82 
83  /// Sets up a list of local expansions based on an input mesh
84  /// and separately defined basiskeys
87  const LibUtilities::BasisKey &TriBa,
88  const LibUtilities::BasisKey &TriBb,
89  const LibUtilities::BasisKey &QuadBa,
90  const LibUtilities::BasisKey &QuadBb,
94 
95  //Specialized constructor for trace expansions.
98  const Array<OneD,const ExpListSharedPtr> &bndConstraint,
99  const Array<OneD,const SpatialDomains::BoundaryConditionShPtr>
100  &bndCond,
101  const LocalRegions::ExpansionVector &locexp,
102  const SpatialDomains::MeshGraphSharedPtr &graph3D,
103  const PeriodicMap &periodicFaces,
104  const bool DeclareCoeffPhysArrays = true,
105  const std::string variable = "DefaultVar");
106 
107  /// Specialised constructor for Neumann boundary conditions in
108  /// DisContField3D and ContField3D.
110  const LibUtilities::SessionReaderSharedPtr &pSession,
111  const SpatialDomains::CompositeMap &domain,
112  const SpatialDomains::MeshGraphSharedPtr &graph3D,
113  const std::string variable = "DefaultVar");
114 
115  /// Destructor.
117 
118  protected:
119  /// Upwind the \a Fwd and \a Bwd states based on the one-
120  /// dimensional normal velocity field given by \a Vn.
122  const Array<OneD, const NekDouble> &Vn,
123  const Array<OneD, const NekDouble> &Fwd,
124  const Array<OneD, const NekDouble> &Bwd,
125  Array<OneD, NekDouble> &Upwind);
126 
127  void v_GetNormals(
128  Array<OneD, Array<OneD, NekDouble> > &normals);
129 
130  private:
131  /// Definition of the total number of degrees of freedom and
132  /// quadrature points and offsets to access datax
133  void SetCoeffPhysOffsets(void);
134 
135  /// Set up the normals on each expansion.
136  virtual void v_SetUpPhysNormals();
137 
138  virtual void v_ReadGlobalOptimizationParameters();
139 
140  virtual void v_WriteVtkPieceHeader(
141  std::ofstream &outfile, int expansion);
142 
143  virtual void v_PhysInterp1DScaled(
144  const NekDouble scale,
145  const Array<OneD, NekDouble> &inarray,
146  Array<OneD, NekDouble> &outarray);
147 
149  const NekDouble scale,
150  const Array<OneD, NekDouble> &inarray,
151  Array<OneD, NekDouble> &outarray);
152  };
153 
154  /// Empty ExpList2D object.
155  const static Array<OneD, ExpList2DSharedPtr>
157  } //end of namespace
158 } //end of namespace
159 
160 #endif//EXPLIST2D_H
161