Skip to content
Snippets Groups Projects
Commit d6777b61 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

deal with netgen exceptions

parent 7b80350c
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ class mystreambuf: public streambuf ...@@ -31,7 +31,7 @@ class mystreambuf: public streambuf
} }
else{ else{
if(!strncmp(txt, "ERROR", 5)) if(!strncmp(txt, "ERROR", 5))
Msg::Fatal(txt); Msg::Error(txt);
else else
Msg::Info(txt); Msg::Info(txt);
} }
...@@ -76,11 +76,16 @@ Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh) ...@@ -76,11 +76,16 @@ Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh)
MeshingParameters mparam; MeshingParameters mparam;
mparam.uselocalh = 1; mparam.uselocalh = 1;
mparam.maxh = maxh; mparam.maxh = maxh;
m->CalcLocalH(); try{
MeshVolume(mparam, *m); m->CalcLocalH();
//RemoveIllegalElements(*m); MeshVolume(mparam, *m);
//OptimizeVolume(mparam, *m); //RemoveIllegalElements(*m);
//OptimizeVolume(mparam, *m);
}
catch(netgen::NgException error){
return NG_VOLUME_FAILURE;
}
return NG_OK; return NG_OK;
} }
...@@ -93,10 +98,15 @@ Ng_Result NgAddOn_OptimizeVolumeMesh(Ng_Mesh *mesh, double maxh) ...@@ -93,10 +98,15 @@ Ng_Result NgAddOn_OptimizeVolumeMesh(Ng_Mesh *mesh, double maxh)
mparam.uselocalh = 1; mparam.uselocalh = 1;
mparam.maxh = maxh; mparam.maxh = maxh;
m->CalcLocalH(); try{
//MeshVolume(mparam, *m); m->CalcLocalH();
RemoveIllegalElements(*m); //MeshVolume(mparam, *m);
OptimizeVolume(mparam, *m); RemoveIllegalElements(*m);
OptimizeVolume(mparam, *m);
}
catch(netgen::NgException error){
return NG_VOLUME_FAILURE;
}
return NG_OK; return NG_OK;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment