48 template <
class T,
class S>
51 std::vector<std::shared_ptr<S>> geomVec;
53 for (
int i = 0; i < py::len(facets); ++i)
55 geomVec.push_back(
py::extract<std::shared_ptr<S>>(facets[i]));
58 return std::make_shared<T>(
id, &geomVec[0]);
63 py::class_<T, py::bases<PARENT>, std::shared_ptr<T>>(
name, py::init<>())
66 &Geometry_Init<T, S>, py::default_call_policies(),
67 (py::arg(
"id"), py::arg(
"segments") = py::list())));
73 std::vector<PointGeomSharedPtr> geomVec;
75 for (
int i = 0; i < py::len(points); ++i)
77 geomVec.push_back(py::extract<PointGeomSharedPtr>(points[i]));
82 return std::make_shared<SegGeom>(
id, coordim, &geomVec[0]);
86 return std::make_shared<SegGeom>(
id, coordim, &geomVec[0],
87 py::extract<CurveSharedPtr>(curve));
94 py::class_<Geometry1D, py::bases<Geometry>, std::shared_ptr<Geometry1D>,
95 boost::noncopyable>(
"Geometry1D", py::no_init);
96 py::class_<Geometry2D, py::bases<Geometry>, std::shared_ptr<Geometry2D>,
97 boost::noncopyable>(
"Geometry2D", py::no_init);
98 py::class_<Geometry3D, py::bases<Geometry>, std::shared_ptr<Geometry3D>,
99 boost::noncopyable>(
"Geometry3D", py::no_init);
102 py::class_<PointGeom, py::bases<Geometry>, std::shared_ptr<PointGeom>>(
103 "PointGeom", py::init<>())
104 .def(py::init<int, int, NekDouble, NekDouble, NekDouble>());
107 py::class_<SegGeom, py::bases<Geometry>, std::shared_ptr<SegGeom>>(
108 "SegGeom", py::init<>())
110 py::make_constructor(&
SegGeom_Init, py::default_call_policies(),
111 (py::arg(
"id"), py::arg(
"coordim"),
112 py::arg(
"points") = py::list(),
113 py::arg(
"curve") = py::object())))
116 export_Geom<TriGeom, SegGeom, Geometry2D>(
"TriGeom");
117 export_Geom<QuadGeom, SegGeom, Geometry2D>(
"QuadGeom");
118 export_Geom<TetGeom, TriGeom, Geometry3D>(
"TetGeom");
119 export_Geom<PrismGeom, Geometry2D, Geometry3D>(
"PrismGeom");
120 export_Geom<PyrGeom, Geometry2D, Geometry3D>(
"PyrGeom");
121 export_Geom<HexGeom, QuadGeom, Geometry3D>(
"HexGeom");
void export_GeomElements()
std::shared_ptr< T > Geometry_Init(int id, py::list &facets)
SegGeomSharedPtr SegGeom_Init(int id, int coordim, py::list &points, py::object &curve)
void export_Geom(const char *name)
CurveSharedPtr GetCurve()
def extract(self, check_equality=False)
std::shared_ptr< SegGeom > SegGeomSharedPtr
The above copyright notice and this permission notice shall be included.