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 not valid for this geometry.");
179  return StdRegions::eFwd;
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  {
199  "This function is only valid for shape type geometries");
200  return 0;
201  }
202 
204  {
205  return m_xmap;
206  }
207 
209  const Array<OneD, const NekDouble>& gloCoord,
210  NekDouble tol)
211  {
213  "This function has not been defined for this geometry");
214  return false;
215  }
216 
218  const Array<OneD, const NekDouble>& gloCoord,
219  Array<OneD, NekDouble>& locCoord,
220  NekDouble tol)
221  {
223  "This function has not been defined for this geometry");
224  return false;
225  }
226 
228  const Array<OneD, const NekDouble>& gloCoord,
229  Array<OneD, NekDouble>& locCoord,
230  NekDouble tol,
231  NekDouble &resid)
232  {
234  "This function has not been defined for this geometry");
235  return false;
236  }
237 
238  int Geometry::v_GetVertexEdgeMap(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_GetVertexFaceMap(const int i, const int j) const
246  {
248  "This function has not been defined for this geometry");
249  return 0;
250  }
251 
252  int Geometry::v_GetEdgeFaceMap(const int i, const int j) const
253  {
255  "This function has not been defined for this geometry");
256  return 0;
257  }
258 
260  const int i,
261  const Array<OneD,const NekDouble>& Lcoord)
262  {
264  "This function is only valid for expansion type geometries");
265  return 0.0;
266  }
267 
269  const Array<OneD,const NekDouble> &coords,
270  Array<OneD,NekDouble> &Lcoords)
271  {
273  "This function is only valid for expansion type geometries");
274  return 0.0;
275  }
276 
278  {
280  "This function is only valid for expansion type geometries");
281  }
282 
284  {
286  "This function is only valid for expansion type geometries");
287  }
288 
290  {
292  "This function is only valid for shape type geometries");
294  return returnval;
295  }
296 
298  {
299  return m_coordim;
300  }
301 
302  }; //end of namespace
303 }; //end of namespace
304