forked from lijiext/lammps
replace variable length arrays in USER-PHONON with new/delete
This commit is contained in:
parent
eeee2d3026
commit
330f29db0b
|
@ -668,7 +668,8 @@ void FixPhonon::postprocess( )
|
||||||
}
|
}
|
||||||
|
|
||||||
// to get Phi = KT.G^-1; normalization of FFTW data is done here
|
// to get Phi = KT.G^-1; normalization of FFTW data is done here
|
||||||
double boltz = force->boltz, kbtsqrt[sysdim], TempAve = 0.;
|
double boltz = force->boltz, TempAve = 0.;
|
||||||
|
double *kbtsqrt = new double[sysdim];
|
||||||
double TempFac = inv_neval * inv_nTemp;
|
double TempFac = inv_neval * inv_nTemp;
|
||||||
double NormFac = TempFac * double(ntotal);
|
double NormFac = TempFac * double(ntotal);
|
||||||
|
|
||||||
|
@ -692,7 +693,7 @@ void FixPhonon::postprocess( )
|
||||||
MPI_Gatherv(Phi_q[0],mynq*fft_dim2*2,MPI_DOUBLE,Phi_all[0],recvcnts,displs,MPI_DOUBLE,0,world);
|
MPI_Gatherv(Phi_q[0],mynq*fft_dim2*2,MPI_DOUBLE,Phi_all[0],recvcnts,displs,MPI_DOUBLE,0,world);
|
||||||
|
|
||||||
// to collect all basis info and averaged it on root
|
// to collect all basis info and averaged it on root
|
||||||
double basis_root[fft_dim];
|
double *basis_root = new double[fft_dim];
|
||||||
if (fft_dim > sysdim) MPI_Reduce(&basis[1][0], &basis_root[sysdim], fft_dim-sysdim, MPI_DOUBLE, MPI_SUM, 0, world);
|
if (fft_dim > sysdim) MPI_Reduce(&basis[1][0], &basis_root[sysdim], fft_dim-sysdim, MPI_DOUBLE, MPI_SUM, 0, world);
|
||||||
|
|
||||||
if (me == 0){ // output dynamic matrix by root
|
if (me == 0){ // output dynamic matrix by root
|
||||||
|
@ -772,7 +773,8 @@ void FixPhonon::postprocess( )
|
||||||
}
|
}
|
||||||
fflush(flog);
|
fflush(flog);
|
||||||
}
|
}
|
||||||
|
delete[] kbtsqrt;
|
||||||
|
delete[] basis_root;
|
||||||
} // end of postprocess
|
} // end of postprocess
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue