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; }