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); self.SetMaxHDomain(maxh);
}) })
.def ("GenerateVolumeMesh", .def ("GenerateVolumeMesh",
[](Mesh & self, py::object pymp) [](Mesh & self, py::kwargs kwargs)
{ {
cout << "generate vol mesh" << endl;
MeshingParameters mp; MeshingParameters mp;
{ {
py::gil_scoped_acquire acquire; py::gil_scoped_acquire acquire;
if (py::extract<MeshingParameters>(pymp).check()) mp = CreateMPfromKwargs(kwargs);
mp = py::extract<MeshingParameters>(pymp)();
else
{
mp.optsteps3d = 5;
}
} }
MeshVolume (mp, self); MeshVolume (mp, self);
OptimizeVolume (mp, self); OptimizeVolume (mp, self);
}, }, meshingparameter_description.c_str(),
py::arg("mp")=NGDummyArgument(),py::call_guard<py::gil_scoped_release>()) py::call_guard<py::gil_scoped_release>())
.def ("OptimizeVolumeMesh", [](Mesh & self) .def ("OptimizeVolumeMesh", [](Mesh & self)
{ {

View File

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