use CreateMPfromKwargs for mesh.GenerateVolumeMesh as well

This commit is contained in:
Christopher Lackner 2019-07-26 17:07:30 +02:00
parent da82b72df6
commit a989babd21
2 changed files with 5 additions and 12 deletions

View File

@ -857,24 +857,17 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
self.SetMaxHDomain(maxh);
})
.def ("GenerateVolumeMesh",
[](Mesh & self, py::object pymp)
[](Mesh & self, py::kwargs kwargs)
{
cout << "generate vol mesh" << endl;
MeshingParameters mp;
{
py::gil_scoped_acquire acquire;
if (py::extract<MeshingParameters>(pymp).check())
mp = py::extract<MeshingParameters>(pymp)();
else
{
mp.optsteps3d = 5;
}
mp = CreateMPfromKwargs(kwargs);
}
MeshVolume (mp, self);
OptimizeVolume (mp, self);
},
py::arg("mp")=NGDummyArgument(),py::call_guard<py::gil_scoped_release>())
}, meshingparameter_description.c_str(),
py::call_guard<py::gil_scoped_release>())
.def ("OptimizeVolumeMesh", [](Mesh & self)
{

View File

@ -52,7 +52,7 @@ def test_pickle_occ():
except:
import pytest
pytest.skip("can't import occ")
geo = OCCGeometry("../../tutorials/frame.step")
geo = occ.OCCGeometry("../../tutorials/frame.step")
geo_dump = pickle.dumps(geo)
geo2 = pickle.loads(geo_dump)
vd1 = geo._visualizationData()