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

This commit is contained in:
sjplimp
2011-04-16 20:03:44 +00:00
parent 0aad802c3b
commit 888bee024a
4 changed files with 17 additions and 16 deletions

View File

@ -110,7 +110,7 @@ void AtomVecEllipsoid::grow_reset()
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
grow Bonus data for style-specific atom data grow bonus data structure
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void AtomVecEllipsoid::grow_bonus() void AtomVecEllipsoid::grow_bonus()
@ -125,7 +125,7 @@ void AtomVecEllipsoid::grow_bonus()
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
copy atom I info to atom J copy atom I info to atom J
if delflag and atom J has style-specific data, then delete it if delflag and atom J has bonus data, then delete it
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void AtomVecEllipsoid::copy(int i, int j, int delflag) void AtomVecEllipsoid::copy(int i, int j, int delflag)
@ -159,7 +159,7 @@ void AtomVecEllipsoid::copy(int i, int j, int delflag)
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
copy Bonus for I to J, effectively deleting the J entry copy bonus data from I to J, effectively deleting the J entry
insure index pointers between per-atom and bonus data are updated insure index pointers between per-atom and bonus data are updated
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -182,8 +182,8 @@ void AtomVecEllipsoid::copy_bonus(int i, int j)
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
set shape values in Bonus data for particle I set shape values in bonus data for particle I
this may create or delete entry in Bonus data this may create or delete entry in bonus data
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
void AtomVecEllipsoid::set_bonus(int i, void AtomVecEllipsoid::set_bonus(int i,
@ -216,7 +216,7 @@ void AtomVecEllipsoid::set_bonus(int i,
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
clear ghost info in Bonus data clear ghost info in bonus data
called before ghosts are recommunicated in comm and irregular called before ghosts are recommunicated in comm and irregular
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -981,7 +981,7 @@ int AtomVecEllipsoid::size_restart()
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
pack atom I's data for restart file including Bonus data pack atom I's data for restart file including bonus data
xyz must be 1st 3 values, so that read_restart can test on them xyz must be 1st 3 values, so that read_restart can test on them
molecular types may be negative, but write as positive molecular types may be negative, but write as positive
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
@ -1027,7 +1027,7 @@ int AtomVecEllipsoid::pack_restart(int i, double *buf)
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
unpack data for one atom from restart file including Bonus data unpack data for one atom from restart file including bonus data
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
int AtomVecEllipsoid::unpack_restart(double *buf) int AtomVecEllipsoid::unpack_restart(double *buf)
@ -1103,10 +1103,11 @@ void AtomVecEllipsoid::create_atom(int itype, double *coord)
v[nlocal][1] = 0.0; v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0; v[nlocal][2] = 0.0;
ellipsoid[nlocal] = -1; rmass[nlocal] = 1.0;
angmom[nlocal][0] = 0.0; angmom[nlocal][0] = 0.0;
angmom[nlocal][1] = 0.0; angmom[nlocal][1] = 0.0;
angmom[nlocal][2] = 0.0; angmom[nlocal][2] = 0.0;
ellipsoid[nlocal] = -1;
atom->nlocal++; atom->nlocal++;
} }
@ -1184,15 +1185,15 @@ void AtomVecEllipsoid::data_atom_bonus(int m, char **values)
error->one("Assigning ellipsoid parameters to non-ellipsoid atom"); error->one("Assigning ellipsoid parameters to non-ellipsoid atom");
if (nlocal_bonus == nmax_bonus) grow_bonus(); if (nlocal_bonus == nmax_bonus) grow_bonus();
double *shape = bonus[nlocal_bonus].shape;
double *quat = bonus[nlocal_bonus].quat;
double *shape = bonus[nlocal_bonus].shape;
shape[0] = 0.5 * atof(values[0]); shape[0] = 0.5 * atof(values[0]);
shape[1] = 0.5 * atof(values[1]); shape[1] = 0.5 * atof(values[1]);
shape[2] = 0.5 * atof(values[2]); shape[2] = 0.5 * atof(values[2]);
if (shape[0] <= 0.0 || shape[1] <= 0.0 || shape[2] <= 0.0) if (shape[0] <= 0.0 || shape[1] <= 0.0 || shape[2] <= 0.0)
error->one("Invalid shape in Ellipsoids section of data file"); error->one("Invalid shape in Ellipsoids section of data file");
double *quat = bonus[nlocal_bonus].quat;
quat[0] = atof(values[3]); quat[0] = atof(values[3]);
quat[1] = atof(values[4]); quat[1] = atof(values[4]);
quat[2] = atof(values[5]); quat[2] = atof(values[5]);
@ -1253,6 +1254,7 @@ bigint AtomVecEllipsoid::memory_usage()
if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax); if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
if (atom->memcheck("angmom")) bytes += memory->usage(angmom,nmax,3); if (atom->memcheck("angmom")) bytes += memory->usage(angmom,nmax,3);
if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3); if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax,3);
if (atom->memcheck("ellipsoid")) bytes += memory->usage(ellipsoid,nmax);
bytes += nmax_bonus*sizeof(Bonus); bytes += nmax_bonus*sizeof(Bonus);

View File

@ -34,7 +34,7 @@ class AtomVecEllipsoid : public AtomVec {
struct Bonus *bonus; struct Bonus *bonus;
AtomVecEllipsoid(class LAMMPS *, int, char **); AtomVecEllipsoid(class LAMMPS *, int, char **);
virtual ~AtomVecEllipsoid(); ~AtomVecEllipsoid();
void grow(int); void grow(int);
void grow_reset(); void grow_reset();
void copy(int, int, int); void copy(int, int, int);
@ -78,7 +78,7 @@ class AtomVecEllipsoid : public AtomVec {
double PI; double PI;
int *tag,*type,*mask,*image; int *tag,*type,*mask,*image;
double **x,**v,**f; double **x,**v,**f;
double *density,*rmass; double *rmass;
double **angmom,**torque; double **angmom,**torque;
int *ellipsoid; int *ellipsoid;

View File

@ -26,7 +26,6 @@ class FixNHAsphere : public FixNH {
protected: protected:
double dtq; double dtq;
double **inertia;
class AtomVecEllipsoid *avec; class AtomVecEllipsoid *avec;
void richardson(double *, double *, double *); void richardson(double *, double *, double *);

View File

@ -384,8 +384,8 @@ void Set::set(int keyword)
avec_ellipsoid->set_bonus(i,0.5*xvalue,0.5*yvalue,0.5*zvalue); avec_ellipsoid->set_bonus(i,0.5*xvalue,0.5*yvalue,0.5*zvalue);
// set rmass via density // set rmass via density
// if radius > 0.0, assume sphere // if radius > 0.0, treat as sphere
// if shape > 0.0, assume ellipsoid // if shape > 0.0, treat as ellipsoid
// else set rmass to density directly // else set rmass to density directly
else if (keyword == DENSITY) { else if (keyword == DENSITY) {