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

This commit is contained in:
sjplimp
2014-04-08 21:01:52 +00:00
parent 8355dc9ac0
commit 51f4c3b0cc
2 changed files with 35 additions and 3 deletions

View File

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