Nektar++
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nektar::SpatialDomains::Geometry3D Class Referenceabstract

3D geometry information More...

#include <Geometry3D.h>

Inheritance diagram for Nektar::SpatialDomains::Geometry3D:
Inheritance graph
[legend]
Collaboration diagram for Nektar::SpatialDomains::Geometry3D:
Collaboration graph
[legend]

Public Member Functions

 Geometry3D ()
 
 Geometry3D (const int coordim)
 
virtual ~Geometry3D ()
 
int GetEid (int i) const
 Return the ID of edge i in this element. More...
 
const Geometry1DSharedPtr GetEdge (int i) const
 
Geometry2DSharedPtr GetFace (int i)
 Return face i in this element. More...
 
int GetDir (const int faceidx, const int facedir) const
 Returns the element coordinate direction corresponding to a given face coordinate direction. More...
 
- Public Member Functions inherited from Nektar::SpatialDomains::Geometry
 Geometry ()
 
 Geometry (int coordim)
 
virtual ~Geometry ()
 
bool IsElmtConnected (int gvo_id, int locid) const
 
void AddElmtConnected (int gvo_id, int locid)
 
int NumElmtConnected () const
 
int GetCoordim () const
 
void SetCoordim (int coordim)
 
GeomFactorsSharedPtr GetGeomFactors ()
 
GeomFactorsSharedPtr GetRefGeomFactors (const Array< OneD, const LibUtilities::BasisSharedPtr > &tbasis)
 
GeomFactorsSharedPtr GetMetricInfo ()
 
LibUtilities::ShapeType GetShapeType (void)
 
int GetGlobalID (void)
 
void SetGlobalID (int globalid)
 
int GetVid (int i) const
 
int GetEid (int i) const
 
int GetFid (int i) const
 
int GetTid (int i) const
 
int GetNumVerts () const
 
PointGeomSharedPtr GetVertex (int i) const
 
StdRegions::Orientation GetEorient (const int i) const
 
StdRegions::Orientation GetPorient (const int i) const
 
StdRegions::Orientation GetForient (const int i) const
 
int GetNumEdges () const
 
int GetNumFaces () const
 
int GetShapeDim () const
 
StdRegions::StdExpansionSharedPtr GetXmap () const
 
const Array< OneD, const NekDouble > & GetCoeffs (const int i) const
 
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
 
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol)
 
bool ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
 
int GetVertexEdgeMap (int i, int j) const
 
int GetVertexFaceMap (int i, int j) const
 return the id of the $j^{th}$ face attached to the $ i^{th}$ vertex More...
 
int GetEdgeFaceMap (int i, int j) const
 
void FillGeom ()
 Put all quadrature information into face/edge structure and backward transform. More...
 
NekDouble GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
 
NekDouble GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord)
 Given local collapsed coordinate Lcoord return the value of physical coordinate in direction i. More...
 
void SetOwnData ()
 
const LibUtilities::BasisSharedPtr GetBasis (const int i)
 Return the j-th basis of the i-th co-ordinate dimension. More...
 
const LibUtilities::PointsKeyVector GetPointsKeys ()
 
void Reset (CurveMap &curvedEdges, CurveMap &curvedFaces)
 

Protected Member Functions

void NewtonIterationForLocCoord (const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, const Array< OneD, const NekDouble > &ptsz, Array< OneD, NekDouble > &Lcoords, NekDouble &resid)
 
virtual void v_FillGeom ()
 Put all quadrature information into face/edge structure and backward transform. More...
 
virtual NekDouble v_GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord)
 Given local collapsed coordinate Lcoord return the value of physical coordinate in direction i. More...
 
virtual void v_GenGeomFactors ()
 
virtual int v_GetShapeDim () const
 Return the dimension of this element. More...
 
virtual int v_GetVid (int i) const
 Return the vertex ID of vertex i. More...
 
virtual PointGeomSharedPtr v_GetVertex (int i) const
 Return vertex i in this element. More...
 
virtual const SegGeomSharedPtr v_GetEdge (int i) const
 Return edge i of this element. More...
 
virtual StdRegions::Orientation v_GetEorient (const int i) const
 Return the orientation of edge i in this element. More...
 
