Nektar++
AssemblyMapDG.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File AssemblyMapDG.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: Local to Global DG mapping routines, header file
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef MULTIREGIONS_ASSEMBLY_MAP_DG_H
36 #define MULTIREGIONS_ASSEMBLY_MAP_DG_H
37 
40 #include <MultiRegions/ExpList.h>
42 
43 namespace Nektar
44 {
45  namespace MultiRegions
46  {
47  class AssemblyMapDG;
48  typedef std::shared_ptr<AssemblyMapDG> AssemblyMapDGSharedPtr;
49 
50  ///
51  class AssemblyMapDG: public AssemblyMap
52  {
53  public:
54  /// Default constructor.
56 
57  /// Constructor for trace map for one-dimensional expansion.
61  const ExpListSharedPtr &trace,
62  const ExpList &locExp,
64  &bndConstraint,
66  &bndCond,
67  const PeriodicMap &periodicTrace,
68  const std::string variable = "DefaultVar");
69 
70  /// Destructor.
72 
73  /// Return the number of boundary segments on which Dirichlet
74  /// boundary conditions are imposed.
76 
78  &GetElmtToTrace(const int i);
79 
82  &GetElmtToTrace();
83 
84  /**
85  * Changes toAlign quadrature point order, where the realignment is
86  * given by orient, which defines the mapping needed to go between
87  * the original ordering and the new desired ordering.
88  *
89  * @param[in,out] toAlign Data to reorder
90  * @param[in] orient The transformation to perform
91  * @param[in] nquad1 Quadrature points in direction 1
92  * @param[in] nquad2 Quadrature points in direction 2
93  */
95  Array<OneD, int> &toAlign,
97  int nquad1,
98  int nquad2 = 0);
99 
101 
102  protected:
103  /// Number of physical dirichlet boundary values in trace
105 
107 
108  /// list of edge expansions for a given element
110 
111  void SetUpUniversalDGMap(const ExpList &locExp);
112 
113  virtual int v_GetLocalToGlobalMap(const int i) const;
114 
115  virtual int v_GetGlobalToUniversalMap(const int i) const;
116 
117  virtual int v_GetGlobalToUniversalMapUnique(const int i) const;
118 
120 
122 
124 
125  virtual NekDouble v_GetLocalToGlobalSign(const int i) const;
126 
127  virtual void v_LocalToGlobal(
129  Array<OneD, NekDouble>& global,
130  bool useComm = false) const;
131 
132  virtual void v_GlobalToLocal(
133  const Array<OneD, const NekDouble>& global,
134  Array<OneD, NekDouble>& loc) const;
135 
136  virtual void v_GlobalToLocal(
137  const NekVector<NekDouble>& global,
138  NekVector< NekDouble>& loc) const;
139 
140  virtual void v_Assemble(
142  Array<OneD, NekDouble> &global) const;
143 
144  virtual void v_Assemble(
145  const NekVector<NekDouble>& loc,
146  NekVector< NekDouble>& global) const;
147 
148  virtual void v_UniversalAssemble(
149  Array<OneD, NekDouble>& pGlobal) const;
150 
151  virtual void v_UniversalAssemble(
152  NekVector< NekDouble>& pGlobal) const;
153 
154  virtual int v_GetFullSystemBandWidth() const;
155  }; // class
156 
157 
158  } // end of namespace
159 } // end of namespace
160 
161 #endif //MULTIREGIONS_ASSEMBLY_MAP_DG_H
#define MULTI_REGIONS_EXPORT
Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > m_elmtToTrace
list of edge expansions for a given element
virtual void v_GlobalToLocal(const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMapUnique()
static void RealignTraceElement(Array< OneD, int > &toAlign, StdRegions::Orientation orient, int nquad1, int nquad2=0)
AssemblyCommDGSharedPtr m_assemblyComm
Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > & GetElmtToTrace()
virtual int v_GetFullSystemBandWidth() const
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMap()
AssemblyCommDGSharedPtr GetAssemblyCommDG()
int GetNumDirichletBndPhys()
Return the number of boundary segments on which Dirichlet boundary conditions are imposed.
virtual void v_LocalToGlobal(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm=false) const
virtual void v_Assemble(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const
void SetUpUniversalDGMap(const ExpList &locExp)
int m_numDirichletBndPhys
Number of physical dirichlet boundary values in trace.
virtual void v_UniversalAssemble(Array< OneD, NekDouble > &pGlobal) const
AssemblyMapDG()
Default constructor.
virtual const Array< OneD, const int > & v_GetLocalToGlobalMap()
Base class for constructing local to global mapping of degrees of freedom.
Definition: AssemblyMap.h:59
virtual const Array< OneD, NekDouble > & v_GetLocalToGlobalSign() const
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:107
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
Definition: AssemblyMapDG.h:47
std::shared_ptr< AssemblyCommDG > AssemblyCommDGSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble