From a6825d18ca7390bb7ab4e8e90c6d08217f2cae69 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Sat, 6 Apr 2019 13:40:37 +0200 Subject: [PATCH] build jacobi pols even if mesh is unpickled and buildcurvedelements is never called --- libsrc/meshing/curvedelems.cpp | 18 ++++++++++-------- libsrc/meshing/curvedelems.hpp | 3 +++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index 98410568..8964d956 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -409,6 +409,15 @@ namespace netgen static Array> jacpols2; + void CurvedElements::buildJacPols() + { + if (!jacpols2.Size()) + { + jacpols2.SetSize (100); + for (int i = 0; i < 100; i++) + jacpols2[i] = make_shared (100, i, 2); + } + } // compute face bubbles up to order n, 0 < y, y-x < 1, x+y < 1 template @@ -540,7 +549,6 @@ namespace netgen CurvedElements :: ~CurvedElements() { - jacpols2.SetSize(0); } @@ -719,13 +727,7 @@ namespace netgen ComputeGaussRule (aorder+4, xi, weight); // on (0,1) - if (!jacpols2.Size()) - { - jacpols2.SetSize (100); - for (int i = 0; i < 100; i++) - jacpols2[i] = make_shared (100, i, 2); - } - + buildJacPols(); PrintMessage (3, "Curving edges"); if (mesh.GetDimension() == 3 || rational) diff --git a/libsrc/meshing/curvedelems.hpp b/libsrc/meshing/curvedelems.hpp index 29c911aa..cd78d708 100644 --- a/libsrc/meshing/curvedelems.hpp +++ b/libsrc/meshing/curvedelems.hpp @@ -33,6 +33,7 @@ class CurvedElements bool rational; bool ishighorder; + void buildJacPols(); public: DLL_HEADER CurvedElements (const Mesh & amesh); @@ -50,6 +51,8 @@ public: virtual void DoArchive(Archive& ar) { + if(ar.Input()) + buildJacPols(); ar & edgeorder & faceorder & edgecoeffsindex & facecoeffsindex & edgecoeffs & facecoeffs & edgeweight & order & rational & ishighorder; }