replace variable length array in msm with new/delete

This commit is contained in:
Axel Kohlmeyer
2018-05-04 18:09:25 -04:00
parent b11757adb3
commit 5670dc5e6e

View File

@ -2261,7 +2261,7 @@ void MSM::restriction(int n)
double ***qgrid2 = qgrid[n+1];
int k = 0;
int index[p+2];
int *index = new int[p+2];
for (int nu=-p; nu<=p; nu++) {
if (nu%2 == 0 && nu != 0) continue;
phi1d[0][k] = compute_phi(nu*delxinv[n+1]/delxinv[n]);
@ -2317,7 +2317,7 @@ void MSM::restriction(int n)
}
qgrid2[kp][jp][ip] += q2sum;
}
delete[] index;
}
/* ----------------------------------------------------------------------
@ -2348,7 +2348,7 @@ void MSM::prolongation(int n)
double ***v5grid2 = v5grid[n+1];
int k = 0;
int index[p+2];
int *index = new int[p+2];
for (int nu=-p; nu<=p; nu++) {
if (nu%2 == 0 && nu != 0) continue;
phi1d[0][k] = compute_phi(nu*delxinv[n+1]/delxinv[n]);
@ -2420,7 +2420,7 @@ void MSM::prolongation(int n)
}
}
delete[] index;
}
/* ----------------------------------------------------------------------