mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
throw on meshing failure
This commit is contained in:
parent
de1932227b
commit
303aebc27e
@ -707,7 +707,9 @@ However, when r = 0, the top part becomes a point(tip) and meshing fails!
|
||||
mesh->SetGeometry(geo);
|
||||
ng_geometry = geo;
|
||||
geo->FindIdenticSurfaces(1e-8 * geo->MaxSize());
|
||||
geo->GenerateMesh (mesh, mp);
|
||||
auto result = geo->GenerateMesh (mesh, mp);
|
||||
if(result != 0)
|
||||
throw Exception("Meshing failed!");
|
||||
return mesh;
|
||||
}, py::arg("mp") = nullptr,
|
||||
meshingparameter_description.c_str(),
|
||||
|
@ -377,7 +377,9 @@ DLL_HEADER void ExportGeom2d(py::module &m)
|
||||
mesh->SetGeometry(self);
|
||||
SetGlobalMesh (mesh);
|
||||
ng_geometry = self;
|
||||
self->GenerateMesh(mesh, mp);
|
||||
auto result = self->GenerateMesh(mesh, mp);
|
||||
if(result != 0)
|
||||
throw Exception("Meshing failed!");
|
||||
return mesh;
|
||||
}, py::arg("mp") = nullptr,
|
||||
py::call_guard<py::gil_scoped_release>(),
|
||||
|
@ -177,7 +177,9 @@ DLL_HEADER void ExportNgOCC(py::module &m)
|
||||
geo->SetOCCParameters(occparam);
|
||||
auto mesh = make_shared<Mesh>();
|
||||
mesh->SetGeometry(geo);
|
||||
geo->GenerateMesh(mesh, mp);
|
||||
auto result = geo->GenerateMesh(mesh, mp);
|
||||
if(result != 0)
|
||||
throw Exception("Meshing failed!");
|
||||
SetGlobalMesh(mesh);
|
||||
ng_geometry = geo;
|
||||
return mesh;
|
||||
|
@ -205,7 +205,10 @@ DLL_HEADER void ExportSTL(py::module & m)
|
||||
mesh->SetGeometry(geo);
|
||||
ng_geometry = geo;
|
||||
SetGlobalMesh(mesh);
|
||||
STLMeshingDummy(geo.get(), mesh, mp, stlparam);
|
||||
auto result = STLMeshingDummy(geo.get(), mesh, mp, stlparam);
|
||||
if(result != 0)
|
||||
throw Exception("Meshing failed!");
|
||||
|
||||
return mesh;
|
||||
}, py::arg("mp") = nullptr,
|
||||
py::call_guard<py::gil_scoped_release>(),
|
||||
|
Loading…
Reference in New Issue
Block a user