Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Nektar::SpatialDomains::SegGeom Class Reference

#include <SegGeom.h>

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

Public Member Functions

 SegGeom ()
 
 SegGeom (int id, const int coordim)
 
 SegGeom (int id, const int coordim, const PointGeomSharedPtr vertex[])
 
 SegGeom (int id, const int coordim, const PointGeomSharedPtr vertex[], const CurveSharedPtr &curve)
 
 SegGeom (const int id, const PointGeomSharedPtr &vert1, const PointGeomSharedPtr &vert2)
 
 SegGeom (const SegGeom &in)
 
SegGeomSharedPtr GenerateOneSpaceDimGeom (void)
 Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] is set to vert[0] plus the length of the original segment. More...
 
 ~SegGeom ()
 
NekDouble GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord)
 
StdRegions::StdExpansion1DSharedPtr operator[] (const int i) const
 
- Public Member Functions inherited from Nektar::SpatialDomains::Geometry1D
 Geometry1D ()
 
 Geometry1D (const int coordim)
 
virtual ~Geometry1D ()
 
PointGeomSharedPtr GetVertex (const int i) const
 
LibUtilities::ShapeType DetShapeType () const
 
int GetEid () const
 
- 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)
 

Static Public Member Functions

static StdRegions::Orientation GetEdgeOrientation (const SegGeom &edge1, const SegGeom &edge2)
 Get the orientation of edge1. More...
 

Static Public Attributes

static const int kNverts = 2
 
static const int kNedges = 1
 

Protected Member Functions

virtual int v_GetShapeDim () const
 
virtual int v_GetVid (int i) const
 
virtual PointGeomSharedPtr v_GetVertex (const int i) const
 
virtual int v_GetEid () const
 
virtual const
LibUtilities::BasisSharedPtr 
v_GetBasis (const int i)
 
virtual
StdRegions::StdExpansionSharedPtr 
v_GetXmap () const
 
virtual void v_SetOwnData ()
 
virtual void v_AddElmtConnected (int gvo_id, int locid)
 
virtual int v_NumElmtConnected () const
 
virtual bool v_IsElmtConnected (int gvoId, int locId) const
 
virtual LibUtilities::ShapeType v_DetShapeType () const
 
virtual NekDouble v_GetLocCoords (const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
 
virtual void v_GenGeomFactors ()
 Set up GeoFac for this geometry using Coord quadrature distribution. More...
 
virtual StdRegions::Orientation v_GetPorient (const int i) const
 
virtual void v_FillGeom ()
 put all quadrature information into edge structure and backward transform More...
 
virtual void v_Reset (CurveMap &curvedEdges, CurveMap &curvedFaces)
 Reset this geometry object: unset the current state and remove allocated GeomFactors. More...
 
virtual NekDouble v_GetCoord (const int i, const Array< OneD, const NekDouble > &Lcoord)
 
virtual int v_GetNumVerts () const
 
virtual int v_GetNumEdges () const
 
virtual bool v_ContainsPoint (const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
 Determines if a point specified in global coordinates is located within this tetrahedral geometry. More...
 
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)
 
- Protected Member Functions inherited from Nektar::SpatialDomains::Geometry
void GenGeomFactors ()
 
virtual int v_GetEid (int i) const
 
virtual int v_GetFid (int i) const
 
virtual StdRegions::Orientation v_GetEorient (const int i) const
 
virtual StdRegions::Orientation v_GetForient (const int i) const
 
virtual int v_GetNumFaces () const
 
virtual int v_GetCoordim () const
 
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
 
void SetUpCoeffs (const int nCoeffs)
 Initialise the m_coeffs array. More...
 

Protected Attributes

int m_eid
 
std::list< CompToElmtm_elmtMap
 
SpatialDomains::PointGeomSharedPtr m_verts [kNverts]
 
StdRegions::Orientation m_porient [kNverts]
 
- 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
 

Private Member Functions

void SetUpXmap ()
 

Private Attributes

bool m_ownData
 Boolean indicating whether object owns the data. More...
 
CurveSharedPtr m_curve
 

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

Definition at line 57 of file SegGeom.h.

Constructor & Destructor Documentation

Nektar::SpatialDomains::SegGeom::SegGeom ( )
Nektar::SpatialDomains::SegGeom::SegGeom ( int  id,
const int  coordim 
)
Nektar::SpatialDomains::SegGeom::SegGeom ( int  id,
const int  coordim,
const PointGeomSharedPtr  vertex[] 
)

Definition at line 64 of file SegGeom.cpp.

References Nektar::SpatialDomains::eNotFilled, Nektar::LibUtilities::eSegment, m_eid, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry::SetUpCoeffs(), and SetUpXmap().

67  :
68  Geometry1D(coordim)
69  {
71  m_eid = id;
72  m_globalID = id;
74 
75  if (coordim > 0)
76  {
77  SetUpXmap();
78  SetUpCoeffs(m_xmap->GetNcoeffs());
79  }
80 
81  m_verts[0] = vertex[0];
82  m_verts[1] = vertex[1];
83  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
Geometric information has not been generated.
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
LibUtilities::ShapeType m_shapeType
Definition: Geometry.h:177
void SetUpCoeffs(const int nCoeffs)
Initialise the m_coeffs array.
Definition: Geometry.h:484
GeomState m_state
enum identifier to determine if quad points are filled
Definition: Geometry.h:175
Nektar::SpatialDomains::SegGeom::SegGeom ( int  id,
const int  coordim,
const PointGeomSharedPtr  vertex[],
const CurveSharedPtr curve 
)

Definition at line 85 of file SegGeom.cpp.

References Nektar::NekMeshUtils::curve, Nektar::SpatialDomains::eNotFilled, Nektar::LibUtilities::eSegment, m_curve, m_eid, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry::SetUpCoeffs(), and SetUpXmap().

89  :
90  Geometry1D(coordim)
91  {
93  m_eid = id;
94  m_globalID = id;
96  m_curve = curve;
97 
98  SetUpXmap();
99  SetUpCoeffs(m_xmap->GetNcoeffs());
100 
101  m_verts[0] = vertex[0];
102  m_verts[1] = vertex[1];
103  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
Geometric information has not been generated.
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
LibUtilities::ShapeType m_shapeType
Definition: Geometry.h:177
void SetUpCoeffs(const int nCoeffs)
Initialise the m_coeffs array.
Definition: Geometry.h:484
GeomState m_state
enum identifier to determine if quad points are filled
Definition: Geometry.h:175
Nektar::SpatialDomains::SegGeom::SegGeom ( const int  id,
const PointGeomSharedPtr vert1,
const PointGeomSharedPtr vert2 
)

Definition at line 106 of file SegGeom.cpp.

References Nektar::SpatialDomains::eNotFilled, Nektar::LibUtilities::eSegment, m_eid, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry::SetUpCoeffs(), and SetUpXmap().

109  :
110  Geometry1D(vert1->GetCoordim())
111  {
113 
114  m_verts[0] = vert1;
115  m_verts[1] = vert2;
116 
118 
119  m_eid = id;
120  m_globalID = id;
121 
122  SetUpXmap();
123  SetUpCoeffs(m_xmap->GetNcoeffs());
124  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
Geometric information has not been generated.
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
LibUtilities::ShapeType m_shapeType
Definition: Geometry.h:177
void SetUpCoeffs(const int nCoeffs)
Initialise the m_coeffs array.
Definition: Geometry.h:484
GeomState m_state
enum identifier to determine if quad points are filled
Definition: Geometry.h:175
Nektar::SpatialDomains::SegGeom::SegGeom ( const SegGeom in)

Definition at line 126 of file SegGeom.cpp.

References Nektar::SpatialDomains::Geometry::m_coordim, m_eid, m_elmtMap, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_shapeType, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, and Nektar::SpatialDomains::Geometry::SetUpCoeffs().

127  {
128  // From Geometry class
129  m_shapeType = in.m_shapeType;
130 
131  // info from EdgeComponent class
132  m_eid = in.m_eid;
133  m_globalID = in.m_globalID;
134 
135  std::list<CompToElmt>::const_iterator def;
136  for(def = in.m_elmtMap.begin(); def != in.m_elmtMap.end(); def++)
137  {
138  m_elmtMap.push_back(*def);
139  }
140  m_xmap = in.m_xmap;
141  SetUpCoeffs(m_xmap->GetNcoeffs());
142 
143  // info from SegGeom class
144  m_coordim = in.m_coordim;
145  m_verts[0] = in.m_verts[0];
146  m_verts[1] = in.m_verts[1];
147 
148  m_state = in.m_state;
149  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
std::list< CompToElmt > m_elmtMap
Definition: SegGeom.h:103
LibUtilities::ShapeType m_shapeType
Definition: Geometry.h:177
void SetUpCoeffs(const int nCoeffs)
Initialise the m_coeffs array.
Definition: Geometry.h:484
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
Nektar::SpatialDomains::SegGeom::~SegGeom ( )

Definition at line 230 of file SegGeom.cpp.

231  {
232  }

Member Function Documentation

SegGeomSharedPtr Nektar::SpatialDomains::SegGeom::GenerateOneSpaceDimGeom ( void  )

Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] is set to vert[0] plus the length of the original segment.

Definition at line 175 of file SegGeom.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::SpatialDomains::eNotFilled, Nektar::SpatialDomains::Geometry::GetVid(), m_eid, m_elmtMap, Nektar::SpatialDomains::Geometry::m_geomFactors, Nektar::SpatialDomains::Geometry::m_globalID, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, and v_GenGeomFactors().

176  {
178 
179  // info about numbering
180  returnval->m_eid = m_eid;
181  returnval->m_globalID = m_globalID;
182  returnval->m_elmtMap = m_elmtMap;
183 
184 
185  // geometric information.
186  returnval->m_coordim = 1;
187  NekDouble x0 = (*m_verts[0])[0];
189  vert0->SetGlobalID(vert0->GetVid());
190  returnval->m_verts[0] = vert0;
191 
192  // Get information to calculate length.
193  const Array<OneD, const LibUtilities::BasisSharedPtr> base = m_xmap->GetBase();
195  v.push_back(base[0]->GetPointsKey());
197 
198  const Array<OneD, const NekDouble> jac = m_geomFactors->GetJac(v);
199 
200  NekDouble len = 0.0;
201  if(jac.num_elements() == 1)
202  {
203  len = jac[0]*2.0;
204  }
205  else
206  {
207  Array<OneD, const NekDouble> w0 = base[0]->GetW();
208  len = 0.0;
209 
210  for(int i = 0; i < jac.num_elements(); ++i)
211  {
212  len += jac[i]*w0[i];
213  }
214  }
215  // Set up second vertex.
217  vert1->SetGlobalID(vert1->GetVid());
218 
219  returnval->m_verts[1] = vert1;
220 
221  // at present just use previous m_xmap[0];
222  returnval->m_xmap = m_xmap;
223  returnval->SetUpCoeffs(m_xmap->GetNcoeffs());
224  returnval->m_state = eNotFilled;
225 
226  return returnval;
227  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
std::vector< PointsKey > PointsKeyVector
Definition: Points.h:220
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
GeomFactorsSharedPtr m_geomFactors
Definition: Geometry.h:170
virtual void v_GenGeomFactors()
Set up GeoFac for this geometry using Coord quadrature distribution.
Definition: SegGeom.cpp:319
Geometric information has not been generated.
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
double NekDouble
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
int GetVid(int i) const
Definition: Geometry.h:319
std::list< CompToElmt > m_elmtMap
Definition: SegGeom.h:103
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
NekDouble Nektar::SpatialDomains::SegGeom::GetCoord ( const int  i,
const Array< OneD, const NekDouble > &  Lcoord 
)
StdRegions::Orientation Nektar::SpatialDomains::SegGeom::GetEdgeOrientation ( const SegGeom edge1,
const SegGeom edge2 
)
static

Get the orientation of edge1.

If edge1 is connected to edge2 in the same direction as the points comprising edge1 then it is forward, otherwise it is backward.

For example, assume edge1 is comprised of points 1 and 2, and edge2 is comprised of points 2 and 3, then edge1 is forward.

If edge1 is comprised of points 2 and 1 and edge2 is comprised of points 3 and 2, then edge1 is backward.

Since both edges are passed, it does not need any information from the EdgeComponent instance.

Backward direction. Vertex 0 is connected to edge 2.

Definition at line 293 of file SegGeom.cpp.

References ASSERTL0, Nektar::StdRegions::eBackwards, Nektar::StdRegions::eForwards, Nektar::SpatialDomains::Geometry1D::GetEid(), and Nektar::SpatialDomains::Geometry1D::GetVertex().

Referenced by Nektar::NekMeshUtils::Quadrilateral::GetGeom(), Nektar::NekMeshUtils::Triangle::GetGeom(), Nektar::SpatialDomains::MeshGraph2D::ReadElements(), and Nektar::SpatialDomains::MeshGraph3D::ReadFaces().

296  {
298 
299  /// Backward direction. Vertex 0 is connected to edge 2.
300  if ((*edge1.GetVertex(0) == *edge2.GetVertex(0)) ||
301  (*edge1.GetVertex(0) == *edge2.GetVertex(1)))
302  {
303  returnval = StdRegions::eBackwards;
304  }
305  // Not forward either, then we have a problem.
306  else if ((*edge1.GetVertex(1) != *edge2.GetVertex(0)) &&
307  (*edge1.GetVertex(1) != *edge2.GetVertex(1)))
308  {
309  std::ostringstream errstrm;
310  errstrm << "Connected edges do not share a vertex. Edges ";
311  errstrm << edge1.GetEid() << ", " << edge2.GetEid();
312  ASSERTL0(false, errstrm.str());
313  }
314 
315  return returnval;
316  }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
StdRegions::StdExpansion1DSharedPtr Nektar::SpatialDomains::SegGeom::operator[] ( const int  i) const
void Nektar::SpatialDomains::SegGeom::SetUpXmap ( )
private

Definition at line 151 of file SegGeom.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eModified_A, m_curve, Nektar::SpatialDomains::Geometry::m_xmap, and npts.

Referenced by SegGeom(), and v_Reset().

152  {
153  if (m_curve)
154  {
155  int npts = m_curve->m_points.size();
156  LibUtilities::PointsKey pkey(npts+1,LibUtilities::eGaussLobattoLegendre);
157  const LibUtilities::BasisKey B(LibUtilities::eModified_A, npts, pkey);
159  }
160  else
161  {
162  const LibUtilities::BasisKey B(
164  LibUtilities::PointsKey(3, LibUtilities::eGaussLobattoLegendre));
166  }
167  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
Principle Modified Functions .
Definition: BasisType.h:49
static std::string npts
Definition: InputFld.cpp:43
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:50
void Nektar::SpatialDomains::SegGeom::v_AddElmtConnected ( int  gvo_id,
int  locid 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 249 of file SegGeom.cpp.

References m_elmtMap.

250  {
251  CompToElmt ee(gvo_id,locid);
252  m_elmtMap.push_back(ee);
253  }
std::list< CompToElmt > m_elmtMap
Definition: SegGeom.h:103
bool Nektar::SpatialDomains::SegGeom::v_ContainsPoint ( const Array< OneD, const NekDouble > &  gloCoord,
NekDouble  tol = 0.0 
)
protectedvirtual

Determines if a point specified in global coordinates is located within this tetrahedral geometry.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 460 of file SegGeom.cpp.

References Nektar::SpatialDomains::Geometry::GetCoordim().

Referenced by v_ContainsPoint().

462  {
463  Array<OneD,NekDouble> locCoord(GetCoordim(),0.0);
464  return v_ContainsPoint(gloCoord,locCoord,tol);
465 
466  }
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Determines if a point specified in global coordinates is located within this tetrahedral geometry...
Definition: SegGeom.cpp:460
bool Nektar::SpatialDomains::SegGeom::v_ContainsPoint ( const Array< OneD, const NekDouble > &  gloCoord,
Array< OneD, NekDouble > &  locCoord,
NekDouble  tol 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 468 of file SegGeom.cpp.

References v_ContainsPoint().

472  {
473  NekDouble resid;
474  return v_ContainsPoint(gloCoord,stdCoord,tol,resid);
475  }
double NekDouble
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Determines if a point specified in global coordinates is located within this tetrahedral geometry...
Definition: SegGeom.cpp:460
bool Nektar::SpatialDomains::SegGeom::v_ContainsPoint ( const Array< OneD, const NekDouble > &  gloCoord,
Array< OneD, NekDouble > &  locCoord,
NekDouble  tol,
NekDouble resid 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 477 of file SegGeom.cpp.

References Nektar::SpatialDomains::Geometry::GetLocCoords().

482  {
483  resid = GetLocCoords(gloCoord, stdCoord);
484  if (stdCoord[0] >= -(1+tol) && stdCoord[0] <= 1+tol)
485  {
486  return true;
487  }
488  return false;
489  }
NekDouble GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Definition: Geometry.h:450
LibUtilities::ShapeType Nektar::SpatialDomains::SegGeom::v_DetShapeType ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 551 of file SegGeom.cpp.

References Nektar::LibUtilities::eSegment.

void Nektar::SpatialDomains::SegGeom::v_FillGeom ( )
protectedvirtual

put all quadrature information into edge structure and backward transform

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 341 of file SegGeom.cpp.

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::SpatialDomains::ePtsFilled, ErrorUtil::ewarning, Nektar::eWrapper, Nektar::NekVector< DataType >::GetPtr(), Nektar::NekConstants::kVertexTheSameDouble, Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, m_curve, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_state, m_verts, Nektar::SpatialDomains::Geometry::m_xmap, NEKERROR, npts, and Nektar::LibUtilities::PointsManager().

Referenced by v_GenGeomFactors(), and v_GetLocCoords().

342  {
343  if(m_state != ePtsFilled)
344  {
345  int i;
346 
347  if (m_coordim > 0 && m_curve)
348  {
349  int npts = m_curve->m_points.size();
350  LibUtilities::PointsKey pkey(npts+1,LibUtilities::eGaussLobattoLegendre);
351  Array<OneD,NekDouble> tmp(npts);
352 
353  if(m_verts[0]->dist(*(m_curve->m_points[0])) > NekConstants::kVertexTheSameDouble)
354  {
355  std::string err = "Vertex 0 is separated from first point by more than ";
356  std::stringstream strstrm;
358  << " in edge " << m_globalID;
359  err += strstrm.str();
360  NEKERROR(ErrorUtil::ewarning, err.c_str());
361  }
362 
363  if(m_verts[1]->dist(*(m_curve->m_points[npts-1])) > NekConstants::kVertexTheSameDouble)
364  {
365  std::string err = "Vertex 1 is separated from last point by more than ";
366  std::stringstream strstrm;
368  << " in edge " << m_globalID;
369  err += strstrm.str();
370  NEKERROR(ErrorUtil::ewarning, err.c_str());
371  }
372 
373  LibUtilities::PointsKey fkey(npts,m_curve->m_ptype);
374  DNekMatSharedPtr I0 =
375  LibUtilities::PointsManager()[fkey]->GetI(pkey);
376  NekVector<NekDouble> out(npts+1);
377 
378  for(int i = 0; i < m_coordim; ++i)
379  {
380  // Load up coordinate values into tmp
381  for(int j = 0; j < npts; ++j)
382  {
383  tmp[j] = (m_curve->m_points[j]->GetPtr())[i];
384  }
385 
386  // Interpolate to GLL points
387  NekVector<NekDouble> in (npts, tmp, eWrapper);
388  out = (*I0)*in;
389 
390  m_xmap->FwdTrans(out.GetPtr(), m_coeffs[i]);
391  }
392  }
393 
394  for (i = 0; i < m_coordim; ++i)
395  {
396  m_coeffs[i][0] = (*m_verts[0])[i];
397  m_coeffs[i][1] = (*m_verts[1])[i];
398  }
399 
401  }
402  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:158
static const NekDouble kVertexTheSameDouble
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
static std::string npts
Definition: InputFld.cpp:43
PointsManagerT & PointsManager(void)
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
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
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:50
void Nektar::SpatialDomains::SegGeom::v_GenGeomFactors ( )
protectedvirtual

Set up GeoFac for this geometry using Coord quadrature distribution.

Implements Nektar::SpatialDomains::Geometry.

Definition at line 319 of file SegGeom.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().

Referenced by GenerateOneSpaceDimGeom().

320  {
322  {
324 
326 
327  if(m_xmap->GetBasisNumModes(0)!=2)
328  {
329  gType = eDeformed;
330  }
331 
333  gType, m_coordim, m_xmap, m_coeffs);
335  }
336  }
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
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Definition: Geometry.h:180
Geometry is straight-sided with constant geometric factors.
virtual void v_FillGeom()
put all quadrature information into edge structure and backward transform
Definition: SegGeom.cpp:341
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::SegGeom::v_GetBasis ( const int  i)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 520 of file SegGeom.cpp.

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

521  {
522  return m_xmap->GetBasis(i);
523  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
NekDouble Nektar::SpatialDomains::SegGeom::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 236 of file SegGeom.cpp.

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

239  {
241  "Geometry is not in physical space");
242 
243  Array<OneD, NekDouble> tmp(m_xmap->GetTotPoints());
244  m_xmap->BwdTrans(m_coeffs[i], tmp);
245 
246  return m_xmap->PhysEvaluate(Lcoord, tmp);
247  }
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
int Nektar::SpatialDomains::SegGeom::v_GetEid ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 509 of file SegGeom.cpp.

References m_eid.

510  {
511  return m_eid;
512  }
NekDouble Nektar::SpatialDomains::SegGeom::v_GetLocCoords ( const Array< OneD, const NekDouble > &  coords,
Array< OneD, NekDouble > &  Lcoords 
)
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 419 of file SegGeom.cpp.

References ErrorUtil::efatal, Nektar::SpatialDomains::eRegular, Nektar::SpatialDomains::Geometry::GetMetricInfo(), Nektar::SpatialDomains::Geometry::m_coeffs, Nektar::SpatialDomains::Geometry::m_coordim, Nektar::SpatialDomains::Geometry::m_xmap, NEKERROR, npts, and v_FillGeom().

422  {
423  int i;
424  NekDouble resid = 0.0;
426 
427  // calculate local coordinate for coord
428  if(GetMetricInfo()->GetGtype() == eRegular)
429  {
430  NekDouble len = 0.0;
431  NekDouble xi = 0.0;
432 
433  const int npts = m_xmap->GetTotPoints();
434  Array<OneD, NekDouble> pts(npts);
435 
436  for(i = 0; i < m_coordim; ++i)
437  {
438  m_xmap->BwdTrans(m_coeffs[i], pts);
439  len += (pts[npts-1]-pts[0])*(pts[npts-1]-pts[0]);
440  xi += (coords[i]-pts[0])*(coords[i]-pts[0]);
441  }
442 
443  len = sqrt(len);
444  xi = sqrt(xi);
445 
446  Lcoords[0] = 2*xi/len-1.0;
447  }
448  else
449  {
451  "inverse mapping must be set up to use this call");
452  }
453  return resid;
454  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
Definition: ErrorUtil.hpp:158
static std::string npts
Definition: InputFld.cpp:43
double NekDouble
Array< OneD, Array< OneD, NekDouble > > m_coeffs
Definition: Geometry.h:180
Geometry is straight-sided with constant geometric factors.
virtual void v_FillGeom()
put all quadrature information into edge structure and backward transform
Definition: SegGeom.cpp:341
GeomFactorsSharedPtr GetMetricInfo()
Definition: Geometry.h:299
int m_coordim
coordinate dimension
Definition: Geometry.h:169
int Nektar::SpatialDomains::SegGeom::v_GetNumEdges ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 561 of file SegGeom.cpp.

References kNedges.

562  {
563  return kNedges;
564  }
static const int kNedges
Definition: SegGeom.h:99
int Nektar::SpatialDomains::SegGeom::v_GetNumVerts ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 556 of file SegGeom.cpp.

References kNverts.

557  {
558  return kNverts;
559  }
static const int kNverts
Definition: SegGeom.h:98
StdRegions::Orientation Nektar::SpatialDomains::SegGeom::v_GetPorient ( const int  i) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 535 of file SegGeom.cpp.

References ASSERTL2, Nektar::StdRegions::eBwd, and Nektar::StdRegions::eFwd.

536  {
537  //cout << "StdRegions::PointOrientation GetPorient"<<endl;
538  ASSERTL2((i >=0) && (i <= 1),"Point id must be between 0 and 1");
539 
540  if (i % 2 == 0)
541  {
542  return StdRegions::eBwd;
543  }
544  else
545  {
546  return StdRegions::eFwd;
547  }
548  }
#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::SegGeom::v_GetShapeDim ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 515 of file SegGeom.cpp.

516  {
517  return 1;
518  }
PointGeomSharedPtr Nektar::SpatialDomains::SegGeom::v_GetVertex ( const int  i) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 497 of file SegGeom.cpp.

References kNverts, and m_verts.

498  {
499  PointGeomSharedPtr returnval;
500 
501  if (i >= 0 && i < kNverts)
502  {
503  returnval = m_verts[i];
504  }
505 
506  return returnval;
507  }
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
static const int kNverts
Definition: SegGeom.h:98
int Nektar::SpatialDomains::SegGeom::v_GetVid ( int  i) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry1D.

Definition at line 491 of file SegGeom.cpp.

References ASSERTL2, and m_verts.

492  {
493  ASSERTL2((i >=0) && (i <= 1),"Verted id must be between 0 and 1");
494  return m_verts[i]->GetVid();
495  }
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
#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::StdExpansionSharedPtr Nektar::SpatialDomains::SegGeom::v_GetXmap ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 525 of file SegGeom.cpp.

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

526  {
527  return m_xmap;
528  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
bool Nektar::SpatialDomains::SegGeom::v_IsElmtConnected ( int  gvoId,
int  locId 
) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 260 of file SegGeom.cpp.

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

261  {
262  std::list<CompToElmt>::const_iterator def;
263  CompToElmt ee(gvo_id,locid);
264 
265  def = find(m_elmtMap.begin(),m_elmtMap.end(),ee);
266 
267  // Found the element connectivity object in the list
268  if(def != m_elmtMap.end())
269  {
270  return(true);
271  }
272 
273  return(false);
274  }
std::list< CompToElmt > m_elmtMap
Definition: SegGeom.h:103
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:315
int Nektar::SpatialDomains::SegGeom::v_NumElmtConnected ( ) const
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 255 of file SegGeom.cpp.

References m_elmtMap.

256  {
257  return int(m_elmtMap.size());
258  }
std::list< CompToElmt > m_elmtMap
Definition: SegGeom.h:103
void Nektar::SpatialDomains::SegGeom::v_Reset ( CurveMap curvedEdges,
CurveMap curvedFaces 
)
protectedvirtual

Reset this geometry object: unset the current state and remove allocated GeomFactors.

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 404 of file SegGeom.cpp.

References Nektar::iterator, m_curve, Nektar::SpatialDomains::Geometry::m_globalID, Nektar::SpatialDomains::Geometry::m_xmap, Nektar::SpatialDomains::Geometry::SetUpCoeffs(), SetUpXmap(), and Nektar::SpatialDomains::Geometry::v_Reset().

406  {
407  Geometry::v_Reset(curvedEdges, curvedFaces);
408  CurveMap::iterator it = curvedEdges.find(m_globalID);
409 
410  if (it != curvedEdges.end())
411  {
412  m_curve = it->second;
413  }
414 
415  SetUpXmap();
416  SetUpCoeffs(m_xmap->GetNcoeffs());
417  }
StdRegions::StdExpansionSharedPtr m_xmap
Definition: Geometry.h:172
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state and remove allocated GeomFactors.
Definition: Geometry.cpp:307
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
void SetUpCoeffs(const int nCoeffs)
Initialise the m_coeffs array.
Definition: Geometry.h:484
void Nektar::SpatialDomains::SegGeom::v_SetOwnData ( )
protectedvirtual

Reimplemented from Nektar::SpatialDomains::Geometry.

Definition at line 530 of file SegGeom.cpp.

References m_ownData.

531  {
532  m_ownData = true;
533  }
bool m_ownData
Boolean indicating whether object owns the data.
Definition: SegGeom.h:175

Member Data Documentation

const int Nektar::SpatialDomains::SegGeom::kNedges = 1
static

Definition at line 99 of file SegGeom.h.

Referenced by v_GetNumEdges().

const int Nektar::SpatialDomains::SegGeom::kNverts = 2
static

Definition at line 98 of file SegGeom.h.

Referenced by v_GetNumVerts(), and v_GetVertex().

CurveSharedPtr Nektar::SpatialDomains::SegGeom::m_curve
private

Definition at line 176 of file SegGeom.h.

Referenced by SegGeom(), SetUpXmap(), v_FillGeom(), and v_Reset().

int Nektar::SpatialDomains::SegGeom::m_eid
protected

Definition at line 102 of file SegGeom.h.

Referenced by GenerateOneSpaceDimGeom(), SegGeom(), and v_GetEid().

std::list<CompToElmt> Nektar::SpatialDomains::SegGeom::m_elmtMap
protected
bool Nektar::SpatialDomains::SegGeom::m_ownData
private

Boolean indicating whether object owns the data.

Definition at line 175 of file SegGeom.h.

Referenced by v_SetOwnData().

StdRegions::Orientation Nektar::SpatialDomains::SegGeom::m_porient[kNverts]
protected

Definition at line 105 of file SegGeom.h.

SpatialDomains::PointGeomSharedPtr Nektar::SpatialDomains::SegGeom::m_verts[kNverts]
protected

Definition at line 104 of file SegGeom.h.

Referenced by GenerateOneSpaceDimGeom(), SegGeom(), v_FillGeom(), v_GetVertex(), and v_GetVid().