build jacobi pols even if mesh is unpickled and buildcurvedelements is

never called
This commit is contained in:
Christopher Lackner 2019-04-06 13:40:37 +02:00
parent b0eae54226
commit a6825d18ca
2 changed files with 13 additions and 8 deletions

View File

@ -409,6 +409,15 @@ namespace netgen
static Array<shared_ptr<RecPol>> jacpols2; static Array<shared_ptr<RecPol>> jacpols2;
void CurvedElements::buildJacPols()
{
if (!jacpols2.Size())
{
jacpols2.SetSize (100);
for (int i = 0; i < 100; i++)
jacpols2[i] = make_shared<JacobiRecPol> (100, i, 2);
}
}
// compute face bubbles up to order n, 0 < y, y-x < 1, x+y < 1 // compute face bubbles up to order n, 0 < y, y-x < 1, x+y < 1
template <class Tx, class Ty, class Ts> template <class Tx, class Ty, class Ts>
@ -540,7 +549,6 @@ namespace netgen
CurvedElements :: ~CurvedElements() CurvedElements :: ~CurvedElements()
{ {
jacpols2.SetSize(0);
} }
@ -719,13 +727,7 @@ namespace netgen
ComputeGaussRule (aorder+4, xi, weight); // on (0,1) ComputeGaussRule (aorder+4, xi, weight); // on (0,1)
if (!jacpols2.Size()) buildJacPols();
{
jacpols2.SetSize (100);
for (int i = 0; i < 100; i++)
jacpols2[i] = make_shared<JacobiRecPol> (100, i, 2);
}
PrintMessage (3, "Curving edges"); PrintMessage (3, "Curving edges");
if (mesh.GetDimension() == 3 || rational) if (mesh.GetDimension() == 3 || rational)

View File

@ -33,6 +33,7 @@ class CurvedElements
bool rational; bool rational;
bool ishighorder; bool ishighorder;
void buildJacPols();
public: public:
DLL_HEADER CurvedElements (const Mesh & amesh); DLL_HEADER CurvedElements (const Mesh & amesh);
@ -50,6 +51,8 @@ public:
virtual void DoArchive(Archive& ar) virtual void DoArchive(Archive& ar)
{ {
if(ar.Input())
buildJacPols();
ar & edgeorder & faceorder & edgecoeffsindex & facecoeffsindex & edgecoeffs & facecoeffs ar & edgeorder & faceorder & edgecoeffsindex & facecoeffsindex & edgecoeffs & facecoeffs
& edgeweight & order & rational & ishighorder; & edgeweight & order & rational & ishighorder;
} }