diff --git a/src/atom.cpp b/src/atom.cpp index 7775f5cda3..f66c6d6c96 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -60,8 +60,8 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) molecule = NULL; q = NULL; - mu = omega = torque = NULL; - phix = phiv = phia = NULL; + mu = NULL; + xphi = omega = torque = NULL; radius = density = rmass = vfrac = NULL; maxspecial = 1; @@ -142,11 +142,9 @@ Atom::~Atom() memory->sfree(q); memory->destroy_2d_double_array(mu); + memory->destroy_2d_double_array(xphi); memory->destroy_2d_double_array(omega); memory->destroy_2d_double_array(torque); - memory->destroy_2d_double_array(phix); - memory->destroy_2d_double_array(phiv); - memory->destroy_2d_double_array(phia); memory->sfree(radius); memory->sfree(density); memory->sfree(rmass); diff --git a/src/atom.h b/src/atom.h index fd9ce8132f..1ec3e8dbba 100644 --- a/src/atom.h +++ b/src/atom.h @@ -43,9 +43,8 @@ class Atom : protected Pointers { int *molecule; double *q,**mu; - double **omega,**torque; + double **xphi,**omega,**torque; double *radius,*density,*rmass,*vfrac; - double **phix,**phiv,**phia; int maxspecial; int **nspecial,**special; diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index 30d9902050..90b4d91cff 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -41,13 +41,6 @@ int FixEnforce2D::setmask() /* ---------------------------------------------------------------------- */ -void FixEnforce2D::init() -{ - granular = atom->check_style("granular"); -} - -/* ---------------------------------------------------------------------- */ - void FixEnforce2D::setup() { if (strcmp(update->integrate_style,"verlet") == 0) @@ -74,7 +67,9 @@ void FixEnforce2D::min_setup() void FixEnforce2D::post_force(int vflag) { double **v = atom->v; + double **omega = atom->omega; double **f = atom->f; + double **torque = atom->torque; int *mask = atom->mask; int nlocal = atom->nlocal; @@ -84,17 +79,21 @@ void FixEnforce2D::post_force(int vflag) f[i][2] = 0.0; } - // for granular systems, zero xy rotational componenets + // for omega/torque systems, zero xy rotation - if (granular) { - double **phiv = atom->phiv; - double **phia = atom->phia; + if (omega) { for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { - phiv[i][0] = 0.0; - phiv[i][1] = 0.0; - phia[i][0] = 0.0; - phia[i][1] = 0.0; + omega[i][0] = 0.0; + omega[i][1] = 0.0; + } + } + + if (torque) { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + torque[i][0] = 0.0; + torque[i][1] = 0.0; } } } diff --git a/src/fix_enforce2d.h b/src/fix_enforce2d.h index 5e45481e4b..eade63b0da 100644 --- a/src/fix_enforce2d.h +++ b/src/fix_enforce2d.h @@ -22,15 +22,11 @@ class FixEnforce2D : public Fix { public: FixEnforce2D(class LAMMPS *, int, char **); int setmask(); - void init(); void setup(); void min_setup(); void post_force(int); void post_force_respa(int, int, int); void min_post_force(int); - - private: - int granular; }; }