Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::Orientation
m_eorient
 
std::vector
< StdRegions::Orientation
m_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 51 of file Geometry3D.cpp.

52  {
53  }
Nektar::SpatialDomains::Geometry3D::Geometry3D ( const int  coordim)

Definition at line 55 of file Geometry3D.cpp.

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

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

Definition at line 62 of file Geometry3D.cpp.

63  {
64  }

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 91 of file Geometry3D.cpp.

References v_GetDir().

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

92  {
93  return v_GetDir(faceidx, facedir);
94  }
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 74 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().

75  {
76  return v_GetEid(i);
77  }
virtual int v_GetEid() const
Return the ID of this element.
Definition: Geometry3D.cpp:438
Geometry2DSharedPtr Nektar::SpatialDomains::Geometry3D::GetFace ( int  i)

Return face i in this element.

Definition at line 82 of file Geometry3D.cpp.

References v_GetFace().

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

83  {
84  return v_GetFace(i);
85  }
virtual const Geometry2DSharedPtr v_GetFace(int i) const
Return face i in this element.
Definition: Geometry3D.cpp:407
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 99 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().

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

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 502 of file Geometry3D.cpp.

References m_elmtmap.

503  {
504  CompToElmt ee(gvo_id,locid);
505  m_elmtmap.push_back(ee);
506  }
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 247 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().

248  {
249  if (m_state == ePtsFilled)
250  return;
251 
252  int i,j,k;
253 
254  for(i = 0; i < m_forient.size(); i++)
255  {
256  m_faces[i]->FillGeom();
257 
258  int nFaceCoeffs = m_faces[i]->GetXmap()->GetNcoeffs();
259 
260  Array<OneD, unsigned int> mapArray (nFaceCoeffs);
261  Array<OneD, int> signArray(nFaceCoeffs);
262 
263  if (m_forient[i] < 9)
264  {
265  m_xmap->GetFaceToElementMap(
266  i, m_forient[i], mapArray, signArray,
267  m_faces[i]->GetXmap()->GetEdgeNcoeffs(0),
268  m_faces[i]->GetXmap()->GetEdgeNcoeffs(1));
269  }
270  else
271  {
272  m_xmap->GetFaceToElementMap(
273  i, m_forient[i], mapArray, signArray,
274  m_faces[i]->GetXmap()->GetEdgeNcoeffs(1),
275  m_faces[i]->GetXmap()->GetEdgeNcoeffs(0));
276  }
277 
278  for (j = 0; j < m_coordim; j++)
279  {
280  const Array<OneD, const NekDouble> &coeffs =
281  m_faces[i]->GetCoeffs(j);
282 
283  for (k = 0; k < nFaceCoeffs; k++)
284  {
285  NekDouble v = signArray[k] * coeffs[k];
286  m_coeffs[j][mapArray[k]] = v;
287  }
288  }
289  }
290 
292  }
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 297 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().

298  {
300  {
301  GeomType Gtype = eRegular;
302 
303  v_FillGeom();
304 
305  // check to see if expansions are linear
306  for(int i = 0; i < m_coordim; ++i)
307  {
308  if (m_xmap->GetBasisNumModes(0) != 2 ||
309  m_xmap->GetBasisNumModes(1) != 2 ||
310  m_xmap->GetBasisNumModes(2) != 2)
311  {
312  Gtype = eDeformed;
313  }
314  }
315 
317  Gtype, m_coordim, m_xmap, m_coeffs);
319  }
320  }
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:247
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 446 of file Geometry3D.cpp.

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

448  {
449  return m_xmap->GetBasis(i);
450  }
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 326 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.

328  {
330  "Geometry is not in physical space");
331 
332  Array<OneD, NekDouble> tmp(m_xmap->GetTotPoints());
333  m_xmap->BwdTrans(m_coeffs[i], tmp);
334 
335  return m_xmap->PhysEvaluate(Lcoord, tmp);
336  }
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:228
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 373 of file Geometry3D.cpp.

References ASSERTL2, and m_edges.

374  {
375  ASSERTL2(i >= 0 && i <= m_edges.size() - 1,
376  "Edge ID must be between 0 and "+
377  boost::lexical_cast<string>(m_edges.size() - 1));
378  return m_edges[i];
379  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:250
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 396 of file Geometry3D.cpp.

References ASSERTL2, and m_edges.

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

Return the ID of this element.

Definition at line 438 of file Geometry3D.cpp.

References m_eid.

Referenced by GetEid().

439  {
440  return m_eid;
441  }
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 384 of file Geometry3D.cpp.

References ASSERTL2, m_edges, and m_eorient.

386  {
387  ASSERTL2(i >= 0 && i <= m_edges.size() - 1,
388  "Edge ID must be between 0 and "+
389  boost::lexical_cast<string>(m_edges.size() - 1));
390  return m_eorient[i];
391  }
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:250
const Geometry2DSharedPtr Nektar::SpatialDomains::Geometry3D::v_GetFace ( int  i) const
protectedvirtual

Return face i in this element.

Definition at line 407 of file Geometry3D.cpp.

References ASSERTL2, and m_faces.

Referenced by GetFace().

408  {
409  ASSERTL2((i >=0) && (i <= 5),"Edge id must be between 0 and 4");
410  return m_faces[i];
411  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:250
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 427 of file Geometry3D.cpp.

References ASSERTL2, and m_faces.

428  {
429  ASSERTL2(i >= 0 && i <= m_faces.size() - 1,
430  "Face ID must be between 0 and "+
431  boost::lexical_cast<string>(m_faces.size() - 1));
432  return m_faces[i]->GetFid();
433  }
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
Definition: ErrorUtil.hpp:250
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 416 of file Geometry3D.cpp.

References ASSERTL2, m_faces, and m_forient.

417  {
418  ASSERTL2(i >= 0 && i <= m_faces.size() - 1,
419  "Face ID must be between 0 and "+
420  boost::lexical_cast<string>(m_faces.size() - 1));
421  return m_forient[i];
422  }
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:250
int Nektar::SpatialDomains::Geometry3D::v_GetShapeDim ( ) const
protectedvirtual

Return the dimension of this element.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 346 of file Geometry3D.cpp.

347  {
348  return 3;
349  }
PointGeomSharedPtr Nektar::SpatialDomains::Geometry3D::v_GetVertex ( int  i) const
protectedvirtual

Return vertex i in this element.

Implements Nektar::SpatialDomains::Geometry.

Definition at line 365 of file Geometry3D.cpp.

References m_verts.

366  {
367  return m_verts[i];
368  }
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 354 of file Geometry3D.cpp.

References ASSERTL2, and m_verts.

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

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 513 of file Geometry3D.cpp.

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

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

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 508 of file Geometry3D.cpp.

References m_elmtmap.

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

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 524 of file Geometry3D.cpp.

References m_owndata.

525  {
526  m_owndata = true;
527  }
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 458 of file Geometry3D.cpp.

References Nektar::iterator, and m_edges.

459  {
460  int returnval = -1;
461 
462  SegGeomVector::iterator edgeIter;
463  int i;
464 
465  for (i=0,edgeIter = m_edges.begin(); edgeIter != m_edges.end(); ++edgeIter,++i)
466  {
467  if (*edgeIter == edge)
468  {
469  returnval = i;
470  break;
471  }
472  }
473 
474  return returnval;
475  }
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 483 of file Geometry3D.cpp.

References Nektar::iterator, and m_faces.

484  {
485  int i = 0;
486 
488  for (i = 0, f = m_faces.begin(); f != m_faces.end(); ++f,++i)
489  {
490  if (*f == face)
491  {
492  break;
493  }
494  }
495  return i;
496  }
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