Merge branch 'derive_geos_netgengeometry' into 'master'

derive geometry class in python from NetgenGeometry, gil call guard

See merge request jschoeberl/netgen!82
This commit is contained in:
Joachim Schöberl 2018-04-18 22:00:03 +02:00
commit e72d90fcbb
5 changed files with 6 additions and 6 deletions

View File

@ -250,7 +250,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
//cout << i << " : " << self.splines[i]->GetPoint(0.1) << " , " << self.splines[i]->GetPoint(0.5) << endl;
}
}))
.def("GenerateMesh", FunctionPointer([](shared_ptr<SplineGeometry2d> self, MeshingParameters & mparam)
.def("GenerateMesh", [](shared_ptr<SplineGeometry2d> self, MeshingParameters & mparam)
{
shared_ptr<Mesh> mesh = make_shared<Mesh> ();
mesh->SetGeometry(self);
@ -258,7 +258,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
ng_geometry = self;
self->GenerateMesh(mesh, mparam);
return mesh;
}))
},py::call_guard<py::gil_scoped_release>())
;

View File

@ -449,7 +449,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
py::implicitly_convertible< int, PointIndex>();
py::class_<NetgenGeometry, shared_ptr<NetgenGeometry>> (m, "NetgenGeometry")
py::class_<NetgenGeometry, shared_ptr<NetgenGeometry>> (m, "NetgenGeometry", py::dynamic_attr())
;
py::class_<Mesh,shared_ptr<Mesh>>(m, "Mesh")

View File

@ -16,7 +16,7 @@ namespace netgen
DLL_HEADER void ExportNgOCC(py::module &m)
{
py::class_<OCCGeometry, shared_ptr<OCCGeometry>> (m, "OCCGeometry", R"raw_string(Use LoadOCCGeometry to load the geometry from a *.step file.)raw_string")
py::class_<OCCGeometry, shared_ptr<OCCGeometry>, NetgenGeometry> (m, "OCCGeometry", R"raw_string(Use LoadOCCGeometry to load the geometry from a *.step file.)raw_string")
.def(py::init<>())
.def("Heal",[](OCCGeometry & self, double tolerance, bool fixsmalledges, bool fixspotstripfaces, bool sewfaces, bool makesolids, bool splitpartitions)
{

View File

@ -18,7 +18,7 @@ namespace netgen
DLL_HEADER void ExportSTL(py::module & m)
{
py::class_<STLGeometry,shared_ptr<STLGeometry>> (m,"STLGeometry")
py::class_<STLGeometry,shared_ptr<STLGeometry>, NetgenGeometry> (m,"STLGeometry")
.def(py::init<>())
;
m.def("LoadSTLGeometry", FunctionPointer([] (const string & filename)

View File

@ -98,7 +98,7 @@ namespace netgen
class STLGeometry : public STLTopology, public NetgenGeometry
class STLGeometry : public NetgenGeometry, public STLTopology
{
// edges to be meshed:
Array<STLEdge> edges;