Merge branch 'export_parentelements_python' into 'master'

export parentelements to python

See merge request ngsolve/netgen!617
This commit is contained in:
Schöberl, Joachim 2023-11-28 21:55:32 +01:00
commit 6bd09ee05e

View File

@ -998,7 +998,13 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
{ sizeof(self.Points()[PointIndex::BASE]), sizeof(double) } )
);
})
.def_property_readonly("parentelements", [](Mesh & self) {
return FlatArray<int>(self.mlparentelement.Size(), &self.mlparentelement[0]);
}, py::keep_alive<0,1>())
.def_property_readonly("parentsurfaceelements", [](Mesh & self) {
return FlatArray<int>(self.mlparentsurfaceelement.Size(),
&self.mlparentsurfaceelement[0]);
}, py::keep_alive<0,1>())
.def("FaceDescriptor", static_cast<FaceDescriptor&(Mesh::*)(int)> (&Mesh::GetFaceDescriptor),
py::return_value_policy::reference)
.def("GetNFaceDescriptors", &Mesh::GetNFD)