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
40using namespace Nektar;
41using 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 GeomFactorsSharedPtr geomFactors = geom->GetGeomFactors();
58 return geomFactors->IsValid();
59}
60
62{
63 py::class_<Geometry, std::shared_ptr<Geometry>, boost::noncopyable>(
64 "Geometry", py::no_init)
65
66 .def("GetCoordim", &Geometry::GetCoordim)
67 .def("GetGlobalID", &Geometry::GetGlobalID)
68 .def("SetGlobalID", &Geometry::SetGlobalID)
69
70 .def("Setup", &Geometry::Setup)
71 .def("FillGeom", &Geometry::FillGeom)
72 .def("GenGeomFactors", &Geometry_GenGeomFactors)
73 .def("IsValid", &Geometry_IsValid)
74
75 .def("ContainsPoint", &Geometry_ContainsPoint)
76
77 .def("GetVertex", &Geometry::GetVertex)
78 .def("GetEdge", &Geometry::GetEdge)
79 .def("GetFace", &Geometry::GetFace)
80 .def("GetVid", &Geometry::GetVid)
81 .def("GetEid", &Geometry::GetEid)
82 .def("GetFid", &Geometry::GetFid)
83 .def("GetTid", &Geometry::GetTid)
84
85 .def("GetNumVerts", &Geometry::GetNumVerts)
86 .def("GetNumEdges", &Geometry::GetNumEdges)
87 .def("GetNumFaces", &Geometry::GetNumFaces)
88 .def("GetShapeDim", &Geometry::GetShapeDim)
89 .def("GetShapeType", &Geometry::GetShapeType)
90 .def("GetEorient", &Geometry::GetEorient)
91 .def("GetForient", &Geometry::GetForient)
92
93 .def("GetXmap", &Geometry::GetXmap)
94 .def("GetCoeffs", &Geometry::GetCoeffs,
95 py::return_value_policy<py::copy_const_reference>());
96}
void export_Geometry()
bool Geometry_IsValid(GeometrySharedPtr geom)
void Geometry_GenGeomFactors(GeometrySharedPtr geom)
bool Geometry_ContainsPoint(GeometrySharedPtr geom, const Array< OneD, const NekDouble > &gloCoord)
std::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:60
std::shared_ptr< Geometry > GeometrySharedPtr
Definition: Geometry.h:51