Nektar++
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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Field definition in three-dimensions for a discontinuous
32 // LDG-H expansion with a homogeneous direction in 1D
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_LIBS_MULTIREGIONS_DISCONTFIELD3DHOMO1D_H
37 #define NEKTAR_LIBS_MULTIREGIONS_DISCONTFIELD3DHOMO1D_H
38 
40 #include <MultiRegions/ExpList.h>
46 
47 namespace Nektar
48 {
49 namespace MultiRegions
50 {
52 {
53 public:
55 
58  const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom,
59  const bool useFFT, const bool dealiasing);
60 
63  const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom,
64  const bool useFFT, const bool dealiasing,
66  const std::string &variable,
67  const Collections::ImplementationType ImpType =
69 
70  /// Copy constructor.
73  const bool DeclarePlanesSetCoeffPhys = true);
74 
75  /// Destructor.
77 
79  const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom,
80  SpatialDomains::BoundaryConditions &bcs, const std::string variable);
81 
82  /// Storage space for the boundary to element and boundary to trace
83  /// map. This member variable is really allocated just in case
84  /// a boundary expansion recasting is required at the solver level.
85  /// Otherwise is the 2 vectors are not filled up.
86  /// If is needed all the funcitons whihc require to use this map
87  /// do not have to recalculate it anymore.
90 
91 protected:
92  /**
93  * \brief An object which contains the discretised
94  * boundary conditions.
95  *
96  * It is an array of size equal to the number of boundary
97  * regions and consists of entries of the type
98  * MultiRegions#ExpList1D. Every entry corresponds to the
99  * one-dimensional spectral/hp expansion on a single
100  * boundary region. The values of the boundary conditions
101  * are stored as the coefficients of the one-dimensional
102  * expansion.
103  */
104 
106 
108 
110 
112 
113  /**
114  * \brief An array which contains the information about
115  * the boundary condition on the different boundary
116  * regions.
117  */
119 
120  /// Set up all DG member variables and maps
122 
124  const Array<OneD, const NekDouble> &inarray,
125  Array<OneD, NekDouble> &outarray,
126  const StdRegions::ConstFactorMap &factors,
127  const StdRegions::VarCoeffMap &varcoeff,
128  const MultiRegions::VarFactorsMap &varfactors,
129  const Array<OneD, const NekDouble> &dirForcing,
130  const bool PhysSpaceForcing) override;
131 
132  /// @todo Fix in another way considering all the planes
133  virtual ExpListSharedPtr &v_GetTrace() override;
134 
135  /// @todo Fix in another way considering all the planes
136  virtual AssemblyMapDGSharedPtr &v_GetTraceMap() override;
137 
138  virtual void v_ExtractTracePhys(const Array<OneD, const NekDouble> &inarray,
139  Array<OneD, NekDouble> &outarray) override;
140 
141  virtual void v_ExtractTracePhys(Array<OneD, NekDouble> &outarray) override;
142 
143  virtual const Array<OneD, const int> &v_GetTraceBndMap() override;
144 
145  virtual void v_GetBndElmtExpansion(
146  int i, std::shared_ptr<ExpList> &result,
147  const bool DeclareCoeffPhysArrays) override;
148 
149  virtual void v_GetBoundaryToElmtMap(Array<OneD, int> &ElmtID,
150  Array<OneD, int> &EdgeID) override;
151 
152  virtual void v_GetBCValues(Array<OneD, NekDouble> &BndVals,
153  const Array<OneD, NekDouble> &TotField,
154  int BndID) override;
155 
158  Array<OneD, NekDouble> &outarray,
159  int BndID) override;
160 
161  virtual void v_GetBoundaryNormals(
162  int i, Array<OneD, Array<OneD, NekDouble>> &normals) override;
163 
164  /// @todo Fix Robin BCs for homogeneous case
165  virtual std::map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo() override;
166 
167  /**
168  * \brief This function evaluates the boundary conditions
169  * at a certain time-level.
170  *
171  * Based on the boundary condition \f$g(\boldsymbol{x},t)\f$
172  * evaluated at a given time-level \a t, this function transforms
173  * the boundary conditions onto the coefficients of the
174  * (one-dimensional) boundary expansion.
175  * Depending on the type of boundary conditions, these expansion
176  * coefficients are calculated in different ways:
177  * - <b>Dirichlet boundary conditions</b><BR>
178  * In order to ensure global \f$C^0\f$ continuity of the
179  * spectral/hp approximation, the Dirichlet boundary conditions
180  * are projected onto the boundary expansion by means of a
181  * modified \f$C^0\f$ continuous Galerkin projection.
182  * This projection can be viewed as a collocation projection at the
183  * vertices, followed by an \f$L^2\f$ projection on the interior
184  * modes of the edges. The resulting coefficients
185  * \f$\boldsymbol{\hat{u}}^{\mathcal{D}}\f$ will be stored for the
186  * boundary expansion.
187  * - <b>Neumann boundary conditions</b>
188  * In the discrete Galerkin formulation of the problem to be
189  * solved, the Neumann boundary conditions appear as the set of
190  * surface integrals: \f[\boldsymbol{\hat{g}}=\int_{\Gamma}
191  * \phi^e_n(\boldsymbol{x})g(\boldsymbol{x})d(\boldsymbol{x})\quad
192  * \forall n \f]
193  * As a result, it are the coefficients \f$\boldsymbol{\hat{g}}\f$
194  * that will be stored in the boundary expansion
195  *
196  * \param time The time at which the boundary conditions should be
197  * evaluated
198  */
199  virtual void v_EvaluateBoundaryConditions(
200  const NekDouble time = 0.0, const std::string varName = "",
202  const NekDouble x3_in = NekConstants::kNekUnsetDouble) override;
203 
205  &v_GetBndCondExpansions(void) override;
206 
208  &v_GetBndConditions() override;
209 
210  virtual std::shared_ptr<ExpList> &v_UpdateBndCondExpansion(int i) override;
211 
213  &v_UpdateBndConditions() override;
214 
215  virtual void v_SetBndCondBwdWeight(const int index,
216  const NekDouble value) override;
217 };
218 typedef std::shared_ptr<DisContField3DHomogeneous1D>
220 } // namespace MultiRegions
221 } // namespace Nektar
222 #endif
#define MULTI_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:50
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID) override
virtual GlobalLinSysKey v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing) override
void SetUpDG()
Set up all DG member variables and maps.
virtual AssemblyMapDGSharedPtr & v_GetTraceMap() override
virtual void v_ExtractTracePhys(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
This method extracts the trace (edges in 2D) for each plane from the field inarray and puts the value...
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble >> &normals) override
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays) override
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i) override
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
Array< OneD, int > m_BCtoElmMap
Storage space for the boundary to element and boundary to trace map. This member variable is really a...
void SetupBoundaryConditions(const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom, SpatialDomains::BoundaryConditions &bcs, const std::string variable)
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID) override
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID) override
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) override
This function evaluates the boundary conditions at a certain time-level.
virtual const Array< OneD, const MultiRegions::ExpListSharedPtr > & v_GetBndCondExpansions(void) override
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions() override
virtual const Array< OneD, const int > & v_GetTraceBndMap() override
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo() override
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value) override
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions() override
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
Definition: AssemblyMapDG.h:47
std::shared_ptr< DisContField3DHomogeneous1D > DisContField3DHomogeneous1DSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
static const NekDouble kNekUnsetDouble
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:172
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:399
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:343
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble