diff --git a/libsrc/meshing/meshfunc.cpp b/libsrc/meshing/meshfunc.cpp index 667ac416..d942f111 100644 --- a/libsrc/meshing/meshfunc.cpp +++ b/libsrc/meshing/meshfunc.cpp @@ -586,6 +586,8 @@ namespace netgen auto md = DivideMesh(mesh3d, mp); + try + { ParallelFor( md.Range(), [&](int i) { if (mp.checkoverlappingboundary) @@ -597,6 +599,12 @@ namespace netgen CloseOpenQuads( md[i] ); MeshDomain(md[i]); }, md.Size()); + } + catch(...) + { + MergeMeshes(mesh3d, md); + return MESHING3_GIVEUP; + } MergeMeshes(mesh3d, md); diff --git a/libsrc/occ/python_occ.cpp b/libsrc/occ/python_occ.cpp index e0b67031..7a55fc13 100644 --- a/libsrc/occ/python_occ.cpp +++ b/libsrc/occ/python_occ.cpp @@ -26,6 +26,7 @@ using namespace netgen; namespace netgen { extern std::shared_ptr ng_geometry; + extern std::shared_ptr mesh; } static string occparameter_description = R"delimiter( @@ -270,6 +271,7 @@ DLL_HEADER void ExportNgOCC(py::module &m) if (comm.Rank()==0) { SetGlobalMesh(mesh); + netgen::mesh = mesh; auto result = geo->GenerateMesh(mesh, mp); if(result != 0) throw Exception("Meshing failed!");