virtual int v_GetEid (int i) const
 Return the ID of edge i in this element. More...
 
virtual const Geometry2DSharedPtr v_GetFace (int i) const
 Return face i in this element. More...
 
virtual StdRegions::Orientation v_GetForient (const int i) const
 Return the orientation of face i in this element. More...
 
virtual int v_GetFid (int i) const
 Return the ID of face i in this element. More...
 
virtual int v_GetEid () const
 Return the ID of this element. More...
 
virtual int v_WhichEdge (SegGeomSharedPtr edge)
 Return the local ID of a given edge. More...
 
virtual int v_WhichFace (Geometry2DSharedPtr face)
 Return the local ID of a given face. More...
 
virtual const LibUtilities::BasisSharedPtr v_GetBasis (const int i)
 Return the j-th basis of the i-th co-ordinate dimension. More...
 
virtual int v_GetDir (const int faceidx, const int facedir) const =0
 
virtual void v_AddElmtConnected (int gvo_id, int locid)
 
virtual bool v_IsElmtConnected (int gvo_id, int locid) const
 
virtual int v_NumElmtConnected () const
 
virtual void v_SetOwnData ()
 
- Protected Member Functions inherited from Nektar::SpatialDomains::Geometry
void GenGeomFactors ()
 
virtual int v_GetNumVerts () const
 
virtual StdRegions::Orientation v_GetPorient (const int i) const
 
virtual int v_GetNumEdges () const
 
virtual int v_GetNumFaces () const
 
virtual StdRegions::StdExpansionSharedPtr v_GetXmap () const
 
virtual int v_GetCoordim () const
 
virtual bool v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
 
virtual bool v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol)
 
virtual bool v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
 
virtual int v_GetVertexEdgeMap (int i, int j) const
 
virtual int v_GetVertexFaceMap (int i, int j) const
 
virtual int v_GetEdgeFaceMap (int i, int j) const
 
virtual NekDouble v_GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
 
virtual void v_Reset (CurveMap &curvedEdges, CurveMap &curvedFaces)
 Reset this geometry object: unset the current state and remove allocated GeomFactors. More...
 
void SetUpCoeffs (const int nCoeffs)
 Initialise the m_coeffs array. More...
 

Protected Attributes

PointGeomVector m_verts
 
SegGeomVector m_edges
 
Geometry2DVector m_faces
 
std::vector< StdRegions::Orientationm_eorient
 
std::vector< StdRegions::Orientationm_forient
 
std::list< CompToElmtm_elmtmap
 
bool m_owndata
 
int m_eid
 
bool m_ownverts
 
- Protected Attributes inherited from Nektar::SpatialDomains::Geometry
int m_coordim
 coordinate dimension More...
 
GeomFactorsSharedPtr m_geomFactors
 
GeomState m_geomFactorsState
 
StdRegions::StdExpansionSharedPtr m_xmap
 
GeomState m_state
 enum identifier to determine if quad points are filled More...
 
GeomType m_geomType
 
LibUtilities::ShapeType m_shapeType
 
int m_globalID
 
Array< OneD, Array< OneD, NekDouble > > m_coeffs
 

Additional Inherited Members

- Static Protected Member Functions inherited from Nektar::SpatialDomains::Geometry
static GeomFactorsSharedPtr ValidateRegGeomFactor (GeomFactorsSharedPtr geomFactor)
 
- Static Protected Attributes inherited from Nektar::SpatialDomains::Geometry
static GeomFactorsVector m_regGeomFactorsManager
 

Detailed Description

3D geometry information

Definition at line 70 of file Geometry3D.h.

Constructor & Destructor Documentation

Nektar::SpatialDomains::Geometry3D::Geometry3D ( )

Definition at line 48 of file Geometry3D.cpp.

49  {
50  }
Nektar::SpatialDomains::Geometry3D::Geometry3D ( const int  coordim)

Definition at line 52 of file Geometry3D.cpp.

References ASSERTL0, and Nektar::SpatialDomains::Geometry::m_coordim.

