Merge branch 'py_export_localh' into 'master'

export localh set/get from mesh

See merge request ngsolve/netgen!651
This commit is contained in:
Schöberl, Joachim 2024-05-24 08:44:51 +02:00
commit 9ca061eae5

View File

@ -88,6 +88,8 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
.def("__bool__", []( NGDummyArgument &self ) { return false; } ) .def("__bool__", []( NGDummyArgument &self ) { return false; } )
; ;
py::class_<LocalH, shared_ptr<LocalH>>(m, "LocalH");
py::class_<Point<2>> (m, "Point2d") py::class_<Point<2>> (m, "Point2d")
.def(py::init<double,double>()) .def(py::init<double,double>())
.def(py::init( [] (std::pair<double,double> xy) .def(py::init( [] (std::pair<double,double> xy)
@ -1249,7 +1251,11 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
else mp.optsteps3d = 5; else mp.optsteps3d = 5;
OptimizeVolume (mp, self); OptimizeVolume (mp, self);
}, py::arg("mp"), py::call_guard<py::gil_scoped_release>()) }, py::arg("mp"), py::call_guard<py::gil_scoped_release>())
.def("SetLocalH",[](Mesh& self, shared_ptr<LocalH> localh, int layer)
{
self.SetLocalH(localh, layer);
}, py::arg("localh"), py::arg("layer")=1)
.def("GetLocalH", &Mesh::GetLocalH)
.def ("OptimizeMesh2d", [](Mesh & self, MeshingParameters* pars, int faceindex) .def ("OptimizeMesh2d", [](Mesh & self, MeshingParameters* pars, int faceindex)
{ {
self.CalcLocalH(0.5); self.CalcLocalH(0.5);