FaceDescriptor array to Python

This commit is contained in:
Joachim Schoeberl 2021-09-10 12:42:41 +02:00
parent 94ee2b67ad
commit 781ea7103e
2 changed files with 15 additions and 4 deletions

View File

@ -81,7 +81,7 @@ namespace netgen
the face-index of the surface element maps into the face-index of the surface element maps into
this table. this table.
*/ */
NgArray<FaceDescriptor> facedecoding; Array<FaceDescriptor> facedecoding;
/** /**
@ -712,15 +712,19 @@ namespace netgen
{ return facedecoding.Size(); } { return facedecoding.Size(); }
const FaceDescriptor & GetFaceDescriptor (int i) const const FaceDescriptor & GetFaceDescriptor (int i) const
{ return facedecoding.Get(i); } { return facedecoding[i-1]; }
// { return facedecoding.Get(i); }
auto & FaceDescriptors () const { return facedecoding; }
const EdgeDescriptor & GetEdgeDescriptor (int i) const const EdgeDescriptor & GetEdgeDescriptor (int i) const
{ return edgedecoding[i]; } { return edgedecoding[i]; }
/// ///
FaceDescriptor & GetFaceDescriptor (int i) FaceDescriptor & GetFaceDescriptor (int i)
{ return facedecoding.Elem(i); } { return facedecoding[i-1]; }
// { return facedecoding.Elem(i); }
int IdentifyPeriodicBoundaries(const string& s1, int IdentifyPeriodicBoundaries(const string& s1,
const string& s2, const string& s2,

View File

@ -848,6 +848,13 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
.def("FaceDescriptor", static_cast<FaceDescriptor&(Mesh::*)(int)> (&Mesh::GetFaceDescriptor), .def("FaceDescriptor", static_cast<FaceDescriptor&(Mesh::*)(int)> (&Mesh::GetFaceDescriptor),
py::return_value_policy::reference) py::return_value_policy::reference)
.def("GetNFaceDescriptors", &Mesh::GetNFD) .def("GetNFaceDescriptors", &Mesh::GetNFD)
.def("FaceDescriptors",
// static_cast<Array<Element>&(Mesh::*)()> (&Mesh::FaceDescriptors),
&Mesh::FaceDescriptors,
py::return_value_policy::reference)
.def("GetNDomains", &Mesh::GetNDomains) .def("GetNDomains", &Mesh::GetNDomains)
.def("GetVolumeNeighboursOfSurfaceElement", [](Mesh & self, size_t sel) .def("GetVolumeNeighboursOfSurfaceElement", [](Mesh & self, size_t sel)