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
46
48{
50{
51public:
53
56 const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom,
57 const bool useFFT, const bool dealiasing);
58
61 const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom,
62 const bool useFFT, const bool dealiasing,
64 const std::string &variable,
67
68 /// Copy constructor.
71 const bool DeclarePlanesSetCoeffPhys = true);
72
73 /// Destructor.
75
77 const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom,
78 SpatialDomains::BoundaryConditions &bcs, const std::string variable);
79
80 /// Storage space for the boundary to element and boundary to trace
81 /// map. This member variable is really allocated just in case
82 /// a boundary expansion recasting is required at the solver level.
83 /// Otherwise is the 2 vectors are not filled up.
84 /// If is needed all the funcitons whihc require to use this map
85 /// do not have to recalculate it anymore.
88
89protected:
90 /**
91 * \brief An object which contains the discretised
92 * boundary conditions.
93 *
94 * It is an array of size equal to the number of boundary
95 * regions and consists of entries of the type
96 * MultiRegions#ExpList1D. Every entry corresponds to the
97 * one-dimensional spectral/hp expansion on a single
98 * boundary region. The values of the boundary conditions
99 * are stored as the coefficients of the one-dimensional
100 * expansion.
101 */
102
104
106
108
110
111 /**
112 * \brief An array which contains the information about
113 * the boundary condition on the different boundary
114 * regions.
115 */
117
118 /// Set up all DG member variables and maps
120
122 Array<OneD, NekDouble> &outarray,
124 const StdRegions::VarCoeffMap &varcoeff,
125 const MultiRegions::VarFactorsMap &varfactors,
126 const Array<OneD, const NekDouble> &dirForcing,
127 const bool PhysSpaceForcing) override;
128
129 /// @todo Fix in another way considering all the planes
130 ExpListSharedPtr &v_GetTrace() override;
131
132 /// @todo Fix in another way considering all the planes
134
136 Array<OneD, NekDouble> &outarray) override;
137
138 void v_ExtractTracePhys(Array<OneD, NekDouble> &outarray) override;
139
141
142 void v_GetBndElmtExpansion(int i, std::shared_ptr<ExpList> &result,
143 const bool DeclareCoeffPhysArrays) override;
144
146 Array<OneD, int> &EdgeID) override;
147
149 const Array<OneD, NekDouble> &TotField,
150 int BndID) override;
151
154 Array<OneD, NekDouble> &outarray,
155 int BndID) override;
156
158 int i, Array<OneD, Array<OneD, NekDouble>> &normals) override;
159
160 /// @todo Fix Robin BCs for homogeneous case
161 std::map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo() override;
162
163 /**
164 * \brief This function evaluates the boundary conditions
165 * at a certain time-level.
166 *
167 * Based on the boundary condition \f$g(\boldsymbol{x},t)\f$
168 * evaluated at a given time-level \a t, this function transforms
169 * the boundary conditions onto the coefficients of the
170 * (one-dimensional) boundary expansion.
171 * Depending on the type of boundary conditions, these expansion
172 * coefficients are calculated in different ways:
173 * - <b>Dirichlet boundary conditions</b><BR>
174 * In order to ensure global \f$C^0\f$ continuity of the
175 * spectral/hp approximation, the Dirichlet boundary conditions
176 * are projected onto the boundary expansion by means of a
177 * modified \f$C^0\f$ continuous Galerkin projection.
178 * This projection can be viewed as a collocation projection at the
179 * vertices, followed by an \f$L^2\f$ projection on the interior
180 * modes of the edges. The resulting coefficients
181 * \f$\boldsymbol{\hat{u}}^{\mathcal{D}}\f$ will be stored for the
182 * boundary expansion.
183 * - <b>Neumann boundary conditions</b>
184 * In the discrete Galerkin formulation of the problem to be
185 * solved, the Neumann boundary conditions appear as the set of
186 * surface integrals: \f[\boldsymbol{\hat{g}}=\int_{\Gamma}
187 * \phi^e_n(\boldsymbol{x})g(\boldsymbol{x})d(\boldsymbol{x})\quad
188 * \forall n \f]
189 * As a result, it are the coefficients \f$\boldsymbol{\hat{g}}\f$
190 * that will be stored in the boundary expansion
191 *
192 * \param time The time at which the boundary conditions should be
193 * evaluated
194 */
196 const NekDouble time = 0.0, const std::string varName = "",
198 const NekDouble x3_in = NekConstants::kNekUnsetDouble) override;
199
201 &v_GetBndCondExpansions(void) override;
202
204 &v_GetBndConditions() override;
205
206 std::shared_ptr<ExpList> &v_UpdateBndCondExpansion(int i) override;
207
209 override;
210
211 void v_SetBndCondBwdWeight(const int index, const NekDouble value) override;
212};
213typedef std::shared_ptr<DisContField3DHomogeneous1D>
215} // namespace Nektar::MultiRegions
216#endif
#define MULTI_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID) override
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.
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...
void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays) override
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)
void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID) override
void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID) override
void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals) override
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.
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...
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions() override
const Array< OneD, const int > & v_GetTraceBndMap() override
std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo() override
void v_SetBndCondBwdWeight(const int index, const NekDouble value) override
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:46
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:174
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:402
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:346
StdRegions::ConstFactorMap factors
double NekDouble