diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 1dbd1b2d..c344d65a 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -5595,6 +5595,10 @@ namespace netgen if ( !bcnames.Size() ) return defaultstring; + + if (bcnr < 0 || bcnr >= bcnames.Size()) + throw NgException ("illegal bc-number"); + if ( bcnames[bcnr] ) return *bcnames[bcnr]; else diff --git a/libsrc/meshing/python_mesh.cpp b/libsrc/meshing/python_mesh.cpp index 11c82c2b..e27d3433 100644 --- a/libsrc/meshing/python_mesh.cpp +++ b/libsrc/meshing/python_mesh.cpp @@ -317,7 +317,12 @@ DLL_HEADER void ExportNetgenMeshing() })) .def ("SetBCName", &Mesh::SetBCName) - + .def ("GetBCName", FunctionPointer([](Mesh & self, int bc)->string + { return self.GetBCName(bc); })) + .def ("SetMaterial", &Mesh::SetMaterial) + .def ("GetMaterial", FunctionPointer([](Mesh & self, int domnr) + { return string(self.GetMaterial(domnr)); })) + .def ("GenerateVolumeMesh", FunctionPointer ([](Mesh & self) {