From e220a252d16e4ba85a07b22ce015cb9df5d51e38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Sun, 14 Apr 2019 07:55:38 +0200 Subject: [PATCH] fixes for tet10 and trig6 elements (is_curved, clipping-plane vis) --- libsrc/meshing/curvedelems.cpp | 14 ++++++++++++++ libsrc/meshing/meshtype.cpp | 1 + libsrc/meshing/meshtype.hpp | 7 ++++--- libsrc/visualization/vssolution.cpp | 4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index 8964d956..83c5211f 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -2241,6 +2241,20 @@ namespace netgen switch (el.GetType()) { + case TRIG6: + { + AutoDiff<2,T> lam3 = 1-x-y; + AutoDiff<2,T> lami[6] = { x * (2*x-1), y * (2*y-1), lam3 * (2*lam3-1), + 4 * y * lam3, 4 * x * lam3, 4 * x * y }; + for (int j = 0; j < 6; j++) + { + Point<3> p = mesh[el[j]]; + for (int k = 0; k < DIM_SPACE; k++) + mapped_x[k] += p(k) * lami[j]; + } + break; + } + case TRIG: { // if (info.order >= 2) return false; // not yet supported diff --git a/libsrc/meshing/meshtype.cpp b/libsrc/meshing/meshtype.cpp index 806b6c39..5eaa02d0 100644 --- a/libsrc/meshing/meshtype.cpp +++ b/libsrc/meshing/meshtype.cpp @@ -1140,6 +1140,7 @@ namespace netgen default: break; cerr << "Element::SetType unknown type " << int(typ) << endl; } + is_curved = (np > 4); } diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index 41fdb11a..a2f76986 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -765,11 +765,12 @@ namespace netgen void DoArchive (Archive & ar) { short _np, _typ; + bool _curved; if (ar.Output()) - { _np = np; _typ = typ; } - ar & _np & _typ & index; + { _np = np; _typ = typ; _curved = is_curved; } + ar & _np & _typ & index & _curved; if (ar.Input()) - { np = _np; typ = ELEMENT_TYPE(_typ); } + { np = _np; typ = ELEMENT_TYPE(_typ); is_curved = _curved; } for (size_t i = 0; i < np; i++) ar & pnum[i]; } diff --git a/libsrc/visualization/vssolution.cpp b/libsrc/visualization/vssolution.cpp index 65505e5e..64ed1818 100644 --- a/libsrc/visualization/vssolution.cpp +++ b/libsrc/visualization/vssolution.cpp @@ -4005,8 +4005,8 @@ namespace netgen Array compress(n3); NgProfiler::StartTimer (timer_vals); - Array vertval(mesh->GetNV()); - Array posval(mesh->GetNV()); + Array vertval(mesh->GetNP()); + Array posval(mesh->GetNP()); for (PointIndex pi = vertval.Begin(); pi < vertval.End(); pi++) { Point<3> vert = (*mesh)[pi];