diff --git a/doc/src/fix_ffl.txt b/doc/src/fix_ffl.txt index 8d6b2431421bf54f0529532bfe57fab50d4ad740..b8e745eddd685a6af411ae1f2e7ec7bb27a04217 100644 --- a/doc/src/fix_ffl.txt +++ b/doc/src/fix_ffl.txt @@ -100,11 +100,6 @@ calculated by this fix is "extensive". [Restrictions:] -The GLE thermostat in its current implementation should not be used -with rigid bodies, SHAKE or RATTLE. It is expected that all the -thermostatted degrees of freedom are fully flexible, and the sampled -ensemble will not be correct otherwise. - In order to perform constant-pressure simulations please use "fix press/berendsen"_fix_press_berendsen.html, rather than "fix npt"_fix_nh.html, to avoid duplicate integration of the diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index 54e5c03a62ba1d862e16d404f924af8f31a431d1..29fce9b8fff0559d96fe87f51bdd1f6e8cf720fd 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -22,9 +22,9 @@ ------------------------------------------------------------------------- */ #include <mpi.h> -#include <math.h> -#include <string.h> -#include <stdlib.h> +#include <cmath> +#include <cstring> +#include <cstdlib> #include "fix_ffl.h" #include "math_extra.h" #include "atom.h" @@ -91,19 +91,24 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : int seed = force->inumeric(FLERR,arg[6]); // Flip type used, uses rescale if no flip is given - if (narg == 8) strcpy(flip_type,arg[7]); - else strcpy(flip_type,"rescale"); + if (narg == 8) { + if (strcmp(arg[7],"no_flip") == 0) {flip_int = 0;} + else if ((strcmp(arg[7],"rescale") == 0) {flip_int = 1;} + else if ((strcmp(arg[7],"hard") == 0) {flip_int = 2;} + else if ((strcmp(arg[7],"soft") == 0) {flip_int = 3;} + else { + error->all(FLERR,"Illegal fix ffl flip type, only accepts : rescale - hard - soft - no_flip"); + } + } else { + flip_int = 1; + } - // Tests if the flip type is valid - if ( strcmp(flip_type,"rescale") && strcmp(flip_type,"hard") - && strcmp(flip_type,"soft") && strcmp(flip_type,"no_flip") ) - error->all(FLERR,"Illegal fix ffl flip type, only accepts : rescale - hard - soft - no_flip"); - if ( strcmp(flip_type,"no_flip") == 0 ) flip_int = 0; - if ( strcmp(flip_type,"rescale") == 0 ) flip_int = 1; - if ( strcmp(flip_type,"hard") == 0 ) flip_int = 2; - if ( strcmp(flip_type,"soft") == 0 ) flip_int = 3; +// if ( strcmp(flip_type,"no_flip") == 0 ) flip_int = 0; + // if ( strcmp(flip_type,"rescale") == 0 ) flip_int = 1; + // if ( strcmp(flip_type,"hard") == 0 ) flip_int = 2; + // if ( strcmp(flip_type,"soft") == 0 ) flip_int = 3; t_target=t_start; const double kT = t_target * force->boltz / force->mvv2e;