Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Geometry.cpp
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: Geometry.cpp
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: This file contains the base class implementation for the
33 // Geometry class.
34 //
35 //
36 ////////////////////////////////////////////////////////////////////////////////
38 
39 namespace Nektar
40 {
41  namespace SpatialDomains
42  {
43 
44  // static class property
46 
48  m_coordim(0),
49  m_geomFactorsState(eNotFilled),
50  m_state(eNotFilled),
51  m_shapeType(LibUtilities::eNoShapeType),
52  m_globalID(-1)
53  {
54  }
55 
56  Geometry::Geometry(const int coordim):
57  m_coordim(coordim),
58  m_geomFactorsState(eNotFilled),
59  m_state(eNotFilled),
60  m_shapeType(LibUtilities::eNoShapeType),
61  m_globalID(-1)
62  {
63  }
64 
66  {
67  }
68 
70  GeomFactorsSharedPtr geomFactor)
71  {
72  GeomFactorsSharedPtr returnval = geomFactor;
73 
74 /// \todo should this '#if 0' statement be removed?
75 #if 0
76  bool found = false;
77  if (geomFactor->GetGtype() == eRegular)
78  {
80  iter != m_regGeomFactorsManager.end();
81  ++iter)
82  {
83  if (**iter == *geomFactor)
84  {
85  returnval = *iter;
86  found = true;
87  break;
88  }
89  }
90 
91  if (!found)
92  {
93  m_regGeomFactorsManager.push_back(geomFactor);
94  returnval = geomFactor;
95  }
96  }
97 #endif
98  return returnval;
99  }
100 
101  bool SortByGlobalId(const boost::shared_ptr<Geometry>& lhs,
102  const boost::shared_ptr<Geometry>& rhs)
103  {
104  return lhs->GetGlobalID() < rhs->GetGlobalID();
105  }
106 
107  bool GlobalIdEquality(const boost::shared_ptr<Geometry>& lhs,
108  const boost::shared_ptr<Geometry>& rhs)
109  {
110  return lhs->GetGlobalID() == rhs->GetGlobalID();
111  }
112 
113  void Geometry::v_AddElmtConnected(int gvo_id, int locid)
114  {
116  "This function is only valid for shape type geometries");
117  }
118 
120  {
122  "This function is only valid for shape type geometries");
123  return 0;
124  }
125 
126  bool Geometry::v_IsElmtConnected(int gvo_id, int locid) const
127  {
129  "This function is only valid for shape type geometries");
130  return false;
131  }
132 
133  int Geometry::v_GetVid(int i) const
134  {
136  "This function is only valid for shape type geometries");
137  return 0;
138  }
139 
140  int Geometry::v_GetEid(int i) const
141  {
143  "This function is only valid for shape type geometries");
144  return 0;
145  }
146 
147  int Geometry::v_GetFid(int i) const
148  {
150  "This function is only valid for expansion type geometries");
151  return 0;
152  }
153 
155  {
157  "This function is only valid for shape type geometries");
158  return 0;
159  }
160 
162  {
164  "This function is not valid for this geometry.");
165  return StdRegions::eForwards;
166  }
167 
169  {
171  "This function is not valid for this geometry.");
172  return StdRegions::eFwd;
173  }
174 
176  {
178  "This function is only valid for shape type geometries");
179  return 0;
180  }
181 
183  {
185  "This function is only valid for shape type geometries");
186  return 0;
187  }
188 
190  {
192  "This function is only valid for shape type geometries");
193  return 0;
194  }
195 
197  {
198  return m_xmap;
199  }
200 
202  const Array<OneD, const NekDouble>& gloCoord,
203  NekDouble tol)
204  {
206  "This function has not been defined for this geometry");
207  return false;
208  }
209 
211  const Array<OneD, const NekDouble>& gloCoord,
212  Array<OneD, NekDouble>& locCoord,
213  NekDouble tol)
214  {
216  "This function has not been defined for this geometry");
217  return false;
218  }
219 
221  const Array<OneD, const NekDouble>& gloCoord,
222  Array<OneD, NekDouble>& locCoord,
223  NekDouble tol,
224  NekDouble &resid)
225  {
227  "This function has not been defined for this geometry");
228  return false;
229  }
230 
231  int Geometry::v_GetVertexEdgeMap(const int i, const int j) const
232  {
234  "This function has not been defined for this geometry");
235  return 0;
236  }
237 
238  int Geometry::v_GetVertexFaceMap(const int i, const int j) const
239  {
241  "This function has not been defined for this geometry");
242  return 0;
243  }
244 
245  int Geometry::v_GetEdgeFaceMap(const int i, const int j) const
246  {
248  "This function has not been defined for this geometry");
249  return 0;
250  }
251 
253  const int i,
254  const Array<OneD,const NekDouble>& Lcoord)
255  {
257  "This function is only valid for expansion type geometries");
258  return 0.0;
259  }
260 
262  const Array<OneD,const NekDouble> &coords,
263  Array<OneD,NekDouble> &Lcoords)
264  {
266  "This function is only valid for expansion type geometries");
267  return 0.0;
268  }
269 
271  {
273  "This function is only valid for expansion type geometries");
274  }
275 
277  {
279  "This function is only valid for expansion type geometries");
280  }
281 
283  {
285  "This function is only valid for shape type geometries");
287  return returnval;
288  }
289 
291  {
292  return m_coordim;
293  }
294 
295  }; //end of namespace
296 }; //end of namespace
297