From c20480c662e1b75e8ad6f385a3412657eba06baa Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Fri, 15 Oct 2021 22:10:57 +0200 Subject: [PATCH] too fast with segment mapping --- libsrc/meshing/curvedelems.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index 21237782..89401625 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -1435,9 +1435,9 @@ namespace netgen if (seg.GetNP() == 2) { if (x) - *x = Point<3,T>((1-xi) * Vec<3>(mesh[seg.PNums()[0]]) + xi * Vec<3>(mesh[seg.PNums()[1]])); + *x = Point<3,T>(xi * Vec<3>(mesh[seg.PNums()[0]]) + (1-xi) * Vec<3>(mesh[seg.PNums()[1]])); if (dxdxi) - *dxdxi = Vec<3>(mesh[seg.PNums()[1]])-Vec<3>(mesh[seg.PNums()[0]]); + *dxdxi = Vec<3>(mesh[seg.PNums()[0]])-Vec<3>(mesh[seg.PNums()[1]]); } else { @@ -1448,8 +1448,10 @@ namespace netgen + 2*xi*(xi-0.5) * Vec<3>(mesh[seg.PNums()[0]])); } if (dxdxi) - *dxdxi = T(1.0) * (Vec<3>(mesh[seg.PNums()[1]])-Vec<3>(mesh[seg.PNums()[0]])) + *dxdxi = (4*xi-1)*Vec<3>(mesh[seg.PNums()[0]]) + + (4*xi-3)*Vec<3>(mesh[seg.PNums()[1]]) + (4-8*xi)*Vec<3>(mesh[seg.PNums()[2]]); + } return; }