52  :
53  Geometry(coordim)
54  {
55  ASSERTL0(m_coordim > 2,
56  "Coordinate dimension should be at least 3 for a 3D geometry.");
57  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
int m_coordim
coordinate dimension
Definition: Geometry.h:169
Nektar::SpatialDomains::Geometry3D::~Geometry3D ( )
virtual

Definition at line 59 of file Geometry3D.cpp.

60  {
61  }

Member Function Documentation

int Nektar::SpatialDomains::Geometry3D::GetDir ( const int  faceidx,
const int  facedir 
) const

Returns the element coordinate direction corresponding to a given face coordinate direction.

Definition at line 88 of file Geometry3D.cpp.

References v_GetDir().

Referenced by Nektar::SpatialDomains::MeshGraph3D::GetFaceBasisKey().

89  {
90  return v_GetDir(faceidx, facedir);
91  }
virtual int v_GetDir(const int faceidx, const int facedir) const =0
const Geometry1DSharedPtr Nektar::SpatialDomains::Geometry3D::GetEdge ( int  i) const
int Nektar::SpatialDomains::Geometry3D::GetEid ( int  i) const

Return the ID of edge i in this element.

Definition at line 71 of file Geometry3D.cpp.

References v_GetEid().

Referenced by Nektar::SpatialDomains::PyrGeom::SetUpLocalEdges(), Nektar::SpatialDomains::TetGeom::SetUpLocalEdges(), Nektar::SpatialDomains::PrismGeom::SetUpLocalEdges(), and Nektar::SpatialDomains::HexGeom::SetUpLocalEdges().

72  {
73  return v_GetEid(i);
74  }
virtual int v_GetEid() const
Return the ID of this element.
Definition: Geometry3D.cpp:435
Geometry2DSharedPtr Nektar::SpatialDomains::Geometry3D::GetFace ( int  i)

Return face i in this element.

Definition at line 79 of file Geometry3D.cpp.

References v_GetFace().

Referenced by Nektar::SolverUtils::UpdateGeometry().

80  {
81  return v_GetFace(i);
82  }
virtual const Geometry2DSharedPtr v_GetFace(int i) const
Return face i in this element.
Definition: Geometry3D.cpp:404
void Nektar::SpatialDomains::Geometry3D::NewtonIterationForLocCoord ( const Array< OneD, const NekDouble > &  coords,
const Array< OneD, const NekDouble > &  ptsx,
const Array< OneD, const NekDouble > &  ptsy,
const Array< OneD, const NekDouble > &  ptsz,
Array< OneD, NekDouble > &  Lcoords,
NekDouble resid 
)
protected

Definition at line 96 of file Geometry3D.cpp.

References Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_xmap, Vmath::Vsum(), and WARNINGL1.

Referenced by Nektar::SpatialDomains::TetGeom::v_GetLocCoords(), Nektar::SpatialDomains::PrismGeom::v_GetLocCoords(), and Nektar::SpatialDomains::HexGeom::v_GetLocCoords().

103  {
104  // maximum iterations for convergence
105  const int MaxIterations = 51;
106  // |x-xp|^2 < EPSILON error tolerance
107  const NekDouble Tol = 1.e-8;
108  // |r,s| > LcoordDIV stop the search
109  const NekDouble LcoordDiv = 15.0;
110 
111  Array<OneD, const NekDouble > Jac =
112  m_geomFactors->GetJac(m_xmap->GetPointsKeys());
113 
114  NekDouble ScaledTol = Vmath::Vsum(Jac.num_elements(), Jac, 1) /
115  ((NekDouble)Jac.num_elements());
116  ScaledTol *= Tol;
117 
118  NekDouble xmap,ymap,zmap, F1,F2, F3;
119 
120  NekDouble derx_1, derx_2, derx_3, dery_1, dery_2, dery_3,
121  derz_1, derz_2, derz_3, jac;
122 
123  // save intiial guess for later reference if required.
124  NekDouble init0 = Lcoords[0], init1 = Lcoords[1], init2 = Lcoords[2];
125 
126  Array<OneD, NekDouble> DxD1(ptsx.num_elements());
127  Array<OneD, NekDouble> DxD2(ptsx.num_elements());
128  Array<OneD, NekDouble> DxD3(ptsx.num_elements());
129  Array<OneD, NekDouble> DyD1(ptsx.num_elements());
130  Array<OneD, NekDouble> DyD2(ptsx.num_elements());
131  Array<OneD, NekDouble> DyD3(ptsx.num_elements());
132  Array<OneD, NekDouble> DzD1(ptsx.num_elements());
133  Array<OneD, NekDouble> DzD2(ptsx.num_elements());
134  Array<OneD, NekDouble> DzD3(ptsx.num_elements());
135 
136  // Ideally this will be stored in m_geomfactors
137  m_xmap->PhysDeriv(ptsx,DxD1,DxD2,DxD3);
138  m_xmap->PhysDeriv(ptsy,DyD1,DyD2,DyD3);
139  m_xmap->PhysDeriv(ptsz,DzD1,DzD2,DzD3);
140 
141  int cnt=0;
142  Array<OneD, DNekMatSharedPtr > I(3);
143  Array<OneD, NekDouble> eta(3);
144 
145  F1 = F2 = F3 = 2000; // Starting value of Function
146 
147  while(cnt++ < MaxIterations)
148  {
149  // evaluate lagrange interpolant at Lcoords
150  m_xmap->LocCoordToLocCollapsed(Lcoords,eta);
151  I[0] = m_xmap->GetBasis(0)->GetI(eta );
152  I[1] = m_xmap->GetBasis(1)->GetI(eta+1);
153  I[2] = m_xmap->GetBasis(2)->GetI(eta+2);
154 
155  //calculate the global point `corresponding to Lcoords
156  xmap = m_xmap->PhysEvaluate(I, ptsx);
157  ymap = m_xmap->PhysEvaluate(I, ptsy);
158  zmap = m_xmap->PhysEvaluate(I, ptsz);
159 
160  F1 = coords[0] - xmap;
161  F2 = coords[1] - ymap;
162  F3 = coords[2] - zmap;
163 
164  if(F1*F1 + F2*F2 + F3*F3 < ScaledTol)
165  {
166  resid = sqrt(F1*F1 + F2*F2 + F3*F3);
167  break;
168  }
169 
170  //Interpolate derivative metric at Lcoords
171  derx_1 = m_xmap->PhysEvaluate(I, DxD1);
172  derx_2 = m_xmap->PhysEvaluate(I, DxD2);
173  derx_3 = m_xmap->PhysEvaluate(I, DxD3);
174  dery_1 = m_xmap->PhysEvaluate(I, DyD1);
175  dery_2 = m_xmap->PhysEvaluate(I, DyD2);
176  dery_3 = m_xmap->PhysEvaluate(I, DyD3);
177  derz_1 = m_xmap->PhysEvaluate(I, DzD1);
178  derz_2 = m_xmap->PhysEvaluate(I, DzD2);
179  derz_3 = m_xmap->PhysEvaluate(I, DzD3);
180 
181  jac = derx_1*(dery_2*derz_3 - dery_3*derz_2)
182  - derx_2*(dery_1*derz_3 - dery_3*derz_1)
183  + derx_3*(dery_1*derz_2 - dery_2*derz_1);
184 
185  // use analytical inverse of derivitives which are also similar to
186  // those of metric factors.
187  Lcoords[0] = Lcoords[0]
188  +((dery_2*derz_3 - dery_3*derz_2)*(coords[0]-xmap)
189  - (derx_2*derz_3 - derx_3*derz_2)*(coords[1]-ymap)
190  + (derx_2*dery_3 - derx_3*dery_2)*(coords[2]-zmap)
191  )/jac;
192 
193  Lcoords[1] = Lcoords[1]
194  -((dery_1*derz_3 - dery_3*derz_1)*(coords[0]-xmap)
195  - (derx_1*derz_3 - derx_3*derz_1)*(coords[1]-ymap)
196  + (derx_1*dery_3 - derx_3*dery_1)*(coords[2]-zmap)
197  )/jac;
198 
199  Lcoords[2] = Lcoords[2]
200  +((dery_1*derz_2 - dery_2*derz_1)*(coords[0]-xmap)
201  - (derx_1*derz_2 - derx_2*derz_1)*(coords[1]-ymap)
202  + (derx_1*dery_2 - derx_2*dery_1)*(coords[2]-zmap)
203  )/jac;
204 
205  if (fabs(Lcoords[0]) > LcoordDiv || fabs(Lcoords[1]) > LcoordDiv ||
206  fabs(Lcoords[0]) > LcoordDiv)
207  {
208  break; // lcoords have diverged so stop iteration
209  }
210  }
211 
212  resid = sqrt(F1*F1 + F2*F2 + F3*F3);
213 
214  if(cnt >= MaxIterations)
215  {
216  Array<OneD, NekDouble> collCoords(3);
217  m_xmap->LocCoordToLocCollapsed(Lcoords,collCoords);
218 
219  // if coordinate is inside element dump error!
220  if((collCoords[0] >= -1.0 && collCoords[0] <= 1.0)&&
221  (collCoords[1] >= -1.0 && collCoords[1] <= 1.0)&&
222  (collCoords[2] >= -1.0 && collCoords[2] <= 1.0))
223  {
224  std::ostringstream ss;
225 
226  ss << "Reached MaxIterations (" << MaxIterations << ") in Newton iteration ";
227  ss << "Init value ("<< setprecision(4) << init0 << "," << init1<< "," << init2 <<") ";
228  ss << "Fin value ("<<Lcoords[0] << "," << Lcoords[1]<< "," << Lcoords[2] << ") ";
229  ss << "Resid = " << resid << " Tolerance = " << sqrt(ScaledTol) ;
230 
231  WARNINGL1(cnt < MaxIterations,ss.str());
232  }
233  }
234  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
GeomFactorsSharedPtr m_geomFactors
Definition: Geometry.h:170
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
double NekDouble
#define WARNINGL1(condition, msg)
Definition: ErrorUtil.hpp:192
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
Definition: Vmath.cpp:714
void Nektar::SpatialDomains::Geometry3D::v_AddElmtConnected ( int  gvo_id,
int  locid 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 499 of file Geometry3D.cpp.

References m_elmtmap.

500  {
501  CompToElmt ee(gvo_id,locid);
502  m_elmtmap.push_back(ee);
503  }
std::list< CompToElmt > m_elmtmap
Definition: Geometry3D.h:94
void Nektar::SpatialDomains::Geometry3D::v_FillGeom ( )
protectedvirtual

Put all quadrature information into face/edge structure and backward transform.

Note verts, edges, and faces are listed according to anticlockwise convention but points in _coeffs have to be in array format from left to right.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 244 of file Geometry3D.cpp.

References Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, m_faces, m_forient, Nektar::SpatialDomains::Geometry::m_state, and Nektar::SpatialDomains::Geometry::m_xmap.

Referenced by Nektar::SpatialDomains::TetGeom::v_ContainsPoint(), Nektar::SpatialDomains::PrismGeom::v_ContainsPoint(), Nektar::SpatialDomains::HexGeom::v_ContainsPoint(), Nektar::SpatialDomains::PyrGeom::v_GenGeomFactors(), Nektar::SpatialDomains::PrismGeom::v_GenGeomFactors(), Nektar::SpatialDomains::HexGeom::v_GenGeomFactors(), v_GenGeomFactors(), Nektar::SpatialDomains::TetGeom::v_GetLocCoords(), Nektar::SpatialDomains::PyrGeom::v_GetLocCoords(), Nektar::SpatialDomains::PrismGeom::v_GetLocCoords(), and Nektar::SpatialDomains::HexGeom::v_GetLocCoords().

245  {
246  if (m_state == ePtsFilled)
247  return;
248 
249  int i,j,k;
250 
251  for(i = 0; i < m_forient.size(); i++)
252  {
253  m_faces[i]->FillGeom();
254 
255  int nFaceCoeffs = m_faces[i]->GetXmap()->GetNcoeffs();
256 
257  Array<OneD, unsigned int> mapArray (nFaceCoeffs);
258  Array<OneD, int> signArray(nFaceCoeffs);
259 
260  if (m_forient[i] < 9)
261  {
262  m_xmap->GetFaceToElementMap(
263  i, m_forient[i], mapArray, signArray,
264  m_faces[i]->GetXmap()->GetEdgeNcoeffs(0),
265  m_faces[i]->GetXmap()->GetEdgeNcoeffs(1));
266  }
267  else
268  {
269  m_xmap->GetFaceToElementMap(
270  i, m_forient[i], mapArray, signArray,
271  m_faces[i]->GetXmap()->GetEdgeNcoeffs(1),
272  m_faces[i]->GetXmap()->GetEdgeNcoeffs(0));
273  }
274 
275  for (j = 0; j < m_coordim; j++)
276  {
277  const Array<OneD, const NekDouble> &coeffs =
278  m_faces[i]->GetCoeffs(j);
279 
280  for (k = 0; k < nFaceCoeffs; k++)
281  {
282  NekDouble v = signArray[k] * coeffs[k];
283  m_coeffs[j][mapArray[k]] = v;
284  }
285  }
286  }
287 
289  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
StdRegions::StdExpansionSharedPtr GetXmap() const
Definition: Geometry.h:383
std::vector< StdRegions::Orientation > m_forient
Definition: Geometry3D.h:93
double NekDouble
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Definition: Geometry.h:180
Geometric information has been generated.
GeomState m_state
enum identifier to determine if quad points are filled
Definition: Geometry.h:175
int m_coordim
coordinate dimension
Definition: Geometry.h:169
void Nektar::SpatialDomains::Geometry3D::v_GenGeomFactors ( )
protectedvirtual

Generate the geometry factors for this element.

Implements Nektar::SpatialDomains::Geometry.

Reimplemented in Nektar::SpatialDomains::HexGeom, Nektar::SpatialDomains::PrismGeom, and Nektar::SpatialDomains::PyrGeom.

Definition at line 294 of file Geometry3D.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_geomFactorsState, Nektar::SpatialDomains::Geometry::m_xmap, and v_FillGeom().

295  {
297  {
298  GeomType Gtype = eRegular;
299 
300  v_FillGeom();
301 
302  // check to see if expansions are linear
303  for(int i = 0; i < m_coordim; ++i)
304  {
305  if (m_xmap->GetBasisNumModes(0) != 2 ||
306  m_xmap->GetBasisNumModes(1) != 2 ||
307  m_xmap->GetBasisNumModes(2) != 2)
308  {
309  Gtype = eDeformed;
310  }
311  }
312 
314  Gtype, m_coordim, m_xmap, m_coeffs);
316  }
317  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
GeomFactorsSharedPtr m_geomFactors
Definition: Geometry.h:170
virtual void v_FillGeom()
Put all quadrature information into face/edge structure and backward transform.
Definition: Geometry3D.cpp:244
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Definition: Geometry.h:180
Geometry is straight-sided with constant geometric factors.
Geometric information has been generated.
GeomType
Indicates the type of element geometry.
Geometry is curved or has non-constant factors.
int m_coordim
coordinate dimension
Definition: Geometry.h:169
const LibUtilities::BasisSharedPtr Nektar::SpatialDomains::Geometry3D::v_GetBasis ( const int  i)
protectedvirtual

Return the j-th basis of the i-th co-ordinate dimension.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 443 of file Geometry3D.cpp.

References Nektar::SpatialDomains::Geometry::m_xmap.

445  {
446  return m_xmap->GetBasis(i);
447  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
NekDouble Nektar::SpatialDomains::Geometry3D::v_GetCoord ( const int  i,
const Array< OneD, const NekDouble > &  Lcoord 
)
protectedvirtual

Given local collapsed coordinate Lcoord return the value of physical coordinate in direction i.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 323 of file Geometry3D.cpp.

References ASSERTL1, Nektar::SpatialDomains::ePtsFilled, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_state, and Nektar::SpatialDomains::Geometry::m_xmap.

325  {
327  "Geometry is not in physical space");
328 
329  Array<OneD, NekDouble> tmp(m_xmap->GetTotPoints());
330  m_xmap->BwdTrans(m_coeffs[i], tmp);
331 
332  return m_xmap->PhysEvaluate(Lcoord, tmp);
333  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Definition: Geometry.h:180
Geometric information has been generated.
GeomState m_state
enum identifier to determine if quad points are filled
Definition: Geometry.h:175
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
virtual int Nektar::SpatialDomains::Geometry3D::v_GetDir ( const int  faceidx,
const int  facedir 
) const
protectedpure virtual
const SegGeomSharedPtr Nektar::SpatialDomains::Geometry3D::v_GetEdge ( int  i) const
protectedvirtual

Return edge i of this element.

Definition at line 370 of file Geometry3D.cpp.

References ASSERTL2, and m_edges.

371  {
372  ASSERTL2(i >= 0 && i <= m_edges.size() - 1,
373  "Edge ID must be between 0 and "+
374  boost::lexical_cast<string>(m_edges.size() - 1));
375  return m_edges[i];
376  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
int Nektar::SpatialDomains::Geometry3D::v_GetEid ( int  i) const
protectedvirtual

Return the ID of edge i in this element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 393 of file Geometry3D.cpp.

References ASSERTL2, and m_edges.

394  {
395  ASSERTL2(i >= 0 && i <= m_edges.size() - 1,
396  "Edge ID must be between 0 and "+
397  boost::lexical_cast<string>(m_edges.size() - 1));
398  return m_edges[i]->GetEid();
399  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
int Nektar::SpatialDomains::Geometry3D::v_GetEid ( ) const
protectedvirtual

Return the ID of this element.

Definition at line 435 of file Geometry3D.cpp.

References m_eid.

Referenced by GetEid().

436  {
437  return m_eid;
438  }
StdRegions::Orientation Nektar::SpatialDomains::Geometry3D::v_GetEorient ( const int  i) const
inlineprotectedvirtual

Return the orientation of edge i in this element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 381 of file Geometry3D.cpp.

References ASSERTL2, m_edges, and m_eorient.

383  {
384  ASSERTL2(i >= 0 && i <= m_edges.size() - 1,
385  "Edge ID must be between 0 and "+
386  boost::lexical_cast<string>(m_edges.size() - 1));
387  return m_eorient[i];
388  }
std::vector< StdRegions::Orientation > m_eorient
Definition: Geometry3D.h:92
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
const Geometry2DSharedPtr Nektar::SpatialDomains::Geometry3D::v_GetFace ( int  i) const
protectedvirtual

Return face i in this element.

Definition at line 404 of file Geometry3D.cpp.

References ASSERTL2, and m_faces.

Referenced by GetFace().

405  {
406  ASSERTL2((i >=0) && (i <= 5),"Edge id must be between 0 and 4");
407  return m_faces[i];
408  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
int Nektar::SpatialDomains::Geometry3D::v_GetFid ( int  i) const
protectedvirtual

Return the ID of face i in this element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 424 of file Geometry3D.cpp.

References ASSERTL2, and m_faces.

425  {
426  ASSERTL2(i >= 0 && i <= m_faces.size() - 1,
427  "Face ID must be between 0 and "+
428  boost::lexical_cast<string>(m_faces.size() - 1));
429  return m_faces[i]->GetFid();
430  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
StdRegions::Orientation Nektar::SpatialDomains::Geometry3D::v_GetForient ( const int  i) const
protectedvirtual

Return the orientation of face i in this element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 413 of file Geometry3D.cpp.

References ASSERTL2, m_faces, and m_forient.

414  {
415  ASSERTL2(i >= 0 && i <= m_faces.size() - 1,
416  "Face ID must be between 0 and "+
417  boost::lexical_cast<string>(m_faces.size() - 1));
418  return m_forient[i];
419  }
std::vector< StdRegions::Orientation > m_forient
Definition: Geometry3D.h:93
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
int Nektar::SpatialDomains::Geometry3D::v_GetShapeDim ( ) const
protectedvirtual

Return the dimension of this element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 343 of file Geometry3D.cpp.

344  {
345  return 3;
346  }
PointGeomSharedPtr Nektar::SpatialDomains::Geometry3D::v_GetVertex ( int  i) const
protectedvirtual

Return vertex i in this element.

Implements Nektar::SpatialDomains::Geometry.

Definition at line 362 of file Geometry3D.cpp.

References m_verts.

363  {
364  return m_verts[i];
365  }
int Nektar::SpatialDomains::Geometry3D::v_GetVid ( int  i) const
protectedvirtual

Return the vertex ID of vertex i.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 351 of file Geometry3D.cpp.

References ASSERTL2, and m_verts.

352  {
353  ASSERTL2(i >= 0 && i <= m_verts.size() - 1,
354  "Vertex ID must be between 0 and "+
355  boost::lexical_cast<string>(m_verts.size() - 1));
356  return m_verts[i]->GetVid();
357  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:213
bool Nektar::SpatialDomains::Geometry3D::v_IsElmtConnected ( int  gvo_id,
int  locid 
) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 510 of file Geometry3D.cpp.

References Nektar::StdRegions::find(), and m_elmtmap.

511  {
512  std::list<CompToElmt>::const_iterator def;
513  CompToElmt ee(gvo_id,locid);
514 
515  def = find(m_elmtmap.begin(),m_elmtmap.end(),ee);
516 
517  // Found the element connectivity object in the list
518  return (def != m_elmtmap.end());
519  }
std::list< CompToElmt > m_elmtmap
Definition: Geometry3D.h:94
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:312
int Nektar::SpatialDomains::Geometry3D::v_NumElmtConnected ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 505 of file Geometry3D.cpp.

References m_elmtmap.

506  {
507  return int(m_elmtmap.size());
508  }
std::list< CompToElmt > m_elmtmap
Definition: Geometry3D.h:94
void Nektar::SpatialDomains::Geometry3D::v_SetOwnData ( )
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 521 of file Geometry3D.cpp.

References m_owndata.

522  {
523  m_owndata = true;
524  }
int Nektar::SpatialDomains::Geometry3D::v_WhichEdge ( SegGeomSharedPtr  edge)
protectedvirtual

Return the local ID of a given edge.

The local ID of an edge is a number between 0 and the number of edges in this element. If the edge is not found, this function returns -1.

Definition at line 455 of file Geometry3D.cpp.

References Nektar::iterator, and m_edges.

456  {
457  int returnval = -1;
458 
459  SegGeomVector::iterator edgeIter;
460  int i;
461 
462  for (i=0,edgeIter = m_edges.begin(); edgeIter != m_edges.end(); ++edgeIter,++i)
463  {
464  if (*edgeIter == edge)
465  {
466  returnval = i;
467  break;
468  }
469  }
470 
471  return returnval;
472  }
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
int Nektar::SpatialDomains::Geometry3D::v_WhichFace ( Geometry2DSharedPtr  face)
protectedvirtual

Return the local ID of a given face.

The local ID of a face is a number between 0 and the number of faces in this element. If the face is not found, this function returns -1.

Definition at line 480 of file Geometry3D.cpp.

References Nektar::iterator, and m_faces.

481  {
482  int i = 0;
483 
485  for (i = 0, f = m_faces.begin(); f != m_faces.end(); ++f,++i)
486  {
487  if (*f == face)
488  {
489  break;
490  }
491  }
492  return i;
493  }
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator

Member Data Documentation

SegGeomVector Nektar::SpatialDomains::Geometry3D::m_edges
protected
int Nektar::SpatialDomains::Geometry3D::m_eid
protected

Definition at line 96 of file Geometry3D.h.

Referenced by v_GetEid().

std::list<CompToElmt> Nektar::SpatialDomains::Geometry3D::m_elmtmap
protected

Definition at line 94 of file Geometry3D.h.

Referenced by v_AddElmtConnected(), v_IsElmtConnected(), and v_NumElmtConnected().

std::vector<StdRegions::Orientation> Nektar::SpatialDomains::Geometry3D::m_eorient
protected
Geometry2DVector Nektar::SpatialDomains::Geometry3D::m_faces
protected
std::vector<StdRegions::Orientation> Nektar::SpatialDomains::Geometry3D::m_forient
protected
bool Nektar::SpatialDomains::Geometry3D::m_owndata
protected

Definition at line 95 of file Geometry3D.h.

Referenced by v_SetOwnData().

bool Nektar::SpatialDomains::Geometry3D::m_ownverts
protected

Definition at line 97 of file Geometry3D.h.

PointGeomVector Nektar::SpatialDomains::Geometry3D::m_verts
protected