git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11887 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2014-05-02 15:49:01 +00:00
parent 38f1fe19c9
commit fd5b627cf0
6 changed files with 26 additions and 6 deletions

View File

@ -68,6 +68,7 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
timeflag = 0;
comm_forward = comm_reverse = 0;
dynamic_group_allow = 1;
cudable = 0;
invoked_scalar = invoked_vector = invoked_array = -1;

View File

@ -20,7 +20,6 @@ namespace LAMMPS_NS {
class Compute : protected Pointers {
public:
char *id,*style;
int igroup,groupbit;
@ -75,13 +74,14 @@ class Compute : protected Pointers {
double dof; // degrees-of-freedom for temperature
int comm_forward; // size of forward communication (0 if none)
int comm_reverse; // size of reverse communication (0 if none)
int comm_forward; // size of forward communication (0 if none)
int comm_reverse; // size of reverse communication (0 if none)
int dynamic_group_allow; // 1 if can be used with dynamic group, else 0
unsigned int datamask;
unsigned int datamask_ext;
int cudable; // 1 if compute is CUDA-enabled
int cudable; // 1 if compute is CUDA-enabled
Compute(class LAMMPS *, int, char **);
virtual ~Compute();

View File

@ -58,6 +58,7 @@ Fix::Fix(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
create_attribute = 0;
restart_pbc = 0;
wd_header = wd_section = 0;
dynamic_group_allow = 0;
cudable_comm = 0;
scalar_flag = vector_flag = array_flag = 0;

View File

@ -46,6 +46,7 @@ class Fix : protected Pointers {
// so write_restart must remap to PBC
int wd_header; // # of header values fix writes to data file
int wd_section; // # of sections fix writes to data file
int dynamic_group_allow; // 1 if can be used with dynamic group, else 0
int cudable_comm; // 1 if fix has CUDA-enabled communication
int scalar_flag; // 0/1 if compute_scalar() function exists

View File

@ -500,8 +500,8 @@ void Group::assign(int narg, char **arg)
if (me == 0) {
if (dynamic[igroup]) {
if (screen) fprintf(screen,"dynamic group %s\n",names[igroup]);
if (logfile) fprintf(logfile,"dynamic group %s\n",names[igroup]);
if (screen) fprintf(screen,"dynamic group %s defined\n",names[igroup]);
if (logfile) fprintf(logfile,"dynamic group %s defined\n",names[igroup]);
} else {
if (screen)
fprintf(screen,"%.15g atoms in group %s\n",all,names[igroup]);

View File

@ -217,6 +217,23 @@ void Modify::init()
}
addstep_compute_all(update->ntimestep);
// error if any fix or compute is using a dynamic group when not allowed
for (i = 0; i < nfix; i++)
if (!fix[i]->dynamic_group_allow && group->dynamic[fix[i]->igroup]) {
char str[128];
sprintf(str,"Fix %s does not allow use of dynamic group",fix[i]->id);
error->all(FLERR,str);
}
for (i = 0; i < ncompute; i++)
if (!compute[i]->dynamic_group_allow &&
group->dynamic[compute[i]->igroup]) {
char str[128];
sprintf(str,"Compute %s does not allow use of dynamic group",fix[i]->id);
error->all(FLERR,str);
}
// warn if any particle is time integrated more than once
int nlocal = atom->nlocal;