forked from lijiext/lammps
replace variable length arrays in pair style tdpd with new/delete
This commit is contained in:
parent
d24885f805
commit
1b31b4899a
|
@ -59,7 +59,6 @@ static const char cite_pair_edpd[] =
|
|||
" volume = {51},\n"
|
||||
" pages = {11038--11040}\n"
|
||||
"}\n\n";
|
||||
;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
|
|
@ -280,7 +280,9 @@ void PairTDPD::coeff(int narg, char **arg)
|
|||
double power_one = force->numeric(FLERR,arg[4]);
|
||||
double cut_one = force->numeric(FLERR,arg[5]);
|
||||
double cutcc_one = force->numeric(FLERR,arg[6]);
|
||||
double kappa_one[cc_species],epsilon_one[cc_species],powercc_one[cc_species];
|
||||
double *kappa_one = new double[cc_species];
|
||||
double *epsilon_one = new double[cc_species];
|
||||
double *powercc_one = new double[cc_species];
|
||||
for(int k=0; k<cc_species; k++) {
|
||||
kappa_one[k] = force->numeric(FLERR,arg[7+3*k]);
|
||||
epsilon_one[k] = force->numeric(FLERR,arg[8+3*k]);
|
||||
|
@ -304,6 +306,9 @@ void PairTDPD::coeff(int narg, char **arg)
|
|||
setflag[i][j] = 1;
|
||||
count++;
|
||||
}
|
||||
delete[] kappa_one;
|
||||
delete[] epsilon_one;
|
||||
delete[] powercc_one;
|
||||
|
||||
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue