mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 22:00:33 +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
|
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);
|
static Timer t("GetOpenElements"); RegionTimer rt(t);
|
||||||
auto mesh = make_unique<Mesh>();
|
auto mesh = make_unique<Mesh>();
|
||||||
@ -40,6 +40,7 @@ namespace netgen
|
|||||||
mesh->ClearSurfaceElements();
|
mesh->ClearSurfaceElements();
|
||||||
|
|
||||||
for (auto & el : openelements)
|
for (auto & el : openelements)
|
||||||
|
if(!only_quads || el.GetNP() == 4)
|
||||||
mesh->AddSurfaceElement( el );
|
mesh->AddSurfaceElement( el );
|
||||||
|
|
||||||
mesh->Compress();
|
mesh->Compress();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace netgen
|
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>{} );
|
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) {
|
if(debugparam.write_mesh_on_error) {
|
||||||
md.mesh->Save("open_quads_starting_mesh_"+ToString(md.domain)+".vol.gz");
|
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)->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");
|
PrintSysError ("mesh has still open quads");
|
||||||
throw NgException ("Stop meshing since too many attempts");
|
throw NgException ("Stop meshing since too many attempts");
|
||||||
|
Loading…
Reference in New Issue
Block a user