Nektar++
Loading...
Searching...
No Matches
Functions
Geometry.cpp File Reference
#include <SpatialDomains/Geometry.h>
#include <SpatialDomains/Geometry1D.h>
#include <SpatialDomains/Geometry2D.h>
#include <LibUtilities/Python/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Python/NekPyConfig.hpp>
#include <SpatialDomains/Python/SpatialDomains.h>

Go to the source code of this file.

Functions

bool Geometry_ContainsPoint (Geometry *geom, const Array< OneD, const NekDouble > &gloCoord)
 
void Geometry_GenGeomFactors (Geometry *geom)
 
bool Geometry_IsValid (Geometry *geom)
 
void export_Geometry (py::module &m)
 

Function Documentation

◆ export_Geometry()

void export_Geometry ( py::module &  m)

Definition at line 68 of file Python/Geometry.cpp.

69{
70 py::classh<Geometry>(m, "Geometry")
71 .def("GetCoordim", &Geometry::GetCoordim)
72 .def("GetGlobalID", &Geometry::GetGlobalID)
73 .def("SetGlobalID", &Geometry::SetGlobalID)
74
75 .def("Setup", &Geometry::Setup)
76 .def("FillGeom", &Geometry::FillGeom)
77 .def("GenGeomFactors", &Geometry_GenGeomFactors)
78 .def("IsValid", &Geometry_IsValid)
79
80 .def("ContainsPoint", &Geometry_ContainsPoint)
81
82 .def("GetVertex", &Geometry::GetVertex,
83 py::return_value_policy::reference)
84 .def("GetEdge", &Geometry::GetEdge, py::return_value_policy::reference)
85 .def("GetFace", &Geometry::GetFace, py::return_value_policy::reference)
86 .def("GetVid", &Geometry::GetVid)
87 .def("GetEid", &Geometry::GetEid)
88 .def("GetFid", &Geometry::GetFid)
89 .def("GetTid", &Geometry::GetTid)
90
91 .def("GetNumVerts", &Geometry::GetNumVerts)
92 .def("GetNumEdges", &Geometry::GetNumEdges)
93 .def("GetNumFaces", &Geometry::GetNumFaces)
94 .def("GetShapeDim", &Geometry::GetShapeDim)
95 .def("GetShapeType", &Geometry::GetShapeType)
96 .def("GetEorient", &Geometry::GetEorient)
97 .def("GetForient", &Geometry::GetForient)
98
99 .def("GetXmap", &Geometry::GetXmap)
100 .def("GetCoeffs", &Geometry::GetCoeffs);
101}
bool Geometry_ContainsPoint(Geometry *geom, const Array< OneD, const NekDouble > &gloCoord)
void Geometry_GenGeomFactors(Geometry *geom)
bool Geometry_IsValid(Geometry *geom)
LibUtilities::ShapeType GetShapeType(void)
Get the geometric shape type of this object.
Definition Geometry.h:294
void SetGlobalID(int globalid)
Set the ID of this object.
Definition Geometry.h:322
int GetNumFaces() const
Get the number of faces of this object.
Definition Geometry.h:411
int GetShapeDim() const
Get the object's shape dimension.
Definition Geometry.h:422
int GetVid(int i) const
Returns global id of vertex i of this object.
Definition Geometry.h:345
const Array< OneD, const NekDouble > & GetCoeffs(const int i) const
Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i.
Definition Geometry.h:449
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:314
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
Definition Geometry.h:353
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition Geometry.h:277
int GetFid(int i) const
Get the ID of face i of this object.
Definition Geometry.cpp:91
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition Geometry.h:461
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition Geometry.h:440
int GetNumEdges() const
Get the number of edges of this object.
Definition Geometry.h:403
int GetNumVerts() const
Get the number of vertices of this object.
Definition Geometry.h:395
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
Definition Geometry.h:361
Geometry2D * GetFace(int i) const
Returns face i of this object.
Definition Geometry.h:369
StdRegions::Orientation GetEorient(const int i) const
Returns the orientation of edge i with respect to the ordering of edges in the standard element.
Definition Geometry.h:378
int GetTid(int i) const
Get the ID of trace i of this object.
Definition Geometry.h:333
int GetEid(int i) const
Get the ID of edge i of this object.
Definition Geometry.cpp:83
StdRegions::Orientation GetForient(const int i) const
Returns the orientation of face i with respect to the ordering of faces in the standard element.
Definition Geometry.h:387

References Nektar::SpatialDomains::Geometry::FillGeom(), Geometry_ContainsPoint(), Geometry_GenGeomFactors(), Geometry_IsValid(), Nektar::SpatialDomains::Geometry::GetCoeffs(), Nektar::SpatialDomains::Geometry::GetCoordim(), Nektar::SpatialDomains::Geometry::GetEdge(), Nektar::SpatialDomains::Geometry::GetEid(), Nektar::SpatialDomains::Geometry::GetEorient(), Nektar::SpatialDomains::Geometry::GetFace(), Nektar::SpatialDomains::Geometry::GetFid(), Nektar::SpatialDomains::Geometry::GetForient(), Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetNumEdges(), Nektar::SpatialDomains::Geometry::GetNumFaces(), Nektar::SpatialDomains::Geometry::GetNumVerts(), Nektar::SpatialDomains::Geometry::GetShapeDim(), Nektar::SpatialDomains::Geometry::GetShapeType(), Nektar::SpatialDomains::Geometry::GetTid(), Nektar::SpatialDomains::Geometry::GetVertex(), Nektar::SpatialDomains::Geometry::GetVid(), Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::SpatialDomains::Geometry::SetGlobalID(), and Nektar::SpatialDomains::Geometry::Setup().

Referenced by PYBIND11_MODULE().

◆ Geometry_ContainsPoint()

bool Geometry_ContainsPoint ( Geometry geom,
const Array< OneD, const NekDouble > &  gloCoord 
)

Definition at line 47 of file Python/Geometry.cpp.

49{
50 return geom->ContainsPoint(gloCoord);
51}
bool ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Determine whether an element contains a particular Cartesian coordinate .
Definition Geometry.h:472

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

Referenced by export_Geometry().

◆ Geometry_GenGeomFactors()

void Geometry_GenGeomFactors ( Geometry geom)

Definition at line 53 of file Python/Geometry.cpp.

54{
55 geom->Setup();
56 LibUtilities::PointsKeyVector p = geom->GetXmap()->GetPointsKeys();
57 GeomFactorsUniquePtr geomFactors = geom->GenGeomFactors(p);
58}
GeomFactorsUniquePtr GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt)
Used by Expansion to generate associated GeomFactors.
Definition Geometry.h:430
std::vector< PointsKey > PointsKeyVector
Definition Points.h:313
unique_ptr_objpool< GeomFactors > GeomFactorsUniquePtr
Definition Geometry.h:62
std::vector< double > p(NPUPPER)

References Nektar::SpatialDomains::Geometry::GenGeomFactors(), Nektar::SpatialDomains::Geometry::GetXmap(), and Nektar::SpatialDomains::Geometry::Setup().

Referenced by export_Geometry().

◆ Geometry_IsValid()

bool Geometry_IsValid ( Geometry geom)

Definition at line 60 of file Python/Geometry.cpp.

61{
62 geom->Setup();
63 LibUtilities::PointsKeyVector p = geom->GetXmap()->GetPointsKeys();
64 GeomFactorsUniquePtr geomFactors = geom->GenGeomFactors(p);
65 return geomFactors->IsValid();
66}

References Nektar::SpatialDomains::Geometry::GenGeomFactors(), Nektar::SpatialDomains::Geometry::GetXmap(), and Nektar::SpatialDomains::Geometry::Setup().

Referenced by export_Geometry().