Skip to content
Snippets Groups Projects
Commit 684b7334 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

enforce that CHARMM dihedral styles are run at the same r-RESPA level as pair

parent 1fc2eb1e
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <mpi.h> #include <mpi.h>
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "dihedral_charmm.h" #include "dihedral_charmm.h"
#include "atom.h" #include "atom.h"
#include "comm.h" #include "comm.h"
...@@ -26,6 +27,7 @@ ...@@ -26,6 +27,7 @@
#include "force.h" #include "force.h"
#include "pair.h" #include "pair.h"
#include "update.h" #include "update.h"
#include "respa.h"
#include "math_const.h" #include "math_const.h"
#include "memory.h" #include "memory.h"
#include "error.h" #include "error.h"
...@@ -368,6 +370,16 @@ void DihedralCharmm::coeff(int narg, char **arg) ...@@ -368,6 +370,16 @@ void DihedralCharmm::coeff(int narg, char **arg)
void DihedralCharmm::init_style() 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 // insure use of CHARMM pair_style if any weight factors are non-zero
// set local ptrs to LJ 14 arrays setup by Pair // set local ptrs to LJ 14 arrays setup by Pair
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <mpi.h> #include <mpi.h>
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "dihedral_charmmfsw.h" #include "dihedral_charmmfsw.h"
#include "atom.h" #include "atom.h"
#include "comm.h" #include "comm.h"
...@@ -29,6 +30,7 @@ ...@@ -29,6 +30,7 @@
#include "force.h" #include "force.h"
#include "pair.h" #include "pair.h"
#include "update.h" #include "update.h"
#include "respa.h"
#include "math_const.h" #include "math_const.h"
#include "memory.h" #include "memory.h"
#include "error.h" #include "error.h"
...@@ -386,6 +388,16 @@ void DihedralCharmmfsw::coeff(int narg, char **arg) ...@@ -386,6 +388,16 @@ void DihedralCharmmfsw::coeff(int narg, char **arg)
void DihedralCharmmfsw::init_style() 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 // insure use of CHARMM pair_style if any weight factors are non-zero
// set local ptrs to LJ 14 arrays setup by Pair // set local ptrs to LJ 14 arrays setup by Pair
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment