From 1629d6bf696916d3db5aa245fcc26f6366258958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Mon, 30 Apr 2018 18:41:19 +0200 Subject: [PATCH] visualize deformation of 1d elements --- libsrc/visualization/vssolution.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libsrc/visualization/vssolution.cpp b/libsrc/visualization/vssolution.cpp index f82a1ffe..2669c1c6 100644 --- a/libsrc/visualization/vssolution.cpp +++ b/libsrc/visualization/vssolution.cpp @@ -1164,8 +1164,12 @@ namespace netgen const SolData * sol = NULL; if (scalfunction != -1) sol = soldata[scalfunction]; + const SolData * vsol = NULL; + if (deform && vecfunction != -1) vsol = soldata[vecfunction]; + int ncomp = 0; if (sol) ncomp = sol->components; + if (vsol) ncomp = vsol->components; Array mvalues(ncomp); @@ -1180,7 +1184,17 @@ namespace netgen for (int j = 0; j < npt; j++) mesh->GetCurvedElements(). CalcSegmentTransformation (pref[j], i, points[j]); - if (sol) + if (vsol) + { + for (int j = 0; j < npt; j++) + { + vsol->solclass->GetSegmentValue (i, pref[j], &mvalues[0]); + // values[j] = ExtractValue (sol, scalcomp, &mvalues[0]); + points[j](0) += scaledeform * mvalues[0]; + points[j](1) += scaledeform * mvalues[1]; + } + } + else if (sol) { for (int j = 0; j < npt; j++) {