Merge remote branch 'lammps-ro/master' into lammps-icms
Resolved Conflicts: src/group.cpp
This commit is contained in:
@ -3494,7 +3494,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
|
||||
id = positive global ID of atom, converted to local index
|
||||
push result onto tree or arg stack
|
||||
customize by adding an atom vector:
|
||||
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz
|
||||
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz,q
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Variable::peratom2global(int flag, char *word,
|
||||
@ -3532,7 +3532,11 @@ void Variable::peratom2global(int flag, char *word,
|
||||
else if (strcmp(word,"fx") == 0) mine = atom->f[index][0];
|
||||
else if (strcmp(word,"fy") == 0) mine = atom->f[index][1];
|
||||
else if (strcmp(word,"fz") == 0) mine = atom->f[index][2];
|
||||
|
||||
else if (strcmp(word,"q") == 0) {
|
||||
if (!atom->q_flag)
|
||||
error->one(FLERR,"Variable uses atom property that isn't allocated");
|
||||
mine = atom->q[index];
|
||||
}
|
||||
else error->one(FLERR,"Invalid atom vector in variable formula");
|
||||
|
||||
} else mine = vector[index*nstride];
|
||||
@ -3555,7 +3559,7 @@ void Variable::peratom2global(int flag, char *word,
|
||||
check if word matches an atom vector
|
||||
return 1 if yes, else 0
|
||||
customize by adding an atom vector:
|
||||
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz
|
||||
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz,q
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int Variable::is_atom_vector(char *word)
|
||||
@ -3573,6 +3577,7 @@ int Variable::is_atom_vector(char *word)
|
||||
if (strcmp(word,"fx") == 0) return 1;
|
||||
if (strcmp(word,"fy") == 0) return 1;
|
||||
if (strcmp(word,"fz") == 0) return 1;
|
||||
if (strcmp(word,"q") == 0) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -3581,7 +3586,7 @@ int Variable::is_atom_vector(char *word)
|
||||
push result onto tree
|
||||
word = atom vector
|
||||
customize by adding an atom vector:
|
||||
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz
|
||||
id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz,q
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Variable::atom_vector(char *word, Tree **tree,
|
||||
@ -3643,6 +3648,11 @@ void Variable::atom_vector(char *word, Tree **tree,
|
||||
else if (strcmp(word,"fx") == 0) newtree->array = &atom->f[0][0];
|
||||
else if (strcmp(word,"fy") == 0) newtree->array = &atom->f[0][1];
|
||||
else if (strcmp(word,"fz") == 0) newtree->array = &atom->f[0][2];
|
||||
|
||||
else if (strcmp(word,"q") == 0) {
|
||||
newtree->nstride = 1;
|
||||
newtree->array = atom->q;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user