Nektar++
Python/Geometry.cpp
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: Geometry.cpp
4 //
5 // For more information, please see: http://www.nektar.info/
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Python wrapper for Geometry.
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
39 
40 using namespace Nektar;
41 using namespace Nektar::SpatialDomains;
42 
43 // Thin wrapper for ContainsPoint
45  const Array<OneD, const NekDouble>& gloCoord)
46 {
47  return geom->ContainsPoint(gloCoord);
48 }
49 
51 {
52  GeomFactorsSharedPtr geomFactors = geom->GetGeomFactors();
53 }
54 
56 {
57  py::class_<Geometry,
58  std::shared_ptr<Geometry>,
59  boost::noncopyable>(
60  "Geometry", py::no_init)
61 
62  .def("GetCoordim", &Geometry::GetCoordim)
63  .def("GetGlobalID", &Geometry::GetGlobalID)
64 
65  .def("Setup", &Geometry::Setup)
66  .def("FillGeom", &Geometry::FillGeom)
67  .def("GenGeomFactors", &Geometry_GenGeomFactors)
68 
69  .def("ContainsPoint", &Geometry_ContainsPoint)
70 
71  .def("GetVertex", &Geometry::GetVertex)
72  .def("GetEdge", &Geometry::GetEdge)
73  .def("GetFace", &Geometry::GetFace)
74  .def("GetVid", &Geometry::GetVid)
75  .def("GetEid", &Geometry::GetEid)
76  .def("GetFid", &Geometry::GetFid)
77  .def("GetTid", &Geometry::GetTid)
78 
79  .def("GetNumVerts", &Geometry::GetNumVerts)
80  .def("GetNumEdges", &Geometry::GetNumEdges)
81  .def("GetNumFaces", &Geometry::GetNumFaces)
82  .def("GetShapeDim", &Geometry::GetShapeDim)
83  .def("GetShapeType", &Geometry::GetShapeType)
84  .def("GetEorient", &Geometry::GetEorient)
85  .def("GetForient", &Geometry::GetForient)
86 
87  .def("GetXmap", &Geometry::GetXmap)
88  .def("GetCoeffs", &Geometry::GetCoeffs,
89  py::return_value_policy<py::copy_const_reference>())
90  ;
91 }
void export_Geometry()
void Geometry_GenGeomFactors(GeometrySharedPtr geom)
bool Geometry_ContainsPoint(GeometrySharedPtr geom, const Array< OneD, const NekDouble > &gloCoord)
Base class for shape geometry information.
Definition: Geometry.h:84
LibUtilities::ShapeType GetShapeType(void)
Get the geometric shape type of this object.
Definition: Geometry.h:311
PointGeomSharedPtr GetVertex(int i) const
Returns vertex i of this object.
Definition: Geometry.h:348
Geometry1DSharedPtr GetEdge(int i) const
Returns edge i of this object.
Definition: Geometry.h:356
int GetNumFaces() const
Get the number of faces of this object.
Definition: Geometry.h:406
int GetShapeDim() const
Get the object's shape dimension.
Definition: Geometry.h:417
int GetVid(int i) const
Get the ID of vertex i of this object.
Definition: Geometry.cpp:137
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:435
int GetGlobalID(void) const
Get the ID of this object.
Definition: Geometry.h:319
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition: Geometry.h:276
int GetFid(int i) const
Get the ID of face i of this object.
Definition: Geometry.cpp:153
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition: Geometry.h:447
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition: Geometry.h:426
int GetNumEdges() const
Get the number of edges of this object.
Definition: Geometry.h:398
int GetNumVerts() const
Get the number of vertices of this object.
Definition: Geometry.h:390
Geometry2DSharedPtr GetFace(int i) const
Returns face i of this object.
Definition: Geometry.h:364
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:373
int GetTid(int i) const
Get the ID of trace i of this object.
Definition: Geometry.h:338
int GetEid(int i) const
Get the ID of edge i of this object.
Definition: Geometry.cpp:145
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:382
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
std::shared_ptr< Geometry > GeometrySharedPtr
Definition: Geometry.h:53
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1