Commit 63c1ffd6 authored by charlie sievers's avatar charlie sievers
Browse files

Clean up langevin gjf documentation, fixed potential langevin gjf bugs

parent 7794304f
Loading
Loading
Loading
Loading
+17 −8
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ void FixLangevin::init()
      if (strcmp(id,modify->fix[i]->id) == 0) before = 0;
      else if ((modify->fmask[i] && utils::strmatch(modify->fix[i]->style,"^nve")) && before) flag = 1;
    }
    if (flag && comm->me == 0)
    if (flag)
      error->all(FLERR,"Fix langevin gjf should come before fix nve");
  }

@@ -1007,12 +1007,21 @@ void FixLangevin::reset_dt()
{
  if (atom->mass) {
    for (int i = 1; i <= atom->ntypes; i++) {
      if (gjfflag)
        gfactor2[i] = sqrt(atom->mass[i]) *
          sqrt(2.0*force->boltz/t_period/update->dt/force->mvv2e) /
          force->ftm2v;
      else
        gfactor2[i] = sqrt(atom->mass[i]) *
          sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) /
          force->ftm2v;
      gfactor2[i] *= 1.0/sqrt(ratio[i]);
    }
  }
  if (gjfflag) {
    gjfa = (1.0-update->dt/2.0/t_period)/(1.0+update->dt/2.0/t_period);
    gjfsib = sqrt(1.0+update->dt/2.0/t_period);
  }
}

/* ---------------------------------------------------------------------- */