From 799ffc58d914d3335d4ebb18fb8f58dd670bfd71 Mon Sep 17 00:00:00 2001
From: dilkins <wilkinsd@outlook.com>
Date: Mon, 1 Oct 2018 17:13:56 +0200
Subject: [PATCH] C++ system headers included and enumeration of flip_int
 used;documentation corrected

---
 doc/src/fix_ffl.txt       |  5 -----
 src/USER-MISC/fix_ffl.cpp | 31 ++++++++++++++++++-------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/doc/src/fix_ffl.txt b/doc/src/fix_ffl.txt
index 8d6b243142..b8e745eddd 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 54e5c03a62..29fce9b8ff 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;
-- 
GitLab