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 override;
110 
111  virtual int v_GetGlobalToUniversalMap(const int i) const override;
112 
113  virtual int v_GetGlobalToUniversalMapUnique(const int i) const override;
114 
115  virtual const Array<OneD, const int> &v_GetLocalToGlobalMap() override;
116 
117  virtual const Array<OneD, const int> &v_GetGlobalToUniversalMap() override;
118 
120  override;
121 
122  virtual NekDouble v_GetLocalToGlobalSign(const int i) const override;
123 
125  Array<OneD, NekDouble> &global,
126  bool useComm = false) const override;
127 
128  virtual void v_GlobalToLocal(const Array<OneD, const NekDouble> &global,
129  Array<OneD, NekDouble> &loc) const override;
130 
131  virtual void v_GlobalToLocal(const NekVector<NekDouble> &global,
132  NekVector<NekDouble> &loc) const override;
133 
134  virtual void v_Assemble(const Array<OneD, const NekDouble> &loc,
135  Array<OneD, NekDouble> &global) const override;
136 
137  virtual void v_Assemble(const NekVector<NekDouble> &loc,
138  NekVector<NekDouble> &global) const override;
139 
140  virtual void v_UniversalAssemble(
141  Array<OneD, NekDouble> &pGlobal) const override;
142 
143  virtual void v_UniversalAssemble(
144  NekVector<NekDouble> &pGlobal) const override;
145 
146  virtual int v_GetFullSystemBandWidth() const override;
147 }; // class
148 
149 } // namespace MultiRegions
150 } // namespace Nektar
151 
152 #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 const Array< OneD, const int > & v_GetGlobalToUniversalMap() override
virtual void v_LocalToGlobal(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm=false) const override
virtual void v_GlobalToLocal(const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const override
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 const Array< OneD, const int > & v_GetLocalToGlobalMap() override
AssemblyCommDGSharedPtr GetAssemblyCommDG()
int GetNumDirichletBndPhys()
Return the number of boundary segments on which Dirichlet boundary conditions are imposed.
virtual void v_Assemble(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const override
void SetUpUniversalDGMap(const ExpList &locExp)
int m_numDirichletBndPhys
Number of physical dirichlet boundary values in trace.
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMapUnique() override
virtual void v_UniversalAssemble(Array< OneD, NekDouble > &pGlobal) const override
virtual int v_GetFullSystemBandWidth() const override
AssemblyMapDG()
Default constructor.
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:103
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:2
double NekDouble