Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DisContField3D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File DisContField3D.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
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_LIBS_MULTIREGIONS_DISCONTFIELD3D_H
38 #define NEKTAR_LIBS_MULTIREGIONS_DISCONTFIELD3D_H
39 
42 #include <MultiRegions/ExpList3D.h>
47 
48 namespace Nektar
49 {
50  namespace MultiRegions
51  {
52  class AssemblyMapDG;
53 
54 
55  class DisContField3D : public ExpList3D
56  {
57  public:
59 
63  const std::string &variable,
64  const bool SetUpJustDG = true);
65 
67  const DisContField3D &In,
69  const std::string &variable,
70  const bool SetUpJustDG = false);
71 
72  /// Constructs a global discontinuous field based on another
73  /// discontinuous field.
74  MULTI_REGIONS_EXPORT DisContField3D(const DisContField3D &In);
75 
76  /// Destructor.
78 
80  const GlobalLinSysKey &mkey);
81 
82 
84  Array<OneD, NekDouble> &outarray);
85 
87  {
88  return m_leftAdjacentFaces[cnt];
89  }
90 
93 
94  protected:
95  /**
96  * @brief An object which contains the discretised boundary
97  * conditions.
98  *
99  * It is an array of size equal to the number of boundary regions
100  * and consists of entries of the type MultiRegions#ExpList2D. Every
101  * entry corresponds to the two-dimensional spectral/hp expansion on
102  * a single boundary region. The values of the boundary conditions
103  * are stored as the coefficients of the two-dimensional expansion.
104  */
106 
107  /**
108  * @brief An array which contains the information about
109  * the boundary condition on the different boundary regions.
110  */
112 
116  /// Map of local trace (the points at the face of the
117  /// element) to the trace space discretisation
119 
120  /**
121  * @brief A set storing the global IDs of any boundary faces.
122  */
123  std::set<int> m_boundaryFaces;
124 
125  /**
126  * @brief A map which identifies pairs of periodic faces.
127  */
129 
130  /**
131  * @brief A map which identifies groups of periodic edges.
132  */
134 
135  /**
136  * @brief A map which identifies groups of periodic vertices.
137  */
139 
140  /*
141  * @brief A map identifying which faces are left- and right-adjacent
142  * for DG.
143  */
144  std::vector<bool> m_leftAdjacentFaces;
145 
146  /**
147  * @brief A vector indicating degress of freedom which need to be
148  * copied from forwards to backwards space in case of a periodic
149  * boundary condition.
150  */
151  std::vector<int> m_periodicFwdCopy;
152  std::vector<int> m_periodicBwdCopy;
153 
154  void SetUpDG(const std::string = "DefaultVar");
155  bool SameTypeOfBoundaryConditions(const DisContField3D &In);
157  const SpatialDomains::MeshGraphSharedPtr &graph3D,
159  const std::string &variable);
160  void FindPeriodicFaces(
162  const std::string &variable);
163 
164  bool IsLeftAdjacentFace(const int n, const int e);
165 
166  virtual void v_GetFwdBwdTracePhys(
168  Array<OneD,NekDouble> &Bwd);
169  virtual void v_GetFwdBwdTracePhys(
170  const Array<OneD,const NekDouble> &field,
173  virtual const std::vector<bool> &v_GetLeftAdjacentFaces(void) const;
174  virtual void v_ExtractTracePhys(
175  Array<OneD, NekDouble> &outarray);
176  virtual void v_ExtractTracePhys(
177  const Array<OneD, const NekDouble> &inarray,
178  Array<OneD, NekDouble> &outarray);
179  virtual void v_AddTraceIntegral(
181  Array<OneD, NekDouble> &outarray);
182  virtual void v_AddFwdBwdTraceIntegral(
183  const Array<OneD, const NekDouble> &Fwd,
184  const Array<OneD, const NekDouble> &Bwd,
185  Array<OneD, NekDouble> &outarray);
186  virtual void v_HelmSolve(
187  const Array<OneD, const NekDouble> &inarray,
188  Array<OneD, NekDouble> &outarray,
189  const FlagList &flags,
190  const StdRegions::ConstFactorMap &factors,
191  const StdRegions::VarCoeffMap &varcoeff,
192  const Array<OneD, const NekDouble> &dirForcing,
193  const bool PhysSpaceForcing);
194 
195  virtual void v_GeneralMatrixOp(
196  const GlobalMatrixKey &gkey,
197  const Array<OneD,const NekDouble> &inarray,
198  Array<OneD, NekDouble> &outarray,
199  CoeffState coeffstate = eLocal);
200  virtual void v_GetBoundaryToElmtMap(
201  Array<OneD, int> &ElmtID,
202  Array<OneD, int> &FaceID);
203  virtual void v_GetBndElmtExpansion(int i,
204  boost::shared_ptr<ExpList> &result,
205  const bool DeclareCoeffPhysArrays);
206  virtual void v_Reset();
207 
208  /*
209  * @brief Obtain a copy of the periodic edges and vertices for this
210  * field.
211  */
212  virtual void v_GetPeriodicEntities(
213  PeriodicMap &periodicVerts,
214  PeriodicMap &periodicEdges,
215  PeriodicMap &periodicFaces)
216  {
217  periodicVerts = m_periodicVerts;
218  periodicEdges = m_periodicEdges;
219  periodicFaces = m_periodicFaces;
220  }
221 
223  {
224  if(m_trace == NullExpListSharedPtr)
225  {
226  SetUpDG();
227  }
228 
229  return m_trace;
230  }
231 
233  {
234  return m_traceMap;
235  }
236 
239  {
240  return m_bndCondExpansions;
241  }
242 
243  virtual const
246  {
247  return m_bndConditions;
248  }
249 
252  {
253  return m_bndCondExpansions[i];
254  }
255 
258  {
259  return m_bndConditions;
260  }
261 
262  virtual void v_EvaluateBoundaryConditions(
263  const NekDouble time = 0.0,
264  const std::string varName = "",
267 
268  virtual std::map<int, RobinBCInfoSharedPtr> v_GetRobinBCInfo();
269  };
270 
271  typedef boost::shared_ptr<DisContField3D> DisContField3DSharedPtr;
272  } //end of namespace
273 } //end of namespace
274 
275 #endif // MULTIERGIONS_DISCONTFIELD3D_H
boost::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
Definition: AssemblyMapDG.h:49
virtual const Array< OneD, const MultiRegions::ExpListSharedPtr > & v_GetBndCondExpansions()
GlobalLinSysSharedPtr GetGlobalBndLinSys(const GlobalLinSysKey &mkey)
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
Local coefficients.
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1485
bool IsLeftAdjacentFace(const int n, const int e)
virtual void v_GetBndElmtExpansion(int i, boost::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
#define MULTI_REGIONS_EXPORT
std::set< int > m_boundaryFaces
A set storing the global IDs of any boundary faces.
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
PeriodicMap m_periodicFaces
A map which identifies pairs of periodic faces.
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
This method extracts the "forward" and "backward" trace data from the array field and puts the data i...
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:252
void EvaluateHDGPostProcessing(Array< OneD, NekDouble > &outarray)
Evaluate HDG post-processing to increase polynomial order of solution.
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
Add trace contributions into elemental coefficient spaces.
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)
This function evaluates the boundary conditions at a certain time-level.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
virtual MultiRegions::ExpListSharedPtr & v_UpdateBndCondExpansion(int i)
boost::shared_ptr< LocTraceToTraceMap > LocTraceToTraceMapSharedPtr
virtual AssemblyMapDGSharedPtr & v_GetTraceMap()
void FindPeriodicFaces(const SpatialDomains::BoundaryConditions &bcs, const std::string &variable)
Determine the periodic faces, edges and vertices for the given graph.
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo()
std::vector< int > m_periodicFwdCopy
A vector indicating degress of freedom which need to be copied from forwards to backwards space in ca...
DisContField3D()
Default constructor.
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:227
LocTraceToTraceMapSharedPtr m_locTraceToTraceMap
Map of local trace (the points at the face of the element) to the trace space discretisation.
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
boost::shared_ptr< GlobalLinSysMap > GlobalLinSysMapShPtr
Pointer to a GlobalLinSys/key map.
Definition: GlobalLinSys.h:59
void GenerateBoundaryConditionExpansion(const SpatialDomains::MeshGraphSharedPtr &graph3D, const SpatialDomains::BoundaryConditions &bcs, const std::string &variable)
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Calculates the result of the multiplication of a global matrix of type specified by mkey with a vecto...
double NekDouble
void SetUpDG(const std::string="DefaultVar")
Set up all DG member variables and maps.
bool SameTypeOfBoundaryConditions(const DisContField3D &In)
Defines a list of flags.
boost::shared_ptr< DisContField3D > DisContField3DSharedPtr
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
static const NekDouble kNekUnsetDouble
Describe a linear system.
Describes a matrix with ordering defined by a local to global map.
virtual ExpListSharedPtr & v_GetTrace()
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &FaceID)
Set up a list of elemeent IDs and edge IDs that link to the boundary conditions.
virtual void v_Reset()
Reset this field, so that geometry information can be updated.
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
Abstraction of a three-dimensional multi-elemental expansion which is merely a collection of local ex...
Definition: ExpList3D.h:49
boost::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
Definition: GlobalLinSys.h:52
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 SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:442
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
Add trace contributions into elemental coefficient spaces.
PeriodicMap m_periodicEdges
A map which identifies groups of periodic edges.