replace variable length arrays in pair style tdpd with new/delete

This commit is contained in:
Axel Kohlmeyer 2018-05-04 19:06:36 -04:00
parent d24885f805
commit 1b31b4899a
2 changed files with 6 additions and 2 deletions

View File

@ -59,7 +59,6 @@ static const char cite_pair_edpd[] =
" volume = {51},\n" " volume = {51},\n"
" pages = {11038--11040}\n" " pages = {11038--11040}\n"
"}\n\n"; "}\n\n";
;
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@ -280,7 +280,9 @@ void PairTDPD::coeff(int narg, char **arg)
double power_one = force->numeric(FLERR,arg[4]); double power_one = force->numeric(FLERR,arg[4]);
double cut_one = force->numeric(FLERR,arg[5]); double cut_one = force->numeric(FLERR,arg[5]);
double cutcc_one = force->numeric(FLERR,arg[6]); 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++) { for(int k=0; k<cc_species; k++) {
kappa_one[k] = force->numeric(FLERR,arg[7+3*k]); kappa_one[k] = force->numeric(FLERR,arg[7+3*k]);
epsilon_one[k] = force->numeric(FLERR,arg[8+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; setflag[i][j] = 1;
count++; count++;
} }
delete[] kappa_one;
delete[] epsilon_one;
delete[] powercc_one;
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
} }