replace variable length array in fix ipi with new/delete

This commit is contained in:
Axel Kohlmeyer
2018-05-04 16:47:29 -04:00
parent b61834f28d
commit b11757adb3

View File

@ -428,7 +428,7 @@ void FixIPI::final_integrate()
int nat=bsize/3;
double **f= atom->f;
double lbuf[bsize];
double *lbuf = double[bsize];
// reassembles the force vector from the local arrays
int nlocal = atom->nlocal;
@ -440,6 +440,7 @@ void FixIPI::final_integrate()
lbuf[3*(atom->tag[i]-1)+2]=f[i][2]*forceconv;
}
MPI_Allreduce(lbuf,buffer,bsize,MPI_DOUBLE,MPI_SUM,world);
delete[] lbuf;
for (int i = 0; i < 9; ++i) vir[i]=0.0;