forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12197 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
6760d0dd57
commit
f01d9363e7
|
@ -23,6 +23,7 @@
|
||||||
#include "atom_vec_body.h"
|
#include "atom_vec_body.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
|
#include "comm.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
|
@ -57,6 +58,8 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||||
error->all(FLERR,"Compute property/atom for "
|
error->all(FLERR,"Compute property/atom for "
|
||||||
"atom property that isn't allocated");
|
"atom property that isn't allocated");
|
||||||
pack_choice[i] = &ComputePropertyAtom::pack_molecule;
|
pack_choice[i] = &ComputePropertyAtom::pack_molecule;
|
||||||
|
} else if (strcmp(arg[iarg],"proc") == 0) {
|
||||||
|
pack_choice[i] = &ComputePropertyAtom::pack_proc;
|
||||||
} else if (strcmp(arg[iarg],"type") == 0) {
|
} else if (strcmp(arg[iarg],"type") == 0) {
|
||||||
pack_choice[i] = &ComputePropertyAtom::pack_type;
|
pack_choice[i] = &ComputePropertyAtom::pack_type;
|
||||||
} else if (strcmp(arg[iarg],"mass") == 0) {
|
} else if (strcmp(arg[iarg],"mass") == 0) {
|
||||||
|
@ -455,6 +458,21 @@ void ComputePropertyAtom::pack_molecule(int n)
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void ComputePropertyAtom::pack_proc(int n)
|
||||||
|
{
|
||||||
|
int *mask = atom->mask;
|
||||||
|
int nlocal = atom->nlocal;
|
||||||
|
int me = comm->me;
|
||||||
|
|
||||||
|
for (int i = 0; i < nlocal; i++) {
|
||||||
|
if (mask[i] & groupbit) buf[n] = me;
|
||||||
|
else buf[n] = 0.0;
|
||||||
|
n += nvalues;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void ComputePropertyAtom::pack_type(int n)
|
void ComputePropertyAtom::pack_type(int n)
|
||||||
{
|
{
|
||||||
int *type = atom->type;
|
int *type = atom->type;
|
||||||
|
|
|
@ -49,6 +49,7 @@ class ComputePropertyAtom : public Compute {
|
||||||
|
|
||||||
void pack_id(int);
|
void pack_id(int);
|
||||||
void pack_molecule(int);
|
void pack_molecule(int);
|
||||||
|
void pack_proc(int);
|
||||||
void pack_type(int);
|
void pack_type(int);
|
||||||
void pack_mass(int);
|
void pack_mass(int);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue