From fec79cb2e37dd8c233c07c1aa5c2e08c45b16112 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Fri, 30 Jul 2010 07:51:58 +0000 Subject: [PATCH] fix for curved element check --- libsrc/meshing/curvedelems.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index 42b6b919..5aa5b39f 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -1822,6 +1822,26 @@ namespace netgen const Element & el = mesh[elnr]; ELEMENT_TYPE type = el.GetType(); + int nfaces = MeshTopology::GetNFaces (type); + if (nfaces > 4) + { // not a tet + const ELEMENT_FACE * faces = MeshTopology::GetFaces0 (type); + for (int j = 0; j < nfaces; j++) + { + if (faces[j][3] != -1) + { // a quad face + Point<3> pts[4]; + for (int k = 0; k < 4; k++) + pts[k] = mesh.Point(el[faces[j][k]]); + Vec<3> twist = (pts[1] - pts[0]) - (pts[2]-pts[3]); + if (twist.Length() > 1e-8 * (pts[1]-pts[0]).Length()) + return true; + } + } + } + + + ElementInfo info; info.elnr = elnr; info.order = order;