Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 // 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: Local to Global DG mapping routines, header file
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef MULTIREGIONS_ASSEMBLY_MAP_DG_H
37 #define MULTIREGIONS_ASSEMBLY_MAP_DG_H
38 
41 #include <MultiRegions/ExpList2D.h>
42 #include <MultiRegions/ExpList1D.h>
43 #include <MultiRegions/ExpList0D.h>
44 
45 namespace Nektar
46 {
47  namespace MultiRegions
48  {
50  typedef boost::shared_ptr<AssemblyMapDG> AssemblyMapDGSharedPtr;
51 
52  ///
53  class AssemblyMapDG: public AssemblyMap
54  {
55  public:
56  /// Default constructor.
58 
59  /// Constructor for trace map for one-dimensional expansion.
63  const ExpList0DSharedPtr &trace,
64  const ExpList &locExp,
65  const Array<OneD, const MultiRegions::ExpListSharedPtr>
66  &bndConstraint,
67  const Array<OneD, const SpatialDomains::BoundaryConditionShPtr>
68  &bndCond,
69  const PeriodicMap &periodicVerts,
70  const std::string variable = "DefaultVar");
71 
72  /// Constructor for trace map for two-dimensional expansion.
76  const ExpList1DSharedPtr &trace,
77  const ExpList &locExp,
78  const Array<OneD, MultiRegions::ExpListSharedPtr>
79  &bndContraint,
80  const Array<OneD, SpatialDomains::BoundaryConditionShPtr>
81  &bndCond,
82  const PeriodicMap &periodicEdges,
83  const std::string variable = "DefaultVar");
84 
85  /// Constructor for trace map for three-dimensional expansion.
89  const ExpList2DSharedPtr &trace,
90  const ExpList &locExp,
91  const Array<OneD, MultiRegions::ExpListSharedPtr>
92  &bndConstraint,
93  const Array<OneD, SpatialDomains::BoundaryConditionShPtr>
94  &bndCond,
95  const PeriodicMap &periodicFaces,
96  const std::string variable = "DefaultVar");
97 
98  /// Destructor.
100 
101  /// Return the number of boundary segments on which Dirichlet
102  /// boundary conditions are imposed.
104 
105  MULTI_REGIONS_EXPORT Array<OneD, StdRegions::StdExpansionSharedPtr>
106  &GetElmtToTrace(const int i);
107 
109  Array<OneD,Array<OneD,StdRegions::StdExpansionSharedPtr> >
110  &GetElmtToTrace();
111 
113 
115 
117  Array<OneD, NekDouble> &pGlobal) const;
118 
119  protected:
121 
122  /// Number of physical dirichlet boundary values in trace
124 
125  /// list of edge expansions for a given element
126  Array<OneD, Array<OneD, StdRegions::StdExpansionSharedPtr> > m_elmtToTrace;
127  /// Integer map of process trace space quadrature points to
128  /// universal space.
129  Array<OneD,int> m_traceToUniversalMap;
130  /// Integer map of unique process trace space quadrature points to
131  /// universal space (signed).
133 
134  void SetUpUniversalDGMap(const ExpList &locExp);
135 
137  const ExpList &locExp,
138  const ExpListSharedPtr trace,
139  const PeriodicMap &perMap = NullPeriodicMap);
140 
141  virtual int v_GetLocalToGlobalMap(const int i) const;
142 
143  virtual int v_GetGlobalToUniversalMap(const int i) const;
144 
145  virtual int v_GetGlobalToUniversalMapUnique(const int i) const;
146 
147  virtual const Array<OneD,const int>& v_GetLocalToGlobalMap();
148 
149  virtual const Array<OneD, const int>& v_GetGlobalToUniversalMap();
150 
151  virtual const Array<OneD, const int>& v_GetGlobalToUniversalMapUnique();
152 
153  virtual NekDouble v_GetLocalToGlobalSign(const int i) const;
154 
155  virtual void v_LocalToGlobal(
156  const Array<OneD, const NekDouble>& loc,
157  Array<OneD, NekDouble>& global) const;
158 
159  virtual void v_LocalToGlobal(
160  const NekVector<NekDouble>& loc,
161  NekVector< NekDouble>& global) const;
162 
163  virtual void v_GlobalToLocal(
164  const Array<OneD, const NekDouble>& global,
165  Array<OneD, NekDouble>& loc) const;
166 
167  virtual void v_GlobalToLocal(
168  const NekVector<NekDouble>& global,
169  NekVector< NekDouble>& loc) const;
170 
171  virtual void v_Assemble(
172  const Array<OneD, const NekDouble> &loc,
173  Array<OneD, NekDouble> &global) const;
174 
175  virtual void v_Assemble(
176  const NekVector<NekDouble>& loc,
177  NekVector< NekDouble>& global) const;
178 
179  virtual void v_UniversalAssemble(
180  Array<OneD, NekDouble>& pGlobal) const;
181 
182  virtual void v_UniversalAssemble(
183  NekVector< NekDouble>& pGlobal) const;
184 
185  virtual int v_GetFullSystemBandWidth() const;
186 
187  void RealignTraceElement(
188  Array<OneD, int> &toAlign,
190  int nquad1,
191  int nquad2 = 0);
192  }; // class
193 
194 
195  } // end of namespace
196 } // end of namespace
197 
198 #endif //MULTIREGIONS_ASSEMBLY_MAP_DG_H