Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AssemblyMapCG.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File AssemblyMapCG.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: C0-continuous Local to Global mapping routines, base class
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef MULTIREGIONS_ASSEMBLYMAPCG_H
37 #define MULTIREGIONS_ASSEMBLYMAPCG_H
38 
39 #include <boost/tuple/tuple.hpp>
40 
43 
44 namespace Nektar
45 {
46  namespace MultiRegions
47  {
48  static map<int,int> NullIntIntMap;
49  const static vector<map<int,int> > NullVecIntIntMap;
50 
51  class ExpList;
53  typedef boost::shared_ptr<AssemblyMapCG> AssemblyMapCGSharedPtr;
54 
55  typedef boost::tuple<int, int, NekDouble> ExtraDirDof;
56 
58  StdRegions::Orientation faceOrient1,
59  StdRegions::Orientation faceOrient2);
60 
61 
62  /// Constructs mappings for the C0 scalar continuous Galerkin formulation.
63  class AssemblyMapCG: public AssemblyMap
64  {
65  public:
66  /// Default constructor.
69  const std::string variable = "DefaultVar");
70 
71  /// General constructor for expansions of all dimensions without
72  /// boundary conditions.
75  const int numLocalCoeffs,
76  const ExpList &locExp);
77 
78  /// Destructor.
80 
81  MULTI_REGIONS_EXPORT map<int, vector<ExtraDirDof> >
83  {
84  return m_extraDirDofs;
85  }
86 
87  protected:
88  /// Integer map of local coeffs to global space
89  Array<OneD,int> m_localToGlobalMap;
90  /// Integer sign of local coeffs to global space
91  Array<OneD,NekDouble> m_localToGlobalSign;
92  /// Bandwith of the full matrix system (no static condensation).
94  /// Integer map of process coeffs to universal space
95  Array<OneD,int> m_globalToUniversalMap;
96  /// Integer map of unique process coeffs to universal space (signed)
98  /// Number of non Dirichlet vertex modes
100  /// Number of non Dirichlet edge modes
102  /// Number of non Dirichlet face modes
104  /// Number of Dirichlet edges
106  /// Number of Dirichlet faces
108  /// Number of Dirichlet edges
110  /// Number of Dirichlet faces
112  /// Extra dirichlet edges in parallel
113  Array<OneD, int> m_extraDirEdges;
114 
115  /// Maximum static condensation level.
117  /// Map indicating degrees of freedom which are Dirichlet but whose
118  /// value is stored on another processor.
119  map<int, vector<ExtraDirDof> > m_extraDirDofs;
120 
122  const ExpList &locExp,
123  const PeriodicMap &perVerts = NullPeriodicMap,
124  const PeriodicMap &perEdges = NullPeriodicMap,
125  const PeriodicMap &perFaces = NullPeriodicMap);
126 
127  /// Calculate the bandwith of the full matrix system.
129 
130  MULTI_REGIONS_EXPORT virtual int v_GetLocalToGlobalMap(const int i) const;
131 
132  MULTI_REGIONS_EXPORT virtual int v_GetGlobalToUniversalMap(const int i) const;
133 
134  MULTI_REGIONS_EXPORT virtual int v_GetGlobalToUniversalMapUnique(const int i) const;
135 
136  MULTI_REGIONS_EXPORT virtual const Array<OneD,const int>& v_GetLocalToGlobalMap();
137 
138  MULTI_REGIONS_EXPORT virtual const Array<OneD, const int>& v_GetGlobalToUniversalMap();
139 
140  MULTI_REGIONS_EXPORT virtual const Array<OneD, const int>& v_GetGlobalToUniversalMapUnique();
141 
142  MULTI_REGIONS_EXPORT virtual NekDouble v_GetLocalToGlobalSign(const int i) const;
143 
144  MULTI_REGIONS_EXPORT virtual const Array<OneD, NekDouble>& v_GetLocalToGlobalSign() const;
145 
147  const Array<OneD, const NekDouble>& loc,
148  Array<OneD, NekDouble>& global) const;
149 
151  const NekVector<NekDouble>& loc,
152  NekVector< NekDouble>& global) const;
153 
155  const Array<OneD, const NekDouble>& global,
156  Array<OneD, NekDouble>& loc) const;
157 
159  const NekVector<NekDouble>& global,
160  NekVector< NekDouble>& loc) const;
161 
162  MULTI_REGIONS_EXPORT virtual void v_Assemble(
163  const Array<OneD, const NekDouble> &loc,
164  Array<OneD, NekDouble> &global) const;
165 
166  MULTI_REGIONS_EXPORT virtual void v_Assemble(
167  const NekVector<NekDouble>& loc,
168  NekVector< NekDouble>& global) const;
169 
171  Array<OneD, NekDouble>& pGlobal) const;
172 
174  NekVector< NekDouble>& pGlobal) const;
175 
177  Array<OneD, NekDouble>& pGlobal,
178  int offset) const;
179 
181 
183 
184  MULTI_REGIONS_EXPORT virtual int v_GetNumNonDirEdgeModes() const;
185 
186  MULTI_REGIONS_EXPORT virtual int v_GetNumNonDirFaceModes() const;
187 
188  MULTI_REGIONS_EXPORT virtual int v_GetNumDirEdges() const;
189 
190  MULTI_REGIONS_EXPORT virtual int v_GetNumDirFaces() const;
191 
192  MULTI_REGIONS_EXPORT virtual int v_GetNumNonDirEdges() const;
193 
194  MULTI_REGIONS_EXPORT virtual int v_GetNumNonDirFaces() const;
195 
196  MULTI_REGIONS_EXPORT virtual const Array<OneD, const int>& v_GetExtraDirEdges();
197 
199  const ExpList &locexp, GlobalSysSolnType solnType);
200  };
201 
202 
203  } // end of namespace
204 } // end of namespace
205 
206 #endif //MULTIREGIONS_ASSEMBLYMAPCG_H
207