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

This commit is contained in:
sjplimp 2013-01-14 15:59:49 +00:00
parent 4c71fc2311
commit 4f2bdac177
13 changed files with 67 additions and 44 deletions

View File

@ -35,7 +35,12 @@ ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
scalar_flag = 1; scalar_flag = 1;
extscalar = 1; extscalar = 1;
}
/* ---------------------------------------------------------------------- */
void ComputeERotateAsphere::init()
{
// error check // error check
avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
@ -44,12 +49,7 @@ ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
if (!avec_ellipsoid && !avec_line && !avec_tri) if (!avec_ellipsoid && !avec_line && !avec_tri)
error->all(FLERR,"Compute erotate/asphere requires " error->all(FLERR,"Compute erotate/asphere requires "
"atom style ellipsoid or line or tri"); "atom style ellipsoid or line or tri");
}
/* ---------------------------------------------------------------------- */
void ComputeERotateAsphere::init()
{
// check that all particles are finite-size // check that all particles are finite-size
// no point particles allowed, spherical is OK // no point particles allowed, spherical is OK

View File

@ -73,11 +73,6 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
vector = new double[6]; vector = new double[6];
// error check
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all(FLERR,"Compute temp/asphere requires atom style ellipsoid");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -92,6 +87,12 @@ ComputeTempAsphere::~ComputeTempAsphere()
void ComputeTempAsphere::init() void ComputeTempAsphere::init()
{ {
// error check
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all(FLERR,"Compute temp/asphere requires atom style ellipsoid");
// check that all particles are finite-size, no point particles allowed // check that all particles are finite-size, no point particles allowed
int *ellipsoid = atom->ellipsoid; int *ellipsoid = atom->ellipsoid;

View File

@ -34,15 +34,16 @@ using namespace FixConst;
FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) : FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNH(lmp, narg, arg) FixNH(lmp, narg, arg)
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all(FLERR,"Compute nvt/nph/npt asphere requires atom style ellipsoid");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixNHAsphere::init() void FixNHAsphere::init()
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all(FLERR,"Compute nvt/nph/npt asphere requires atom style ellipsoid");
// check that all particles are finite-size // check that all particles are finite-size
// no point particles allowed, spherical is OK // no point particles allowed, spherical is OK

View File

@ -37,15 +37,16 @@ using namespace FixConst;
FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) : FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNVE(lmp, narg, arg) FixNVE(lmp, narg, arg)
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixNVEAsphere::init() void FixNVEAsphere::init()
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid");
// check that all particles are finite-size ellipsoids // check that all particles are finite-size ellipsoids
// no point particles allowed, spherical is OK // no point particles allowed, spherical is OK

View File

@ -34,18 +34,18 @@ FixNVEAsphereNoforce::FixNVEAsphereNoforce(LAMMPS *lmp, int narg, char **arg) :
if (narg != 3) error->all(FLERR,"Illegal fix nve/asphere/noforce command"); if (narg != 3) error->all(FLERR,"Illegal fix nve/asphere/noforce command");
time_integrate = 1; time_integrate = 1;
// error check
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!atom->ellipsoid_flag)
error->all(FLERR,"Fix nve/asphere/noforce requires atom style ellipsoid");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixNVEAsphereNoforce::init() void FixNVEAsphereNoforce::init()
{ {
// error check
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!atom->ellipsoid_flag)
error->all(FLERR,"Fix nve/asphere/noforce requires atom style ellipsoid");
FixNVENoforce::init(); FixNVENoforce::init();
dtq = 0.5 * dtv; dtq = 0.5 * dtv;

View File

@ -38,11 +38,6 @@ FixNVELine::FixNVELine(LAMMPS *lmp, int narg, char **arg) :
MINUSPI = -MY_PI; MINUSPI = -MY_PI;
TWOPI = 2.0*MY_PI; TWOPI = 2.0*MY_PI;
// error checks
avec = (AtomVecLine *) atom->style_match("line");
if (!avec) error->all(FLERR,"Fix nve/line requires atom style line");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -63,6 +58,11 @@ void FixNVELine::init()
{ {
int i,itype; int i,itype;
// error checks
avec = (AtomVecLine *) atom->style_match("line");
if (!avec) error->all(FLERR,"Fix nve/line requires atom style line");
if (domain->dimension != 2) if (domain->dimension != 2)
error->all(FLERR,"Fix nve/line can only be used for 2d simulations"); error->all(FLERR,"Fix nve/line can only be used for 2d simulations");

View File

@ -32,11 +32,6 @@ FixNVETri::FixNVETri(LAMMPS *lmp, int narg, char **arg) :
if (narg != 3) error->all(FLERR,"Illegal fix nve/tri command"); if (narg != 3) error->all(FLERR,"Illegal fix nve/tri command");
time_integrate = 1; time_integrate = 1;
// error checks
avec = (AtomVecTri *) atom->style_match("tri");
if (!avec) error->all(FLERR,"Fix nve/tri requires atom style tri");
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -57,6 +52,11 @@ void FixNVETri::init()
{ {
int i,itype; int i,itype;
// error checks
avec = (AtomVecTri *) atom->style_match("tri");
if (!avec) error->all(FLERR,"Fix nve/tri requires atom style tri");
if (domain->dimension != 3) if (domain->dimension != 3)
error->all(FLERR,"Fix nve/tri can only be used for 3d simulations"); error->all(FLERR,"Fix nve/tri can only be used for 3d simulations");

View File

@ -37,9 +37,6 @@ using namespace LAMMPS_NS;
PairGayBerne::PairGayBerne(LAMMPS *lmp) : Pair(lmp) PairGayBerne::PairGayBerne(LAMMPS *lmp) : Pair(lmp)
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
single_enable = 0; single_enable = 0;
} }
@ -335,6 +332,9 @@ void PairGayBerne::coeff(int narg, char **arg)
void PairGayBerne::init_style() void PairGayBerne::init_style()
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
neighbor->request(this); neighbor->request(this);
// per-type shape precalculations // per-type shape precalculations

View File

@ -32,9 +32,6 @@ using namespace LAMMPS_NS;
PairLineLJ::PairLineLJ(LAMMPS *lmp) : Pair(lmp) PairLineLJ::PairLineLJ(LAMMPS *lmp) : Pair(lmp)
{ {
avec = (AtomVecLine *) atom->style_match("line");
if (!avec) error->all(FLERR,"Pair line/lj requires atom style line");
dmax = nmax = 0; dmax = nmax = 0;
discrete = NULL; discrete = NULL;
dnum = dfirst = NULL; dnum = dfirst = NULL;
@ -384,6 +381,18 @@ void PairLineLJ::coeff(int narg, char **arg)
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
} }
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairLineLJ::init_style()
{
avec = (AtomVecLine *) atom->style_match("line");
if (!avec) error->all(FLERR,"Pair line/lj requires atom style line");
neighbor->request(this);
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

@ -31,6 +31,7 @@ class PairLineLJ : public Pair {
virtual void compute(int, int); virtual void compute(int, int);
void settings(int, char **); void settings(int, char **);
void coeff(int, char **); void coeff(int, char **);
virtual void init_style();
double init_one(int, int); double init_one(int, int);
protected: protected:

View File

@ -39,9 +39,6 @@ PairRESquared::PairRESquared(LAMMPS *lmp) : Pair(lmp),
b_alpha(45.0/56.0), b_alpha(45.0/56.0),
cr60(pow(60.0,1.0/3.0)) cr60(pow(60.0,1.0/3.0))
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) error->all(FLERR,"Pair resquared requires atom style ellipsoid");
single_enable = 0; single_enable = 0;
cr60 = pow(60.0,1.0/3.0); cr60 = pow(60.0,1.0/3.0);
@ -321,6 +318,9 @@ void PairRESquared::coeff(int narg, char **arg)
void PairRESquared::init_style() void PairRESquared::init_style()
{ {
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) error->all(FLERR,"Pair resquared requires atom style ellipsoid");
neighbor->request(this); neighbor->request(this);
// per-type shape precalculations // per-type shape precalculations

View File

@ -33,9 +33,6 @@ using namespace LAMMPS_NS;
PairTriLJ::PairTriLJ(LAMMPS *lmp) : Pair(lmp) PairTriLJ::PairTriLJ(LAMMPS *lmp) : Pair(lmp)
{ {
avec = (AtomVecTri *) atom->style_match("tri");
if (!avec) error->all(FLERR,"Pair tri/lj requires atom style tri");
dmax = nmax = 0; dmax = nmax = 0;
discrete = NULL; discrete = NULL;
dnum = dfirst = NULL; dnum = dfirst = NULL;
@ -468,6 +465,18 @@ void PairTriLJ::coeff(int narg, char **arg)
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
} }
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
void PairTriLJ::init_style()
{
avec = (AtomVecTri *) atom->style_match("tri");
if (!avec) error->all(FLERR,"Pair tri/lj requires atom style tri");
neighbor->request(this);
}
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */

View File

@ -31,6 +31,7 @@ class PairTriLJ : public Pair {
virtual void compute(int, int); virtual void compute(int, int);
void settings(int, char **); void settings(int, char **);
void coeff(int, char **); void coeff(int, char **);
virtual void init_style();
double init_one(int, int); double init_one(int, int);
protected: protected: