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);
|
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 {
|
class FixDeposit : public Fix {
|
||||||
public:
|
public:
|
||||||
int ntype; // type of deposited atom, visible to PairGran
|
|
||||||
|
|
||||||
FixDeposit(class LAMMPS *, int, char **);
|
FixDeposit(class LAMMPS *, int, char **);
|
||||||
~FixDeposit();
|
~FixDeposit();
|
||||||
int setmask();
|
int setmask();
|
||||||
@ -36,9 +34,10 @@ class FixDeposit : public Fix {
|
|||||||
void pre_exchange();
|
void pre_exchange();
|
||||||
void write_restart(FILE *);
|
void write_restart(FILE *);
|
||||||
void restart(char *);
|
void restart(char *);
|
||||||
|
void *extract(const char *, int &);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int ninsert,nfreq,seed;
|
int ninsert,ntype,nfreq,seed;
|
||||||
int iregion,globalflag,localflag,maxattempt,rateflag,scaleflag,targetflag;
|
int iregion,globalflag,localflag,maxattempt,rateflag,scaleflag,targetflag;
|
||||||
int mode,rigidflag,shakeflag,idnext;
|
int mode,rigidflag,shakeflag,idnext;
|
||||||
double lo,hi,deltasq,nearsq,rate;
|
double lo,hi,deltasq,nearsq,rate;
|
||||||
@ -53,6 +52,7 @@ class FixDeposit : public Fix {
|
|||||||
double **coords;
|
double **coords;
|
||||||
imageint *imageflags;
|
imageint *imageflags;
|
||||||
class Fix *fixrigid,*fixshake;
|
class Fix *fixrigid,*fixshake;
|
||||||
|
double oneradius;
|
||||||
|
|
||||||
int nfirst,ninserted;
|
int nfirst,ninserted;
|
||||||
tagint maxtag_all,maxmol_all;
|
tagint maxtag_all,maxmol_all;
|
||||||
|
|||||||
Reference in New Issue
Block a user