mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-13 06:30:34 +05:00
Manage global JacobiPols array inside struct
Works around emscripten issue, where the global array was not constructed properly
This commit is contained in:
parent
7570468686
commit
1c6d53f387
@ -405,18 +405,24 @@ namespace netgen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static NgArray<shared_ptr<RecPol>> jacpols2;
|
||||
|
||||
void CurvedElements::buildJacPols()
|
||||
struct JacobiRecPols
|
||||
{
|
||||
if (!jacpols2.Size())
|
||||
static constexpr size_t N = 100;
|
||||
ArrayMem<unique_ptr<JacobiRecPol>, N> jacpols;
|
||||
|
||||
JacobiRecPols()
|
||||
{
|
||||
jacpols2.SetSize (100);
|
||||
for (int i = 0; i < 100; i++)
|
||||
jacpols2[i] = make_shared<JacobiRecPol> (100, i, 2);
|
||||
jacpols.SetSize (N);
|
||||
for (int i = 0; i < N; i++)
|
||||
jacpols[i] = make_unique<JacobiRecPol>(N, i, 2);
|
||||
}
|
||||
|
||||
const unique_ptr<JacobiRecPol> & 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 <class Tx, class Ty, class Ts>
|
||||
@ -710,7 +716,6 @@ namespace netgen
|
||||
|
||||
ComputeGaussRule (aorder+4, xi, weight); // on (0,1)
|
||||
|
||||
buildJacPols();
|
||||
PrintMessage (3, "Curving edges");
|
||||
|
||||
if (mesh.GetDimension() == 3 || rational)
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user