From fde3ae78abba0e1a3ea13996b91a7c3d874dd56b Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Wed, 13 Feb 2019 16:35:58 +0100 Subject: [PATCH] combine singular prisms after zrefine again --- libsrc/csg/zrefine.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/libsrc/csg/zrefine.cpp b/libsrc/csg/zrefine.cpp index 5bcb4e89..81800cef 100644 --- a/libsrc/csg/zrefine.cpp +++ b/libsrc/csg/zrefine.cpp @@ -714,7 +714,29 @@ namespace netgen } - + void CombineSingularPrisms(Mesh& mesh) + { + for(int i = 1; i<=mesh.GetNE(); i++) + { + Element& el = mesh.VolumeElement(i); + if(el.GetType() != PRISM) + continue; + if(el.PNum(3) == el.PNum(6)) + { + if(el.PNum(2) == el.PNum(5)) + { + el.SetType(TET); + } + else + { + el.SetType(PYRAMID); + int pnr5 = el.PNum(3); + el.PNum(3) = el.PNum(5); + el.PNum(5) = pnr5; + } + } + } + } void ZRefinement (Mesh & mesh, const NetgenGeometry * hgeom, ZRefinementOptions & opt) @@ -729,6 +751,8 @@ namespace netgen MakePrismsClosePoints (mesh); RefinePrisms (mesh, geom, opt); + + CombineSingularPrisms(mesh); }