forked from lijiext/lammps
replace variable length array in fix drude/transform with new/delete
This commit is contained in:
parent
c83fedf100
commit
974ea3420b
|
@ -75,7 +75,7 @@ void FixDrudeTransform<inverse>::setup(int) {
|
||||||
|
|
||||||
if (!rmass) {
|
if (!rmass) {
|
||||||
if (!mcoeff) mcoeff = new double[ntypes+1];
|
if (!mcoeff) mcoeff = new double[ntypes+1];
|
||||||
double mcoeff_loc[ntypes+1];
|
double *mcoeff_loc = new double[ntypes+1];
|
||||||
for (int itype=0; itype<=ntypes; itype++) mcoeff_loc[itype] = 2.; // an impossible value: mcoeff is at most 1.
|
for (int itype=0; itype<=ntypes; itype++) mcoeff_loc[itype] = 2.; // an impossible value: mcoeff is at most 1.
|
||||||
for (int i=0; i<nlocal; i++) {
|
for (int i=0; i<nlocal; i++) {
|
||||||
if (drudetype[type[i]] == DRUDE_TYPE) {
|
if (drudetype[type[i]] == DRUDE_TYPE) {
|
||||||
|
@ -95,6 +95,7 @@ void FixDrudeTransform<inverse>::setup(int) {
|
||||||
// mcoeff is 2 for non polarizable
|
// mcoeff is 2 for non polarizable
|
||||||
// 0 < mcoeff < 1 for drude
|
// 0 < mcoeff < 1 for drude
|
||||||
// mcoeff < 0 for core
|
// mcoeff < 0 for core
|
||||||
|
delete[] mcoeff_loc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue