forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2678 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
f7b4f5747a
commit
03f99b8b35
|
@ -21,6 +21,7 @@
|
|||
#include "domain.h"
|
||||
#include "region.h"
|
||||
#include "comm.h"
|
||||
#include "group.h"
|
||||
#include "random_park.h"
|
||||
#include "random_mars.h"
|
||||
#include "memory.h"
|
||||
|
@ -84,6 +85,30 @@ int FixEvaporate::setmask()
|
|||
return mask;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixEvaporate::init()
|
||||
{
|
||||
// check that no deletable atoms are in atom->firstgroup
|
||||
// deleting such an atom would not leave firstgroup atoms first
|
||||
|
||||
if (atom->firstgroup >= 0) {
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
int firstgroupbit = group->bitmask[atom->firstgroup];
|
||||
|
||||
int flag = 0;
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if ((mask[i] & groupbit) && (mask[i] && firstgroupbit)) flag = 1;
|
||||
|
||||
int flagall;
|
||||
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
|
||||
|
||||
if (flagall)
|
||||
error->all("Cannot evaporate atoms in atom_modify first group");
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
perform particle deletion
|
||||
done before exchange, borders, reneighbor
|
||||
|
|
|
@ -23,6 +23,7 @@ class FixEvaporate : public Fix {
|
|||
FixEvaporate(class LAMMPS *, int, char **);
|
||||
~FixEvaporate();
|
||||
int setmask();
|
||||
void init();
|
||||
void pre_exchange();
|
||||
double compute_scalar();
|
||||
double memory_usage();
|
||||
|
|
Loading…
Reference in New Issue