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/ExpList2D.h>
41 #include <MultiRegions/ExpList1D.h>
42 #include <MultiRegions/ExpList0D.h>
43 
44 namespace Nektar
45 {
46  namespace MultiRegions
47  {
49  typedef std::shared_ptr<AssemblyMapDG> AssemblyMapDGSharedPtr;
50 
51  ///
52  class AssemblyMapDG: public AssemblyMap
53  {
54  public:
55  /// Default constructor.
57 
58  /// Constructor for trace map for one-dimensional expansion.
62  const ExpListSharedPtr &trace,
63  const ExpList &locExp,
65  &bndConstraint,
67  &bndCond,
68  const PeriodicMap &periodicTrace,
69  const std::string variable = "DefaultVar");
70 
71  /// Destructor.
73 
74  /// Return the number of boundary segments on which Dirichlet
75  /// boundary conditions are imposed.
77 
79  &GetElmtToTrace(const int i);
80 
83  &GetElmtToTrace();
84 
86 
88 
90  Array<OneD, NekDouble> &pGlobal) const;
91 
92  protected:
94 
95  /// Number of physical dirichlet boundary values in trace
97 
98  /// list of edge expansions for a given element
100  /// Integer map of process trace space quadrature points to
101  /// universal space.
103  /// Integer map of unique process trace space quadrature points to
104  /// universal space (signed).
106 
107  void SetUpUniversalDGMap(const ExpList &locExp);
108 
110  const ExpList &locExp,
111  const ExpListSharedPtr trace,
112  const PeriodicMap &perMap = NullPeriodicMap);
113 
114  virtual int v_GetLocalToGlobalMap(const int i) const;
115 
116  virtual int v_GetGlobalToUniversalMap(const int i) const;
117 
118  virtual int v_GetGlobalToUniversalMapUnique(const int i) const;
119 
121 
123 
125 
126  virtual NekDouble v_GetLocalToGlobalSign(const int i) const;
127 
128  virtual void v_LocalToGlobal(
130  Array<OneD, NekDouble>& global,
131  bool useComm) const;
132 
133  virtual void v_LocalToGlobal(
134  const NekVector<NekDouble>& loc,
135  NekVector< NekDouble>& global,
136  bool useComm) const;
137 
138  virtual void v_GlobalToLocal(
139  const Array<OneD, const NekDouble>& global,
140  Array<OneD, NekDouble>& loc) const;
141 
142  virtual void v_GlobalToLocal(
143  const NekVector<NekDouble>& global,
144  NekVector< NekDouble>& loc) const;
145 
146  virtual void v_Assemble(
148  Array<OneD, NekDouble> &global) const;
149 
150  virtual void v_Assemble(
151  const NekVector<NekDouble>& loc,
152  NekVector< NekDouble>& global) const;
153 
154  virtual void v_UniversalAssemble(
155  Array<OneD, NekDouble>& pGlobal) const;
156 
157  virtual void v_UniversalAssemble(
158  NekVector< NekDouble>& pGlobal) const;
159 
160  virtual int v_GetFullSystemBandWidth() const;
161 
162  void RealignTraceElement(
163  Array<OneD, int> &toAlign,
165  int nquad1,
166  int nquad2 = 0);
167  }; // class
168 
169 
170  } // end of namespace
171 } // end of namespace
172 
173 #endif //MULTIREGIONS_ASSEMBLY_MAP_DG_H
AssemblyMapDG()
Default constructor.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
#define MULTI_REGIONS_EXPORT
Array< OneD, int > m_traceToUniversalMap
Integer map of process trace space quadrature points to universal space.
Base class for constructing local to global mapping of degrees of freedom.
Definition: AssemblyMap.h:58
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:103
Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > & GetElmtToTrace()
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMapUnique()
void SetUpUniversalTraceMap(const ExpList &locExp, const ExpListSharedPtr trace, const PeriodicMap &perMap=NullPeriodicMap)
virtual void v_Assemble(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const
virtual void v_GlobalToLocal(const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const
virtual void v_LocalToGlobal(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm) const
virtual int v_GetFullSystemBandWidth() const
static PeriodicMap NullPeriodicMap
virtual const Array< OneD, const int > & v_GetLocalToGlobalMap()
void SetUpUniversalDGMap(const ExpList &locExp)
double NekDouble
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
virtual ~AssemblyMapDG()
Destructor.
Array< OneD, int > m_traceToUniversalMapUnique
Integer map of unique process trace space quadrature points to universal space (signed).
Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > m_elmtToTrace
list of edge expansions for a given element
Definition: AssemblyMapDG.h:99
virtual const Array< OneD, NekDouble > & v_GetLocalToGlobalSign() const
void UniversalTraceAssemble(Array< OneD, NekDouble > &pGlobal) const
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMap()
std::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
Definition: AssemblyMapDG.h:48
std::shared_ptr< SessionReader > SessionReaderSharedPtr
void RealignTraceElement(Array< OneD, int > &toAlign, StdRegions::Orientation orient, int nquad1, int nquad2=0)
int GetNumDirichletBndPhys()
Return the number of boundary segments on which Dirichlet boundary conditions are imposed...
int m_numDirichletBndPhys
Number of physical dirichlet boundary values in trace.
Definition: AssemblyMapDG.h:96
virtual void v_UniversalAssemble(Array< OneD, NekDouble > &pGlobal) const