git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11744 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -720,3 +720,35 @@ void FixDeposit::restart(char *buf)
|
||||
|
||||
random->reset(seed);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
extract particle radius for atom type = itype
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void *FixDeposit::extract(const char *str, int &itype)
|
||||
{
|
||||
if (strcmp(str,"radius") == 0) {
|
||||
if (mode == ATOM) {
|
||||
if (itype == ntype) oneradius = 0.5;
|
||||
else oneradius = 0.0;
|
||||
} else {
|
||||
double *radius = onemol->radius;
|
||||
int *type = onemol->type;
|
||||
int natoms = onemol->natoms;
|
||||
|
||||
// check radii of matching types in Molecule
|
||||
// default to 0.5, if radii not defined in Molecule
|
||||
// same as atom->avec->create_atom(), invoked in pre_exchange()
|
||||
|
||||
oneradius = 0.0;
|
||||
for (int i = 0; i < natoms; i++)
|
||||
if (type[i] == itype-ntype) {
|
||||
if (radius) oneradius = MAX(oneradius,radius[i]);
|
||||
else oneradius = 0.5;
|
||||
}
|
||||
}
|
||||
itype = 0;
|
||||
return &oneradius;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -27,8 +27,6 @@ namespace LAMMPS_NS {
|
||||
|
||||
class FixDeposit : public Fix {
|
||||
public:
|
||||
int ntype; // type of deposited atom, visible to PairGran
|
||||
|
||||
FixDeposit(class LAMMPS *, int, char **);
|
||||
~FixDeposit();
|
||||
int setmask();
|
||||
@ -36,9 +34,10 @@ class FixDeposit : public Fix {
|
||||
void pre_exchange();
|
||||
void write_restart(FILE *);
|
||||
void restart(char *);
|
||||
void *extract(const char *, int &);
|
||||
|
||||
private:
|
||||
int ninsert,nfreq,seed;
|
||||
int ninsert,ntype,nfreq,seed;
|
||||
int iregion,globalflag,localflag,maxattempt,rateflag,scaleflag,targetflag;
|
||||
int mode,rigidflag,shakeflag,idnext;
|
||||
double lo,hi,deltasq,nearsq,rate;
|
||||
@ -53,6 +52,7 @@ class FixDeposit : public Fix {
|
||||
double **coords;
|
||||
imageint *imageflags;
|
||||
class Fix *fixrigid,*fixshake;
|
||||
double oneradius;
|
||||
|
||||
int nfirst,ninserted;
|
||||
tagint maxtag_all,maxmol_all;
|
||||
|
||||
Reference in New Issue
Block a user