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 py::class_<Geometry, std::shared_ptr<Geometry>, boost::noncopyable>(
58 "Geometry", py::no_init)
59
60 .def("GetCoordim", &Geometry::GetCoordim)
61 .def("GetGlobalID", &Geometry::GetGlobalID)
62 .def("SetGlobalID", &Geometry::SetGlobalID)
63
64 .def("Setup", &Geometry::Setup)
65 .def("FillGeom", &Geometry::FillGeom)
66 .def("GenGeomFactors", &Geometry_GenGeomFactors)
67
68 .def("ContainsPoint", &Geometry_ContainsPoint)
69
70 .def("GetVertex", &Geometry::GetVertex)
71 .def("GetEdge", &Geometry::GetEdge)
72 .def("GetFace", &Geometry::GetFace)
73 .def("GetVid", &Geometry::GetVid)
74 .def("GetEid", &Geometry::GetEid)
75 .def("GetFid", &Geometry::GetFid)
76 .def("GetTid", &Geometry::GetTid)
77
78 .def("GetNumVerts", &Geometry::GetNumVerts)
79 .def("GetNumEdges", &Geometry::GetNumEdges)
80 .def("GetNumFaces", &Geometry::GetNumFaces)
81 .def("GetShapeDim", &Geometry::GetShapeDim)
82 .def("GetShapeType", &Geometry::GetShapeType)
83 .def("GetEorient", &Geometry::GetEorient)
84 .def("GetForient", &Geometry::GetForient)
85
86 .def("GetXmap", &Geometry::GetXmap)
87 .def("GetCoeffs", &Geometry::GetCoeffs,
88 py::return_value_policy<py::copy_const_reference>());
89}
void export_Geometry()
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