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, const ExpList &locExp,
64  &bndCond,
65  const PeriodicMap &periodicTrace,
66  const std::string variable = "DefaultVar");
67 
68  /// Destructor.
70 
71  /// Return the number of boundary segments on which Dirichlet
72  /// boundary conditions are imposed.
74 
76  &GetElmtToTrace(const int i);
77 
80  &GetElmtToTrace();
81 
82  /**
83  * Changes toAlign quadrature point order, where the realignment is
84  * given by orient, which defines the mapping needed to go between
85  * the original ordering and the new desired ordering.
86  *
87  * @param[in,out] toAlign Data to reorder
88  * @param[in] orient The transformation to perform
89  * @param[in] nquad1 Quadrature points in direction 1
90  * @param[in] nquad2 Quadrature points in direction 2
91  */
93  Array<OneD, int> &toAlign, StdRegions::Orientation orient, int nquad1,
94  int nquad2 = 0);
95 
97 
98 protected:
99  /// Number of physical dirichlet boundary values in trace
101 
103 
104  /// list of edge expansions for a given element
106 
107  void SetUpUniversalDGMap(const ExpList &locExp);
108 
109  virtual int v_GetLocalToGlobalMap(const int i) const;
110 
111  virtual int v_GetGlobalToUniversalMap(const int i) const;
112 
113  virtual int v_GetGlobalToUniversalMapUnique(const int i) const;
114 
116 
118 
120 
121  virtual NekDouble v_GetLocalToGlobalSign(const int i) const;
122 
124  Array<OneD, NekDouble> &global,
125  bool useComm = false) const;
126 
127  virtual void v_GlobalToLocal(const Array<OneD, const NekDouble> &global,
128  Array<OneD, NekDouble> &loc) const;
129 
130  virtual void v_GlobalToLocal(const NekVector<NekDouble> &global,
131  NekVector<NekDouble> &loc) const;
132 
133  virtual void v_Assemble(const Array<OneD, const NekDouble> &loc,
134  Array<OneD, NekDouble> &global) const;
135 
136  virtual void v_Assemble(const NekVector<NekDouble> &loc,
137  NekVector<NekDouble> &global) const;
138 
139  virtual void v_UniversalAssemble(Array<OneD, NekDouble> &pGlobal) const;
140 
141  virtual void v_UniversalAssemble(NekVector<NekDouble> &pGlobal) const;
142 
143  virtual int v_GetFullSystemBandWidth() const;
144 }; // class
145 
146 } // namespace MultiRegions
147 } // namespace Nektar
148 
149 #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:58
virtual const Array< OneD, NekDouble > & v_GetLocalToGlobalSign() const
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:101
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:172
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble