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 ExpListSharedPtr &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 &periodicTrace,
70  const std::string variable = "DefaultVar");
71 
72  /// Destructor.
74 
75  /// Return the number of boundary segments on which Dirichlet
76  /// boundary conditions are imposed.
78 
79  MULTI_REGIONS_EXPORT Array<OneD, LocalRegions::ExpansionSharedPtr>
80  &GetElmtToTrace(const int i);
81 
83  Array<OneD,Array<OneD,LocalRegions::ExpansionSharedPtr> >
84  &GetElmtToTrace();
85 
87 
89 
91  Array<OneD, NekDouble> &pGlobal) const;
92 
93  protected:
95 
96  /// Number of physical dirichlet boundary values in trace
98 
99  /// list of edge expansions for a given element
100  Array<OneD, Array<OneD, LocalRegions::ExpansionSharedPtr> > m_elmtToTrace;
101  /// Integer map of process trace space quadrature points to
102  /// universal space.
103  Array<OneD,int> m_traceToUniversalMap;
104  /// Integer map of unique process trace space quadrature points to
105  /// universal space (signed).
107 
108  void SetUpUniversalDGMap(const ExpList &locExp);
109 
111  const ExpList &locExp,
112  const ExpListSharedPtr trace,
113  const PeriodicMap &perMap = NullPeriodicMap);
114 
115  virtual int v_GetLocalToGlobalMap(const int i) const;
116 
117  virtual int v_GetGlobalToUniversalMap(const int i) const;
118 
119  virtual int v_GetGlobalToUniversalMapUnique(const int i) const;
120 
121  virtual const Array<OneD,const int>& v_GetLocalToGlobalMap();
122 
123  virtual const Array<OneD, const int>& v_GetGlobalToUniversalMap();
124 
125  virtual const Array<OneD, const int>& v_GetGlobalToUniversalMapUnique();
126 
127  virtual NekDouble v_GetLocalToGlobalSign(const int i) const;
128 
129  virtual void v_LocalToGlobal(
130  const Array<OneD, const NekDouble>& loc,
131  Array<OneD, NekDouble>& global) const;
132 
133  virtual void v_LocalToGlobal(
134  const NekVector<NekDouble>& loc,
135  NekVector< NekDouble>& global) const;
136 
137  virtual void v_GlobalToLocal(
138  const Array<OneD, const NekDouble>& global,
139  Array<OneD, NekDouble>& loc) const;
140 
141  virtual void v_GlobalToLocal(
142  const NekVector<NekDouble>& global,
143  NekVector< NekDouble>& loc) const;
144 
145  virtual void v_Assemble(
146  const Array<OneD, const NekDouble> &loc,
147  Array<OneD, NekDouble> &global) const;
148 
149  virtual void v_Assemble(
150  const NekVector<NekDouble>& loc,
151  NekVector< NekDouble>& global) const;
152 
153  virtual void v_UniversalAssemble(
154  Array<OneD, NekDouble>& pGlobal) const;
155 
156  virtual void v_UniversalAssemble(
157  NekVector< NekDouble>& pGlobal) const;
158 
159  virtual int v_GetFullSystemBandWidth() const;
160 
161  void RealignTraceElement(
162  Array<OneD, int> &toAlign,
164  int nquad1,
165  int nquad2 = 0);
166  }; // class
167 
168 
169  } // end of namespace
170 } // end of namespace
171 
172 #endif //MULTIREGIONS_ASSEMBLY_MAP_DG_H