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
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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

+12 −0
Original line number Diff line number Diff line
@@ -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