diff --git a/src/ASPHERE/atom_vec_ellipsoid.cpp b/src/ASPHERE/atom_vec_ellipsoid.cpp index 73b9163097..ddf95831af 100755 --- a/src/ASPHERE/atom_vec_ellipsoid.cpp +++ b/src/ASPHERE/atom_vec_ellipsoid.cpp @@ -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) diff --git a/src/ASPHERE/atom_vec_ellipsoid.h b/src/ASPHERE/atom_vec_ellipsoid.h index 7d7b7db9a0..f517081b71 100755 --- a/src/ASPHERE/atom_vec_ellipsoid.h +++ b/src/ASPHERE/atom_vec_ellipsoid.h @@ -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 *); diff --git a/src/COLLOID/atom_vec_colloid.cpp b/src/COLLOID/atom_vec_colloid.cpp index b684bab6cc..3c13ecde0e 100644 --- a/src/COLLOID/atom_vec_colloid.cpp +++ b/src/COLLOID/atom_vec_colloid.cpp @@ -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) diff --git a/src/COLLOID/atom_vec_colloid.h b/src/COLLOID/atom_vec_colloid.h index 3d8782f51f..dc7b43c32c 100644 --- a/src/COLLOID/atom_vec_colloid.h +++ b/src/COLLOID/atom_vec_colloid.h @@ -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 *); diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp index 1f750e088d..35c7f4b738 100644 --- a/src/DIPOLE/atom_vec_dipole.cpp +++ b/src/DIPOLE/atom_vec_dipole.cpp @@ -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) diff --git a/src/DIPOLE/atom_vec_dipole.h b/src/DIPOLE/atom_vec_dipole.h index 3438c80dfa..670619f006 100644 --- a/src/DIPOLE/atom_vec_dipole.h +++ b/src/DIPOLE/atom_vec_dipole.h @@ -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 *); diff --git a/src/GRANULAR/atom_vec_granular.cpp b/src/GRANULAR/atom_vec_granular.cpp index 4a3ea752b6..799f229ea5 100644 --- a/src/GRANULAR/atom_vec_granular.cpp +++ b/src/GRANULAR/atom_vec_granular.cpp @@ -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) diff --git a/src/GRANULAR/atom_vec_granular.h b/src/GRANULAR/atom_vec_granular.h index b1ae95008c..e1af89d68d 100644 --- a/src/GRANULAR/atom_vec_granular.h +++ b/src/GRANULAR/atom_vec_granular.h @@ -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 *); diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index afc22770b9..6789db5006 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -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; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_angle.h b/src/MOLECULE/atom_vec_angle.h index 0850d75286..d0260b2f95 100644 --- a/src/MOLECULE/atom_vec_angle.h +++ b/src/MOLECULE/atom_vec_angle.h @@ -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 *); diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 73175e4baf..1e8f913237 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -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; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_bond.h b/src/MOLECULE/atom_vec_bond.h index 822ea065e3..e79d04abc1 100644 --- a/src/MOLECULE/atom_vec_bond.h +++ b/src/MOLECULE/atom_vec_bond.h @@ -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 *); diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index c1ef437079..5815256fcc 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -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; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_full.h b/src/MOLECULE/atom_vec_full.h index d19ac76568..c3c2d9e5e3 100644 --- a/src/MOLECULE/atom_vec_full.h +++ b/src/MOLECULE/atom_vec_full.h @@ -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 *); diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index f329f8b366..131e80c599 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -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; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_molecular.h b/src/MOLECULE/atom_vec_molecular.h index a880de2570..8659b8a0e6 100644 --- a/src/MOLECULE/atom_vec_molecular.h +++ b/src/MOLECULE/atom_vec_molecular.h @@ -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 *); diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp index 2d97a9b4d6..6ec44f7ab3 100644 --- a/src/PERI/atom_vec_peri.cpp +++ b/src/PERI/atom_vec_peri.cpp @@ -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) diff --git a/src/PERI/atom_vec_peri.h b/src/PERI/atom_vec_peri.h index 0e28e4f5d8..964af8fb9b 100755 --- a/src/PERI/atom_vec_peri.h +++ b/src/PERI/atom_vec_peri.h @@ -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 *); diff --git a/src/atom_vec.h b/src/atom_vec.h index 66b30aab29..92ea2d9011 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -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; diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp index c3303888b7..665f66f041 100644 --- a/src/atom_vec_atomic.cpp +++ b/src/atom_vec_atomic.cpp @@ -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) diff --git a/src/atom_vec_atomic.h b/src/atom_vec_atomic.h index e15e28d293..25cda44bde 100644 --- a/src/atom_vec_atomic.h +++ b/src/atom_vec_atomic.h @@ -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 *); diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp index 9c09609492..76b69b4bd7 100644 --- a/src/atom_vec_charge.cpp +++ b/src/atom_vec_charge.cpp @@ -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) diff --git a/src/atom_vec_charge.h b/src/atom_vec_charge.h index 8648abfbf2..81a6374a13 100644 --- a/src/atom_vec_charge.h +++ b/src/atom_vec_charge.h @@ -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 *); diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 606f36773f..5dd82d31e5 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -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; } /* ---------------------------------------------------------------------- diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h index 6fcde4f87f..036bddaa6a 100644 --- a/src/atom_vec_hybrid.h +++ b/src/atom_vec_hybrid.h @@ -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 *); diff --git a/src/special.cpp b/src/special.cpp index 4ae54d98f6..f786257efa 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -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; // ----------------------------------------------------