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);
73 
74  /// Copy constructor.
76  const DisContField3DHomogeneous1D &In,
77  const bool DeclarePlanesSetCoeffPhys = true);
78 
79  /// Destructor.
81 
83  const LibUtilities::BasisKey &HomoBasis,
84  const NekDouble lhom,
86  const std::string variable);
87 
88  /**
89  * \brief This function evaluates the boundary conditions
90  * at a certaintime-level.
91  *
92  * Based on the boundary condition \f$g(\boldsymbol{x},t)\f$
93  * evaluated at a given time-level \a t, this function transforms
94  * the boundary conditions onto the coefficients of the
95  * (one-dimensional) boundary expansion.
96  * Depending on the type of boundary conditions, these expansion
97  * coefficients are calculated in different ways:
98  * - <b>Dirichlet boundary conditions</b><BR>
99  * In order to ensure global \f$C^0\f$ continuity of the
100  * spectral/hp approximation, the Dirichlet boundary conditions
101  * are projected onto the boundary expansion by means of a
102  * modified \f$C^0\f$ continuous Galerkin projection.
103  * This projection can be viewed as a collocation projection at the
104  * vertices, followed by an \f$L^2\f$ projection on the interior
105  * modes of the edges. The resulting coefficients
106  * \f$\boldsymbol{\hat{u}}^{\mathcal{D}}\f$ will be stored for the
107  * boundary expansion.
108  * - <b>Neumann boundary conditions</b>
109  * In the discrete Galerkin formulation of the problem to be
110  * solved, the Neumann boundary conditions appear as the set of
111  * surface integrals: \f[\boldsymbol{\hat{g}}=\int_{\Gamma}
112  * \phi^e_n(\boldsymbol{x})g(\boldsymbol{x})d(\boldsymbol{x})\quad
113  * \forall n \f]
114  * As a result, it are the coefficients \f$\boldsymbol{\hat{g}}\f$
115  * that will be stored in the boundary expansion
116  *
117  * \param time The time at which the boundary conditions should be
118  * evaluated
119  */
121  const NekDouble time = 0.0,
122  const std::string varName = "");
123 
126 
127  inline const Array<OneD,const SpatialDomains::
129 
130  inline boost::shared_ptr<ExpList> &UpdateBndCondExpansion(int i);
131 
134 
135  /// \brief Set up a list of element ids and edge ids the link to the
136  /// boundary conditions
138  Array<OneD, int> &ElmtID,
139  Array<OneD,int> &EdgeID);
140 
141  virtual void v_GetBndElmtExpansion(int i,
142  boost::shared_ptr<ExpList> &result,
143  const bool DeclareCoeffPhysArrays);
144 
145  /// This funtion extract form a vector containing a full
146  /// 3D-homogenous-1D field the value associated with a
147  /// specific boundary conditions.
148  /// TotField is the full field contaning all the physical values
149  /// BndVals is the vector where the boundary physical values are
150  /// stored BndID is the identifier of the boundary region
152  Array<OneD, NekDouble> &BndVals,
153  const Array<OneD, NekDouble> &TotField,
154  int BndID);
155 
156  /// This function calculate the inner product of two vectors
157  /// (V1 and V2) respect to the basis along a boundary region.
158  /// outarray is the inner product result multiplied by the normal to
159  /// the edge (specified by the BndID)
163  Array<OneD, NekDouble> &outarray,
164  int BndID);
165 
166  /// Storage space for the boundary to element and boundary to trace
167  /// map. This member variable is really allocated just in case
168  /// a boundary expansion recasting is required at the solver level.
169  /// Otherwise is the 2 vectors are not filled up.
170  /// If is needed all the funcitons whihc require to use this map
171  /// do not have to recalculate it anymore.
174 
175  protected:
176  /**
177  * \brief An object which contains the discretised
178  * boundary conditions.
179  *
180  * It is an array of size equal to the number of boundary
181  * regions and consists of entries of the type
182  * MultiRegions#ExpList1D. Every entry corresponds to the
183  * one-dimensional spectral/hp expansion on a single
184  * boundary region. The values of the boundary conditions
185  * are stored as the coefficients of the one-dimensional
186  * expansion.
187  */
188 
190 
192 
194 
195  /**
196  * \brief An array which contains the information about
197  * the boundary condition on the different boundary
198  * regions.
199  */
201 
203  Array<OneD,int> &ElmtID,
204  Array<OneD,int> &EdgeID)
205  {
206  GetBoundaryToElmtMap(ElmtID, EdgeID);
207  }
208 
209  virtual void v_GetBCValues(
210  Array<OneD, NekDouble> &BndVals,
211  const Array<OneD, NekDouble> &TotField,
212  int BndID)
213  {
214  GetBCValues(BndVals, TotField, BndID);
215  }
216 
220  Array<OneD, NekDouble> &outarray,
221  int BndID)
222  {
223  NormVectorIProductWRTBase(V1,V2,outarray,BndID);
224  }
225 
226  /// Set up all DG member variables and maps
228 
229  /// @todo Fix in another way considering all the planes
231  {
232  return m_trace;
233  }
234 
235  /// @todo Fix in another way considering all the planes
237  {
238  return m_planes[0]->GetTraceMap();
239  }
240 
243  {
244  return GetBndCondExpansions();
245  }
246 
247  virtual const
250  {
251  return GetBndConditions();
252  }
253 
254  /// @todo Fix Robin BCs for homogeneous case
255  virtual std::map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo()
256  {
257  return std::map<int, RobinBCInfoSharedPtr>();
258  }
259 
260  virtual void v_ExtractTracePhys(
261  const Array<OneD, const NekDouble> &inarray,
262  Array<OneD, NekDouble> &outarray);
263 
264  virtual void v_ExtractTracePhys(
265  Array<OneD, NekDouble> &outarray);
266 
267  virtual void v_GetBoundaryNormals(int i,
268  Array<OneD, Array<OneD, NekDouble> > &normals);
269 
270  private:
271  // virtual functions
272  virtual void v_HelmSolve(
273  const Array<OneD, const NekDouble> &inarray,
274  Array<OneD, NekDouble> &outarray,
275  const FlagList &flags,
276  const StdRegions::ConstFactorMap &factors,
277  const StdRegions::VarCoeffMap &varcoeff,
278  const Array<OneD, const NekDouble> &dirForcing,
279  const bool PhysSpaceForcing);
280 
281  virtual void v_EvaluateBoundaryConditions(
282  const NekDouble time = 0.0,
283  const std::string varName = "",
286 
287  virtual boost::shared_ptr<ExpList> &v_UpdateBndCondExpansion(int i);
288 
291 
293  {
294  return m_traceBndMap;
295  }
296  };
297 
298  typedef boost::shared_ptr<DisContField3DHomogeneous1D>
300 
303  {
304  return m_bndCondExpansions;
305  }
306 
309  {
310  return m_bndConditions;
311  }
312 
315  {
316  return m_bndCondExpansions[i];
317  }
318 
321  {
322  return m_bndConditions;
323  }
324  } //end of namespace
325 } //end of namespace
326 
327 #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...