From c97415aefab7cdb6f83a7aa7a57d5386ecc0e6a7 Mon Sep 17 00:00:00 2001 From: Emile Maras Date: Mon, 19 Jun 2017 14:57:39 +0200 Subject: [PATCH] corrected the initial free end --- src/REPLICA/fix_neb.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index 297c101234..6594012eab 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -48,6 +48,9 @@ FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : tagsendall(NULL), tagrecvall(NULL), counts(NULL), displacements(NULL) { + + + if (narg < 4) error->all(FLERR,"Illegal fix neb command"); kspring = force->numeric(FLERR,arg[3]); @@ -282,7 +285,7 @@ void FixNEB::min_post_force(int vflag) MPI_Bcast(&vnext,1,MPI_DOUBLE,0,world); } - if (FreeEndFinal && (update->ntimestep == 0)) EFinalIni = veng; + if (FreeEndFinal && ireplica == nreplica-1 && (update->ntimestep == 0)) EFinalIni = veng; if (ireplica == 0) vIni=veng; @@ -296,14 +299,16 @@ void FixNEB::min_post_force(int vflag) MPI_Bcast(&vIni,1,MPI_DOUBLE,0,world); } } - if (FreeEndIni && ireplica == 0) { - if (me == 0 ) + + if (FreeEndIni && ireplica == 0 && (update->ntimestep == 0)) EIniIni = veng; + /* if (FreeEndIni && ireplica == 0) { + // if (me == 0 ) if (update->ntimestep == 0) { EIniIni = veng; - if (cmode == MULTI_PROC) - MPI_Bcast(&EIniIni,1,MPI_DOUBLE,0,world); + // if (cmode == MULTI_PROC) + // MPI_Bcast(&EIniIni,1,MPI_DOUBLE,0,world); } - } + }*/ // communicate atoms to/from adjacent replicas to fill xprev,xnext