From 612b44a8951e8d90c79422e853e0e57504941aff Mon Sep 17 00:00:00 2001
From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Wed, 21 Jun 2017 19:15:52 -0400
Subject: [PATCH] enforce using 'special_bonds charmm' for dihedral styles
 charmm and charmmfsw

---
 src/MOLECULE/dihedral_charmm.cpp    | 8 ++++++--
 src/MOLECULE/dihedral_charmmfsw.cpp | 4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp
index 409e7b4b17..ddbce407c9 100644
--- a/src/MOLECULE/dihedral_charmm.cpp
+++ b/src/MOLECULE/dihedral_charmm.cpp
@@ -374,12 +374,16 @@ void DihedralCharmm::init_style()
     Respa *r = (Respa *) update->integrate;
     if (r->level_pair >= 0 && (r->level_pair != r->level_dihedral))
       error->all(FLERR,"Dihedral style charmm must be set to same"
-        " r-RESPA level as 'pair'");
+                 " r-RESPA level as 'pair'");
     if (r->level_outer >= 0 && (r->level_outer != r->level_dihedral))
       error->all(FLERR,"Dihedral style charmm must be set to same"
-        " r-RESPA level as 'outer'");
+                 " r-RESPA level as 'outer'");
   }
 
+  if ((force->special_lj[3] != 0.0) || (force->special_coul[3] != 0.0))
+    error->all(FLERR,"Must use 'special_bonds charmm' with"
+               " dihedral style charmm");
+
   // insure use of CHARMM pair_style if any weight factors are non-zero
   // set local ptrs to LJ 14 arrays setup by Pair
 
diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp
index 83aa489741..4d78630f47 100644
--- a/src/MOLECULE/dihedral_charmmfsw.cpp
+++ b/src/MOLECULE/dihedral_charmmfsw.cpp
@@ -398,6 +398,10 @@ void DihedralCharmmfsw::init_style()
         " r-RESPA level as 'outer'");
   }
 
+  if ((force->special_lj[3] != 0.0) || (force->special_coul[3] != 0.0))
+    error->all(FLERR,"Must use 'special_bonds charmm' with"
+               " dihedral style charmmfsw");
+
   // insure use of CHARMM pair_style if any weight factors are non-zero
   // set local ptrs to LJ 14 arrays setup by Pair
 
-- 
GitLab