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

This commit is contained in:
sjplimp
2009-11-17 16:07:28 +00:00
parent ae7fa87a27
commit a78ba892af
26 changed files with 177 additions and 33 deletions

View File

@ -87,6 +87,18 @@ void AtomVecEllipsoid::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecEllipsoid::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
quat = atom->quat; angmom = atom->angmom; torque = atom->torque;
}
/* ---------------------------------------------------------------------- */
void AtomVecEllipsoid::copy(int i, int j)

View File

@ -23,6 +23,7 @@ class AtomVecEllipsoid : public AtomVec {
AtomVecEllipsoid(class LAMMPS *, int, char **);
virtual ~AtomVecEllipsoid() {}
void grow(int);
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -81,6 +81,18 @@ void AtomVecColloid::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecColloid::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
omega = atom->omega; torque = atom->torque;
}
/* ---------------------------------------------------------------------- */
void AtomVecColloid::copy(int i, int j)

View File

@ -23,6 +23,7 @@ class AtomVecColloid : public AtomVec {
AtomVecColloid(class LAMMPS *, int, char **);
virtual ~AtomVecColloid() {}
void grow(int);
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -84,6 +84,19 @@ void AtomVecDipole::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecDipole::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
q = atom->q; mu = atom->mu;
omega = atom->omega; torque = atom->torque;
}
/* ---------------------------------------------------------------------- */
void AtomVecDipole::copy(int i, int j)

View File

@ -22,6 +22,7 @@ class AtomVecDipole : public AtomVec {
public:
AtomVecDipole(class LAMMPS *, int, char **);
void grow(int);
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -90,6 +90,19 @@ void AtomVecGranular::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecGranular::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
radius = atom->radius; density = atom->density; rmass = atom->rmass;
omega = atom->omega; torque = atom->torque;
}
/* ---------------------------------------------------------------------- */
void AtomVecGranular::copy(int i, int j)

View File

@ -23,6 +23,7 @@ class AtomVecGranular : public AtomVec {
AtomVecGranular(class LAMMPS *, int, char **);
~AtomVecGranular() {}
void grow(int);
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -110,11 +110,22 @@ void AtomVecAngle::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ---------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecAngle::reset_special()
void AtomVecAngle::grow_reset()
{
special = atom->special;
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
molecule = atom->molecule;
nspecial = atom->nspecial; special = atom->special;
num_bond = atom->num_bond; bond_type = atom->bond_type;
bond_atom = atom->bond_atom;
num_angle = atom->num_angle; angle_type = atom->angle_type;
angle_atom1 = atom->angle_atom1; angle_atom2 = atom->angle_atom2;
angle_atom3 = atom->angle_atom3;
}
/* ---------------------------------------------------------------------- */

View File

@ -22,7 +22,7 @@ class AtomVecAngle : public AtomVec {
public:
AtomVecAngle(class LAMMPS *, int, char **);
void grow(int);
void reset_special();
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -95,11 +95,19 @@ void AtomVecBond::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ---------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecBond::reset_special()
void AtomVecBond::grow_reset()
{
special = atom->special;
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
molecule = atom->molecule;
nspecial = atom->nspecial; special = atom->special;
num_bond = atom->num_bond; bond_type = atom->bond_type;
bond_atom = atom->bond_atom;
}
/* ---------------------------------------------------------------------- */

View File

@ -22,7 +22,7 @@ class AtomVecBond : public AtomVec {
public:
AtomVecBond(class LAMMPS *, int, char **);
void grow(int);
void reset_special();
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -148,11 +148,28 @@ void AtomVecFull::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ---------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecFull::reset_special()
void AtomVecFull::grow_reset()
{
special = atom->special;
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
q = atom->q; molecule = atom->molecule;
nspecial = atom->nspecial; special = atom->special;
num_bond = atom->num_bond; bond_type = atom->bond_type;
bond_atom = atom->bond_atom;
num_angle = atom->num_angle; angle_type = atom->angle_type;
angle_atom1 = atom->angle_atom1; angle_atom2 = atom->angle_atom2;
angle_atom3 = atom->angle_atom3;
num_dihedral = atom->num_dihedral; dihedral_type = atom->dihedral_type;
dihedral_atom1 = atom->dihedral_atom1; dihedral_atom2 = atom->dihedral_atom2;
dihedral_atom3 = atom->dihedral_atom3; dihedral_atom4 = atom->dihedral_atom4;
num_improper = atom->num_improper; improper_type = atom->improper_type;
improper_atom1 = atom->improper_atom1; improper_atom2 = atom->improper_atom2;
improper_atom3 = atom->improper_atom3; improper_atom4 = atom->improper_atom4;
}
/* ---------------------------------------------------------------------- */

View File

@ -22,7 +22,7 @@ class AtomVecFull : public AtomVec {
public:
AtomVecFull(class LAMMPS *, int, char **);
void grow(int);
void reset_special();
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -146,11 +146,28 @@ void AtomVecMolecular::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ---------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecMolecular::reset_special()
void AtomVecMolecular::grow_reset()
{
special = atom->special;
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
molecule = atom->molecule;
nspecial = atom->nspecial; special = atom->special;
num_bond = atom->num_bond; bond_type = atom->bond_type;
bond_atom = atom->bond_atom;
num_angle = atom->num_angle; angle_type = atom->angle_type;
angle_atom1 = atom->angle_atom1; angle_atom2 = atom->angle_atom2;
angle_atom3 = atom->angle_atom3;
num_dihedral = atom->num_dihedral; dihedral_type = atom->dihedral_type;
dihedral_atom1 = atom->dihedral_atom1; dihedral_atom2 = atom->dihedral_atom2;
dihedral_atom3 = atom->dihedral_atom3; dihedral_atom4 = atom->dihedral_atom4;
num_improper = atom->num_improper; improper_type = atom->improper_type;
improper_atom1 = atom->improper_atom1; improper_atom2 = atom->improper_atom2;
improper_atom3 = atom->improper_atom3; improper_atom4 = atom->improper_atom4;
}
/* ---------------------------------------------------------------------- */

View File

@ -22,7 +22,7 @@ class AtomVecMolecular : public AtomVec {
public:
AtomVecMolecular(class LAMMPS *, int, char **);
void grow(int);
void reset_special();
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -88,6 +88,19 @@ void AtomVecPeri::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecPeri::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
vfrac = atom->vfrac; density = atom->density; rmass = atom->rmass;
s0 = atom->s0; x0 = atom->x0;
}
/* ---------------------------------------------------------------------- */
void AtomVecPeri::copy(int i, int j)

View File

@ -22,6 +22,7 @@ class AtomVecPeri : public AtomVec {
public:
AtomVecPeri(class LAMMPS *, int, char **);
void grow(int);
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -43,7 +43,7 @@ class AtomVec : protected Pointers {
virtual void init() {}
virtual void grow(int) = 0;
virtual void reset_special() {}
virtual void grow_reset() = 0;
virtual void copy(int, int) = 0;
virtual int pack_comm(int, int *, double *, int, int *) = 0;

View File

@ -71,6 +71,17 @@ void AtomVecAtomic::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecAtomic::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
}
/* ---------------------------------------------------------------------- */
void AtomVecAtomic::copy(int i, int j)

View File

@ -23,6 +23,7 @@ class AtomVecAtomic : public AtomVec {
AtomVecAtomic(class LAMMPS *, int, char **);
~AtomVecAtomic() {}
void grow(int);
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -76,6 +76,18 @@ void AtomVecCharge::grow(int n)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecCharge::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
q = atom->q;
}
/* ---------------------------------------------------------------------- */
void AtomVecCharge::copy(int i, int j)

View File

@ -22,6 +22,7 @@ class AtomVecCharge : public AtomVec {
public:
AtomVecCharge(class LAMMPS *, int, char **);
void grow(int);
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -118,29 +118,27 @@ void AtomVecHybrid::grow(int n)
for (int k = 0; k < nstyles; k++) styles[k]->grow(nmax);
atom->nextra_grow = tmp;
// pointers for arrays used directly by hybrid style
// insure sub-style ptrs and hybrid local ptrs are up to date
// for sub-styles, is in case sub-style reallocs actually realloced
tag = atom->tag;
type = atom->type;
mask = atom->mask;
image = atom->image;
x = atom->x;
v = atom->v;
f = atom->f;
omega = atom->omega;
angmom = atom->angmom;
for (int k = 0; k < nstyles; k++) styles[k]->grow_reset();
grow_reset();
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
}
/* ---------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecHybrid::reset_special()
void AtomVecHybrid::grow_reset()
{
for (int k = 0; k < nstyles; k++) styles[k]->reset_special();
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
x = atom->x; v = atom->v; f = atom->f;
omega = atom->omega; angmom = atom->angmom;
}
/* ----------------------------------------------------------------------

View File

@ -27,7 +27,7 @@ class AtomVecHybrid : public AtomVec {
AtomVecHybrid(class LAMMPS *, int, char **);
~AtomVecHybrid();
void grow(int);
void reset_special();
void grow_reset();
void copy(int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);

View File

@ -639,7 +639,7 @@ void Special::combine()
atom->special =
memory->create_2d_int_array(atom->nmax,atom->maxspecial,"atom:special");
atom->avec->reset_special();
atom->avec->grow_reset();
int **special = atom->special;
// ----------------------------------------------------