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

This commit is contained in:
sjplimp 2009-03-18 17:47:46 +00:00
parent f7b4f5747a
commit 03f99b8b35
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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();