support dynamic groups with run style respa

(cherry picked from commit b7baa1680d)
This commit is contained in:
Axel Kohlmeyer 2016-09-28 22:08:28 -04:00
parent 5b2becd09b
commit f6c77c3aba
2 changed files with 15 additions and 0 deletions

View File

@ -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;

View File

@ -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();
};