Commit f6c77c3a authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

support dynamic groups with run style respa

(cherry picked from commit b7baa1680d6e396f10aadeb58aac234ae0be1679)
parent 5b2becd0
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include "domain.h"
#include "region.h"
#include "modify.h"
#include "respa.h"
#include "input.h"
#include "variable.h"
#include "memory.h"
@@ -95,6 +96,7 @@ int FixGroup::setmask()
{
  int mask = 0;
  mask |= POST_INTEGRATE;
  mask |= POST_INTEGRATE_RESPA;
  return mask;
}

@@ -108,6 +110,9 @@ void FixGroup::init()
  if (group->dynamic[igroup])
    error->all(FLERR,"Group dynamic parent group cannot be dynamic");

  if (strstr(update->integrate_style,"respa"))
    nlevels_respa = ((Respa *) update->integrate)->nlevels;

  // set current indices for region and variable

  if (regionflag) {
@@ -169,6 +174,13 @@ void FixGroup::post_integrate()

/* ---------------------------------------------------------------------- */

void FixGroup::post_integrate_respa(int ilevel, int iloop)
{
  if (ilevel == nlevels_respa-1) post_integrate();
}

/* ---------------------------------------------------------------------- */

void FixGroup::set_group()
{
  int nlocal = atom->nlocal;
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ class FixGroup : public Fix {
  void init();
  void setup(int);
  void post_integrate();
  void post_integrate_respa(int,int);

 private:
  int gbit,gbitinverse;
@@ -40,6 +41,8 @@ class FixGroup : public Fix {
  char *idregion,*idvar;
  class Region *region;

  int nlevels_respa;

  void set_group();
};