From 5e6ed7be1f70fcdd4e0b91dc9a17da7cc5795c77 Mon Sep 17 00:00:00 2001 From: athomps Date: Fri, 7 Jun 2013 16:05:02 +0000 Subject: [PATCH] Updated FixLangevinEff git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10048 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/USER-EFF/fix_langevin_eff.cpp | 20 ++++++++++++++------ src/USER-EFF/fix_langevin_eff.h | 1 + src/fix_langevin.h | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/USER-EFF/fix_langevin_eff.cpp b/src/USER-EFF/fix_langevin_eff.cpp index 8e90f1995f..168b3b2ba1 100644 --- a/src/USER-EFF/fix_langevin_eff.cpp +++ b/src/USER-EFF/fix_langevin_eff.cpp @@ -63,6 +63,14 @@ FixLangevinEff::~FixLangevinEff() /* ---------------------------------------------------------------------- */ +void FixLangevinEff::post_force(int vflag) +{ + if (tallyflag) post_force_tally(); + else post_force_no_tally(); +} + +/* ---------------------------------------------------------------------- */ + void FixLangevinEff::post_force_no_tally() { double gamma1,gamma2,t_target; @@ -159,7 +167,7 @@ void FixLangevinEff::post_force_no_tally() // extra dof from electron size double gfactor3=(double) (dof+nelectrons)/dofnuclei; - if (which == NOBIAS) { + if (tbiasflag == NOBIAS) { for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { if (tstyle == ATOM) tsqrt = sqrt(tforce[i]); @@ -181,7 +189,7 @@ void FixLangevinEff::post_force_no_tally() } } } - } else if (which == BIAS) { + } else if (tbiasflag == BIAS) { temperature->compute_scalar(); for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { @@ -333,7 +341,7 @@ void FixLangevinEff::post_force_tally() // extra dof from electron size double gfactor3=(double) (dof+nelectrons)/dofnuclei; - if (which == NOBIAS) { + if (tbiasflag == NOBIAS) { for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { if (tstyle == ATOM) tsqrt = sqrt(tforce[i]); @@ -351,7 +359,7 @@ void FixLangevinEff::post_force_tally() } } } - } else if (which == BIAS) { + } else if (tbiasflag == BIAS) { temperature->compute_scalar(); for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { @@ -385,7 +393,7 @@ void FixLangevinEff::post_force_tally() void FixLangevinEff::end_of_step() { - if (!tally) return; + if (!tallyflag) return; double **v = atom->v; int *mask = atom->mask; @@ -407,7 +415,7 @@ void FixLangevinEff::end_of_step() double FixLangevinEff::compute_scalar() { - if (!tally || flangevin == NULL || erforcelangevin == NULL) return 0.0; + if (!tallyflag || flangevin == NULL || erforcelangevin == NULL) return 0.0; // capture the very first energy transfer to thermal reservoir diff --git a/src/USER-EFF/fix_langevin_eff.h b/src/USER-EFF/fix_langevin_eff.h index 81d8312916..10c7c687ed 100644 --- a/src/USER-EFF/fix_langevin_eff.h +++ b/src/USER-EFF/fix_langevin_eff.h @@ -30,6 +30,7 @@ class FixLangevinEff : public FixLangevin { ~FixLangevinEff(); void end_of_step(); double compute_scalar(); + void post_force(int); private: double *erforcelangevin; diff --git a/src/fix_langevin.h b/src/fix_langevin.h index 209c66ff31..c20cc2dcd0 100644 --- a/src/fix_langevin.h +++ b/src/fix_langevin.h @@ -31,7 +31,7 @@ class FixLangevin : public Fix { int setmask(); void init(); void setup(int); - void post_force(int); + virtual void post_force(int); void post_force_respa(int, int, int); virtual void end_of_step(); void reset_target(double);