add extract to fix_group

this will allow users to define groups that are by default created internally by fixes, etc.
This commit is contained in:
jrgissing
2018-04-24 22:53:54 -06:00
parent 69665c218a
commit c4373c7afa
2 changed files with 12 additions and 5 deletions

View File

@ -251,3 +251,13 @@ void FixGroup::set_group()
if (varflag) memory->destroy(var); if (varflag) memory->destroy(var);
} }
/* ---------------------------------------------------------------------- */
void *FixGroup::extract(const char *str, int &unused)
{
if (strcmp(str,"property") == 0 && propflag) return (void *) idprop;
if (strcmp(str,"variable") == 0 && varflag) return (void *) idvar;
if (strcmp(str,"region") == 0 && regionflag) return (void *) idregion;
return NULL;
}

View File

@ -33,6 +33,7 @@ class FixGroup : public Fix {
void setup(int); void setup(int);
void post_integrate(); void post_integrate();
void post_integrate_respa(int,int); void post_integrate_respa(int,int);
void *extract(const char *,int &);
private: private:
int gbit,gbitinverse; int gbit,gbitinverse;
@ -69,7 +70,7 @@ Self-explanatory.
E: Per atom property for group dynamic does not exist E: Per atom property for group dynamic does not exist
UNDOCUMENTED Self-explanatory.
E: Group dynamic parent group cannot be dynamic E: Group dynamic parent group cannot be dynamic
@ -79,10 +80,6 @@ E: Variable for group dynamic is invalid style
The variable must be an atom-style variable. The variable must be an atom-style variable.
E: Per-atom property for group dynamic does not exist
UNDOCUMENTED
W: One or more dynamic groups may not be updated at correct point in timestep W: One or more dynamic groups may not be updated at correct point in timestep
If there are other fixes that act immediately after the initial stage If there are other fixes that act immediately after the initial stage