Commit 974ea342 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

replace variable length array in fix drude/transform with new/delete

parent c83fedf1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ void FixDrudeTransform<inverse>::setup(int) {

  if (!rmass) {
    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 i=0; i<nlocal; i++) {
      if (drudetype[type[i]] == DRUDE_TYPE) {
@@ -95,6 +95,7 @@ void FixDrudeTransform<inverse>::setup(int) {
    // mcoeff is 2 for non polarizable
    // 0 < mcoeff < 1 for drude
    // mcoeff < 0 for core
    delete[] mcoeff_loc;
  }
}