From d482566caa1feaaaa3db42fa6087234e893d7fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20S=C3=A9guin-C?= Date: Fri, 18 Jan 2019 18:02:41 -0500 Subject: [PATCH] Allow modification to minh from Python --- libsrc/meshing/meshtype.cpp | 1 + libsrc/meshing/python_mesh.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/meshtype.cpp b/libsrc/meshing/meshtype.cpp index baed182e..990c4112 100644 --- a/libsrc/meshing/meshtype.cpp +++ b/libsrc/meshing/meshtype.cpp @@ -2706,6 +2706,7 @@ namespace netgen << " grading = " << grading << endl << " delaunay = " << delaunay << endl << " maxh = " << maxh << endl + << " minh = " << minh << endl << " meshsizefilename = " << meshsizefilename << endl << " startinsurface = " << startinsurface << endl << " checkoverlap = " << checkoverlap << endl diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index d349dfcf..4f1cc2ef 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -846,12 +846,13 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) typedef MeshingParameters MP; py::class_ (m, "MeshingParameters") .def(py::init<>()) - .def(py::init([](double maxh, bool quad_dominated, int optsteps2d, int optsteps3d, + .def(py::init([](double maxh, double minh, bool quad_dominated, int optsteps2d, int optsteps3d, MESHING_STEP perfstepsend, int only3D_domain, const string & meshsizefilename, double grading, double curvaturesafety, double segmentsperedge) { MP * instance = new MeshingParameters; instance->maxh = maxh; + instance->minh = minh; instance->quad = int(quad_dominated); instance->optsteps2d = optsteps2d; instance->optsteps3d = optsteps3d; @@ -865,6 +866,7 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) return instance; }), py::arg("maxh")=1000, + py::arg("minh")=0, py::arg("quad_dominated")=false, py::arg("optsteps2d") = 3, py::arg("optsteps3d") = 3, @@ -880,6 +882,9 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m) .def_property("maxh", FunctionPointer ([](const MP & mp ) { return mp.maxh; }), FunctionPointer ([](MP & mp, double maxh) { return mp.maxh = maxh; })) + .def_property("minh", + FunctionPointer ([](const MP & mp ) { return mp.minh; }), + FunctionPointer ([](MP & mp, double minh) { return mp.minh = minh; })) .def("RestrictH", FunctionPointer ([](MP & mp, double x, double y, double z, double h) {