diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index b9d1c440d44cbb7ef5acb06a219ef1007191be9b..409e7b4b176eba5781789d0c2fc6fbbea0d79beb 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -18,6 +18,7 @@ #include <mpi.h> #include <math.h> #include <stdlib.h> +#include <string.h> #include "dihedral_charmm.h" #include "atom.h" #include "comm.h" @@ -26,6 +27,7 @@ #include "force.h" #include "pair.h" #include "update.h" +#include "respa.h" #include "math_const.h" #include "memory.h" #include "error.h" @@ -368,6 +370,16 @@ void DihedralCharmm::coeff(int narg, char **arg) void DihedralCharmm::init_style() { + if (strstr(update->integrate_style,"respa")) { + 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'"); + 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'"); + } + // 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 613170bbfab6c7eff157a9c97951c371b5a0bf8e..83aa48974123c3428e2feb184a5227dfc72c4543 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -21,6 +21,7 @@ #include <mpi.h> #include <math.h> #include <stdlib.h> +#include <string.h> #include "dihedral_charmmfsw.h" #include "atom.h" #include "comm.h" @@ -29,6 +30,7 @@ #include "force.h" #include "pair.h" #include "update.h" +#include "respa.h" #include "math_const.h" #include "memory.h" #include "error.h" @@ -386,6 +388,16 @@ void DihedralCharmmfsw::coeff(int narg, char **arg) void DihedralCharmmfsw::init_style() { + if (strstr(update->integrate_style,"respa")) { + Respa *r = (Respa *) update->integrate; + if (r->level_pair >= 0 && (r->level_pair != r->level_dihedral)) + error->all(FLERR,"Dihedral style charmmfsw must be set to same" + " r-RESPA level as 'pair'"); + if (r->level_outer >= 0 && (r->level_outer != r->level_dihedral)) + error->all(FLERR,"Dihedral style charmmfsw must be set to same" + " r-RESPA level as 'outer'"); + } + // insure use of CHARMM pair_style if any weight factors are non-zero // set local ptrs to LJ 14 arrays setup by Pair