diff --git a/libsrc/meshing/debugging.cpp b/libsrc/meshing/debugging.cpp index c5dbd906..43b837fd 100644 --- a/libsrc/meshing/debugging.cpp +++ b/libsrc/meshing/debugging.cpp @@ -2,7 +2,7 @@ namespace netgen { - unique_ptr GetOpenElements( const Mesh & m, int dom = 0 ) + unique_ptr GetOpenElements( const Mesh & m, int dom = 0, bool only_quads = false ) { static Timer t("GetOpenElements"); RegionTimer rt(t); auto mesh = make_unique(); @@ -40,7 +40,8 @@ namespace netgen mesh->ClearSurfaceElements(); for (auto & el : openelements) - mesh->AddSurfaceElement( el ); + if(!only_quads || el.GetNP() == 4) + mesh->AddSurfaceElement( el ); mesh->Compress(); return mesh; diff --git a/libsrc/meshing/debugging.hpp b/libsrc/meshing/debugging.hpp index 726fb203..b8c0ef7e 100644 --- a/libsrc/meshing/debugging.hpp +++ b/libsrc/meshing/debugging.hpp @@ -3,7 +3,7 @@ namespace netgen { - unique_ptr GetOpenElements( const Mesh & m, int dom = 0 ); + unique_ptr GetOpenElements( const Mesh & m, int dom = 0, bool only_quads = false ); unique_ptr FilterMesh( const Mesh & m, FlatArray points, FlatArray sels = Array{}, FlatArray els = Array{} ); diff --git a/libsrc/meshing/meshfunc.cpp b/libsrc/meshing/meshfunc.cpp index 48d13c21..babe1f98 100644 --- a/libsrc/meshing/meshfunc.cpp +++ b/libsrc/meshing/meshfunc.cpp @@ -363,6 +363,7 @@ namespace netgen if(debugparam.write_mesh_on_error) { md.mesh->Save("open_quads_starting_mesh_"+ToString(md.domain)+".vol.gz"); GetOpenElements(*md.mesh, md.domain)->Save("open_quads_rest_" + ToString(md.domain)+".vol.gz"); + GetOpenElements(*md.mesh, md.domain, true)->Save("open_quads_rest_" + ToString(md.domain)+"_only_quads.vol.gz"); } PrintSysError ("mesh has still open quads"); throw NgException ("Stop meshing since too many attempts");