Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DisContField3DHomogeneous1D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File DisContField3DHomogeneous1D.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: Field definition in three-dimensions for a discontinuous
33 // LDG-H expansion with a homogeneous direction in 1D
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_LIBS_MULTIREGIONS_DISCONTFIELD3DHOMO1D_H
38 #define NEKTAR_LIBS_MULTIREGIONS_DISCONTFIELD3DHOMO1D_H
39 
43 #include <MultiRegions/ExpList2D.h>
47 
48 
49 namespace Nektar
50 {
51  namespace MultiRegions
52  {
54  {
55  public:
57 
60  const LibUtilities::BasisKey &HomoBasis,
61  const NekDouble lhom,
62  const bool useFFT,
63  const bool dealiasing);
64 
67  const LibUtilities::BasisKey &HomoBasis,
68  const NekDouble lhom,
69  const bool useFFT,
70  const bool dealiasing,
72  const std::string &variable,
75 
76 
77  /// Copy constructor.
79  const DisContField3DHomogeneous1D &In,
80  const bool DeclarePlanesSetCoeffPhys = true);
81 
82  /// Destructor.
84 
86  const LibUtilities::BasisKey &HomoBasis,
87  const NekDouble lhom,
89  const std::string variable);
90 
91  /**
92  * \brief This function evaluates the boundary conditions
93  * at a certaintime-level.
94  *
95  * Based on the boundary condition \f$g(\boldsymbol{x},t)\f$
96  * evaluated at a given time-level \a t, this function transforms
97  * the boundary conditions onto the coefficients of the
98  * (one-dimensional) boundary expansion.
99  * Depending on the type of boundary conditions, these expansion
100  * coefficients are calculated in different ways:
101  * - <b>Dirichlet boundary conditions</b><BR>
102  * In order to ensure global \f$C^0\f$ continuity of the
103  * spectral/hp approximation, the Dirichlet boundary conditions
104  * are projected onto the boundary expansion by means of a
105  * modified \f$C^0\f$ continuous Galerkin projection.
106  * This projection can be viewed as a collocation projection at the
107  * vertices, followed by an \f$L^2\f$ projection on the interior
108  * modes of the edges. The resulting coefficients
109  * \f$\boldsymbol{\hat{u}}^{\mathcal{D}}\f$ will be stored for the
110  * boundary expansion.
111  * - <b>Neumann boundary conditions</b>
112  * In the discrete Galerkin formulation of the problem to be
113  * solved, the Neumann boundary conditions appear as the set of
114  * surface integrals: \f[\boldsymbol{\hat{g}}=\int_{\Gamma}
115  * \phi^e_n(\boldsymbol{x})g(\boldsymbol{x})d(\boldsymbol{x})\quad
116  * \forall n \f]
117  * As a result, it are the coefficients \f$\boldsymbol{\hat{g}}\f$
118  * that will be stored in the boundary expansion
119  *
120  * \param time The time at which the boundary conditions should be
121  * evaluated
122  */
124  const NekDouble time = 0.0,
125  const std::string varName = "");
126 
129 
130  inline const Array<OneD,const SpatialDomains::
132 
133  inline boost::shared_ptr<ExpList> &UpdateBndCondExpansion(int i);
134 
137 
138  /// \brief Set up a list of element ids and edge ids the link to the
139  /// boundary conditions
141  Array<OneD, int> &ElmtID,
142  Array<OneD,int> &EdgeID);
143 
144  virtual void v_GetBndElmtExpansion(int i,
145  boost::shared_ptr<ExpList> &result,
146  const bool DeclareCoeffPhysArrays);
147 
148  /// This funtion extract form a vector containing a full
149  /// 3D-homogenous-1D field the value associated with a
150  /// specific boundary conditions.
151  /// TotField is the full field contaning all the physical values
152  /// BndVals is the vector where the boundary physical values are
153  /// stored BndID is the identifier of the boundary region
155  Array<OneD, NekDouble> &BndVals,
156  const Array<OneD, NekDouble> &TotField,
157  int BndID);
158 
159  /// This function calculate the inner product of two vectors
160  /// (V1 and V2) respect to the basis along a boundary region.
161  /// outarray is the inner product result multiplied by the normal to
162  /// the edge (specified by the BndID)
166  Array<OneD, NekDouble> &outarray,
167  int BndID);
168 
169  /// Storage space for the boundary to element and boundary to trace
170  /// map. This member variable is really allocated just in case
171  /// a boundary expansion recasting is required at the solver level.
172  /// Otherwise is the 2 vectors are not filled up.
173  /// If is needed all the funcitons whihc require to use this map
174  /// do not have to recalculate it anymore.
177 
178  protected:
179  /**
180  * \brief An object which contains the discretised
181  * boundary conditions.
182  *
183  * It is an array of size equal to the number of boundary
184  * regions and consists of entries of the type
185  * MultiRegions#ExpList1D. Every entry corresponds to the
186  * one-dimensional spectral/hp expansion on a single
187  * boundary region. The values of the boundary conditions
188  * are stored as the coefficients of the one-dimensional
189  * expansion.
190  */
191 
193 
195 
197 
198  /**
199  * \brief An array which contains the information about
200  * the boundary condition on the different boundary
201  * regions.
202  */
204 
206  Array<OneD,int> &ElmtID,
207  Array<OneD,int> &EdgeID)
208  {
209  GetBoundaryToElmtMap(ElmtID, EdgeID);
210  }
211 
212  virtual void v_GetBCValues(
213  Array<OneD, NekDouble> &BndVals,
214  const Array<OneD, NekDouble> &TotField,
215  int BndID)
216  {
217  GetBCValues(BndVals, TotField, BndID);
218  }
219 
223  Array<OneD, NekDouble> &outarray,
224  int BndID)
225  {
226  NormVectorIProductWRTBase(V1,V2,outarray,BndID);
227  }
228 
229  /// Set up all DG member variables and maps
231 
232  /// @todo Fix in another way considering all the planes
234  {
235  return m_trace;
236  }
237 
238  /// @todo Fix in another way considering all the planes
240  {
241  return m_planes[0]->GetTraceMap();
242  }
243 
246  {
247  return GetBndCondExpansions();
248  }
249 
250  virtual const
253  {
254  return GetBndConditions();
255  }
256 
257  /// @todo Fix Robin BCs for homogeneous case
258  virtual std::map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo()
259  {
260  return std::map<int, RobinBCInfoSharedPtr>();
261  }
262 
263  virtual void v_ExtractTracePhys(
264  const Array<OneD, const NekDouble> &inarray,
265  Array<OneD, NekDouble> &outarray);
266 
267  virtual void v_ExtractTracePhys(
268  Array<OneD, NekDouble> &outarray);
269 
270  virtual void v_GetBoundaryNormals(int i,
271  Array<OneD, Array<OneD, NekDouble> > &normals);
272 
273  private:
274  // virtual functions
275  virtual void v_HelmSolve(
276  const Array<OneD, const NekDouble> &inarray,
277  Array<OneD, NekDouble> &outarray,
278  const FlagList &flags,
279  const StdRegions::ConstFactorMap &factors,
280  const StdRegions::VarCoeffMap &varcoeff,
281  const Array<OneD, const NekDouble> &dirForcing,
282  const bool PhysSpaceForcing);
283 
284  virtual void v_EvaluateBoundaryConditions(
285  const NekDouble time = 0.0,
286  const std::string varName = "",
289 
290  virtual boost::shared_ptr<ExpList> &v_UpdateBndCondExpansion(int i);
291 
294 
296  {
297  return m_traceBndMap;
298  }
299  };
300 
301  typedef boost::shared_ptr<DisContField3DHomogeneous1D>
303 
306  {
307  return m_bndCondExpansions;
308  }
309 
312  {
313  return m_bndConditions;
314  }
315 
318  {
319  return m_bndCondExpansions[i];
320  }
321 
324  {
325  return m_bndConditions;
326  }
327  } //end of namespace
328 } //end of namespace
329 
330 #endif // MULTIERGIONS_DISCONTFIELD3DHOMO1D_H
boost::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
Definition: AssemblyMapDG.h:49
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
void SetUpDG()
Set up all DG member variables and maps.
boost::shared_ptr< DisContField3DHomogeneous1D > DisContField3DHomogeneous1DSharedPtr
boost::shared_ptr< ExpList > & UpdateBndCondExpansion(int i)
#define MULTI_REGIONS_EXPORT
Array< OneD, int > m_BCtoElmMap
Storage space for the boundary to element and boundary to trace map. This member variable is really a...
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:252
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
virtual void v_ExtractTracePhys(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This method extracts the trace (edges in 2D) for each plane from the field inarray and puts the value...
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
virtual void v_GetBndElmtExpansion(int i, boost::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
virtual boost::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo()
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & GetBndConditions()
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:227
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
virtual const Array< OneD, const int > & v_GetTraceBndMap()
Array< OneD, ExpListSharedPtr > m_planes
double NekDouble
Defines a list of flags.
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
static const NekDouble kNekUnsetDouble
void SetupBoundaryConditions(const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom, SpatialDomains::BoundaryConditions &bcs, const std::string variable)
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions()
const Array< OneD, const MultiRegions::ExpListSharedPtr > & GetBndCondExpansions()
virtual void v_EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble x2_in=NekConstants::kNekUnsetDouble, const NekDouble x3_in=NekConstants::kNekUnsetDouble)
void GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
This funtion extract form a vector containing a full 3D-homogenous-1D field the value associated with...
void NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
This function calculate the inner product of two vectors (V1 and V2) respect to the basis along a bou...
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Set up a list of element ids and edge ids the link to the boundary conditions.
virtual const Array< OneD, const MultiRegions::ExpListSharedPtr > & v_GetBndCondExpansions(void)
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:219
void EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="")
This function evaluates the boundary conditions at a certaintime-level.
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:442
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Describes the specification for a Basis.
Definition: Basis.h:50
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...