diff --git a/libsrc/meshing/curvedelems.cpp b/libsrc/meshing/curvedelems.cpp index 829aca7e..c5b5fa18 100644 --- a/libsrc/meshing/curvedelems.cpp +++ b/libsrc/meshing/curvedelems.cpp @@ -405,18 +405,24 @@ namespace netgen } } - - static NgArray> jacpols2; - - void CurvedElements::buildJacPols() + struct JacobiRecPols { - if (!jacpols2.Size()) - { - jacpols2.SetSize (100); - for (int i = 0; i < 100; i++) - jacpols2[i] = make_shared (100, i, 2); - } - } + static constexpr size_t N = 100; + ArrayMem, N> jacpols; + + JacobiRecPols() + { + jacpols.SetSize (N); + for (int i = 0; i < N; i++) + jacpols[i] = make_unique(N, i, 2); + } + + const unique_ptr & operator[] (int i) { + return jacpols[i]; + } + }; + + static JacobiRecPols jacpols2; // compute face bubbles up to order n, 0 < y, y-x < 1, x+y < 1 template @@ -710,7 +716,6 @@ namespace netgen ComputeGaussRule (aorder+4, xi, weight); // on (0,1) - buildJacPols(); PrintMessage (3, "Curving edges"); if (mesh.GetDimension() == 3 || rational) diff --git a/libsrc/meshing/curvedelems.hpp b/libsrc/meshing/curvedelems.hpp index 423732bd..08c1bf02 100644 --- a/libsrc/meshing/curvedelems.hpp +++ b/libsrc/meshing/curvedelems.hpp @@ -38,7 +38,6 @@ class CurvedElements bool rational; bool ishighorder; - void buildJacPols(); public: DLL_HEADER CurvedElements (const Mesh & amesh); @@ -56,8 +55,6 @@ public: void DoArchive(Archive& ar) { - if(ar.Input()) - buildJacPols(); ar & edgeorder & faceorder & edgecoeffsindex & facecoeffsindex & edgecoeffs & facecoeffs & edgeweight & order & rational & ishighorder; }