mirror of
https://github.com/NGSolve/netgen.git
synced 2024-11-14 10:08:32 +05:00
Write separate mesh with only quads on open quads error
This commit is contained in:
parent
c27dbdef30
commit
33e76840b9
@ -2,7 +2,7 @@
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
unique_ptr<Mesh> GetOpenElements( const Mesh & m, int dom = 0 )
|
||||
unique_ptr<Mesh> GetOpenElements( const Mesh & m, int dom = 0, bool only_quads = false )
|
||||
{
|
||||
static Timer t("GetOpenElements"); RegionTimer rt(t);
|
||||
auto mesh = make_unique<Mesh>();
|
||||
@ -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;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
unique_ptr<Mesh> GetOpenElements( const Mesh & m, int dom = 0 );
|
||||
unique_ptr<Mesh> GetOpenElements( const Mesh & m, int dom = 0, bool only_quads = false );
|
||||
|
||||
unique_ptr<Mesh> FilterMesh( const Mesh & m, FlatArray<PointIndex> points, FlatArray<SurfaceElementIndex> sels = Array<SurfaceElementIndex>{}, FlatArray<ElementIndex> els = Array<ElementIndex>{} );
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user