From 4c71fc23114137bbef0855d3257571eae06103df Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 14 Jan 2013 15:56:34 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9270 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/RIGID/fix_rigid.cpp | 12 ++++++------ src/compute_property_atom.cpp | 9 +++++++++ src/compute_property_atom.h | 2 +- src/fix_langevin.cpp | 12 ++++-------- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index bb06596591..a8572f4a04 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -511,12 +511,6 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : MINUSPI = -MY_PI; TWOPI = 2.0*MY_PI; - // atom style pointers to particles that store extra info - - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_line = (AtomVecLine *) atom->style_match("line"); - avec_tri = (AtomVecTri *) atom->style_match("tri"); - // print statistics int nsum = 0; @@ -599,6 +593,12 @@ void FixRigid::init() triclinic = domain->triclinic; + // atom style pointers to particles that store extra info + + avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec_line = (AtomVecLine *) atom->style_match("line"); + avec_tri = (AtomVecTri *) atom->style_match("tri"); + // warn if more than one rigid fix int count = 0; diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index aafada4b99..d3ae7171f4 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -344,6 +344,15 @@ ComputePropertyAtom::~ComputePropertyAtom() /* ---------------------------------------------------------------------- */ +void ComputePropertyAtom::init() +{ + avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec_line = (AtomVecLine *) atom->style_match("line"); + avec_tri = (AtomVecTri *) atom->style_match("tri"); +} + +/* ---------------------------------------------------------------------- */ + void ComputePropertyAtom::compute_peratom() { invoked_peratom = update->ntimestep; diff --git a/src/compute_property_atom.h b/src/compute_property_atom.h index 3e43bc9303..b709e18077 100644 --- a/src/compute_property_atom.h +++ b/src/compute_property_atom.h @@ -28,7 +28,7 @@ class ComputePropertyAtom : public Compute { public: ComputePropertyAtom(class LAMMPS *, int, char **); ~ComputePropertyAtom(); - void init() {} + void init(); void compute_peratom(); double memory_usage(); diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 292f691bc4..190036e521 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -131,14 +131,6 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix langevin command"); } - // error check - - if (aflag) { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - if (!avec) - error->all(FLERR,"Fix langevin angmom requires atom style ellipsoid"); - } - // set temperature = NULL, user can override via fix_modify if wants bias id_temp = NULL; @@ -213,6 +205,10 @@ void FixLangevin::init() } if (aflag) { + avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + if (!avec) + error->all(FLERR,"Fix langevin angmom requires atom style ellipsoid"); + int *ellipsoid = atom->ellipsoid; int *mask = atom->mask; int nlocal = atom->nlocal;