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

This commit is contained in:
sjplimp 2011-09-23 18:06:55 +00:00
parent 2d99de131d
commit 19e8c92a90
468 changed files with 4628 additions and 5204 deletions

View File

@ -29,7 +29,7 @@ ComputeERotateAsphere::
ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg != 3) error->all("Illegal compute erotate/asphere command");
if (narg != 3) error->all(FLERR,"Illegal compute erotate/asphere command");
scalar_flag = 1;
extscalar = 1;
@ -38,7 +38,7 @@ ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all("Compute erotate/asphere requires atom style ellipsoid");
error->all(FLERR,"Compute erotate/asphere requires atom style ellipsoid");
}
/* ---------------------------------------------------------------------- */
@ -55,7 +55,7 @@ void ComputeERotateAsphere::init()
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (ellipsoid[i] < 0)
error->one("Compute erotate/asphere requires extended particles");
error->one(FLERR,"Compute erotate/asphere requires extended particles");
pfactor = 0.5 * force->mvv2e;
}

View File

@ -41,7 +41,7 @@ enum{ROTATE,ALL};
ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg < 3) error->all("Illegal compute temp/asphere command");
if (narg < 3) error->all(FLERR,"Illegal compute temp/asphere command");
scalar_flag = vector_flag = 1;
size_vector = 6;
@ -56,19 +56,19 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
int iarg = 3;
while (iarg < narg) {
if (strcmp(arg[iarg],"bias") == 0) {
if (iarg+2 > narg) error->all("Illegal compute temp/asphere command");
if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/asphere command");
tempbias = 1;
int n = strlen(arg[iarg+1]) + 1;
id_bias = new char[n];
strcpy(id_bias,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"dof") == 0) {
if (iarg+2 > narg) error->all("Illegal compute temp/asphere command");
if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/asphere command");
if (strcmp(arg[iarg+1],"rotate") == 0) mode = ROTATE;
else if (strcmp(arg[iarg+1],"all") == 0) mode = ALL;
else error->all("Illegal compute temp/asphere command");
else error->all(FLERR,"Illegal compute temp/asphere command");
iarg += 2;
} else error->all("Illegal compute temp/asphere command");
} else error->all(FLERR,"Illegal compute temp/asphere command");
}
vector = new double[6];
@ -77,7 +77,7 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all("Compute temp/asphere requires atom style ellipsoid");
error->all(FLERR,"Compute temp/asphere requires atom style ellipsoid");
}
/* ---------------------------------------------------------------------- */
@ -101,18 +101,18 @@ void ComputeTempAsphere::init()
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (ellipsoid[i] < 0)
error->one("Compute temp/asphere requires extended particles");
error->one(FLERR,"Compute temp/asphere requires extended particles");
if (tempbias) {
int i = modify->find_compute(id_bias);
if (i < 0) error->all("Could not find compute ID for temperature bias");
if (i < 0) error->all(FLERR,"Could not find compute ID for temperature bias");
tbias = modify->compute[i];
if (tbias->tempflag == 0)
error->all("Bias compute does not calculate temperature");
error->all(FLERR,"Bias compute does not calculate temperature");
if (tbias->tempbias == 0)
error->all("Bias compute does not calculate a velocity bias");
error->all(FLERR,"Bias compute does not calculate a velocity bias");
if (tbias->igroup != igroup)
error->all("Bias compute group does not match compute group");
error->all(FLERR,"Bias compute group does not match compute group");
tbias->init();
if (strcmp(tbias->style,"temp/region") == 0) tempbias = 2;
else tempbias = 1;

View File

@ -35,7 +35,7 @@ FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) :
{
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all("Compute nvt/nph/npt asphere requires atom style ellipsoid");
error->all(FLERR,"Compute nvt/nph/npt asphere requires atom style ellipsoid");
}
/* ---------------------------------------------------------------------- */
@ -52,7 +52,7 @@ void FixNHAsphere::init()
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (ellipsoid[i] < 0)
error->one("Fix nvt/nph/npt asphere requires extended particles");
error->one(FLERR,"Fix nvt/nph/npt asphere requires extended particles");
FixNH::init();
}

View File

@ -24,9 +24,9 @@ FixNPHAsphere::FixNPHAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphere(lmp, narg, arg)
{
if (tstat_flag)
error->all("Temperature control can not be used with fix nph/asphere");
error->all(FLERR,"Temperature control can not be used with fix nph/asphere");
if (!pstat_flag)
error->all("Pressure control must be used with fix nph/asphere");
error->all(FLERR,"Pressure control must be used with fix nph/asphere");
// create a new compute temp style
// id = fix-ID + temp

View File

@ -24,9 +24,9 @@ FixNPTAsphere::FixNPTAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphere(lmp, narg, arg)
{
if (!tstat_flag)
error->all("Temperature control must be used with fix npt/asphere");
error->all(FLERR,"Temperature control must be used with fix npt/asphere");
if (!pstat_flag)
error->all("Pressure control must be used with fix npt/asphere");
error->all(FLERR,"Pressure control must be used with fix npt/asphere");
// create a new compute temp style
// id = fix-ID + temp

View File

@ -38,7 +38,7 @@ FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) :
{
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all("Compute nve/asphere requires atom style ellipsoid");
error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid");
}
/* ---------------------------------------------------------------------- */
@ -55,7 +55,7 @@ void FixNVEAsphere::init()
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (ellipsoid[i] < 0)
error->one("Fix nve/asphere requires extended particles");
error->one(FLERR,"Fix nve/asphere requires extended particles");
FixNVE::init();
}

View File

@ -25,9 +25,9 @@ FixNVTAsphere::FixNVTAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphere(lmp, narg, arg)
{
if (!tstat_flag)
error->all("Temperature control must be used with fix nvt/asphere");
error->all(FLERR,"Temperature control must be used with fix nvt/asphere");
if (pstat_flag)
error->all("Pressure control can not be used with fix nvt/asphere");
error->all(FLERR,"Pressure control can not be used with fix nvt/asphere");
// create a new compute temp style
// id = fix-ID + temp

View File

@ -31,9 +31,6 @@
#include "memory.h"
#include "error.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
using namespace LAMMPS_NS;
enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
@ -43,7 +40,7 @@ enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
PairGayBerne::PairGayBerne(LAMMPS *lmp) : Pair(lmp)
{
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) error->all("Pair gayberne requires atom style ellipsoid");
if (!avec) error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
single_enable = 0;
}
@ -262,7 +259,7 @@ void PairGayBerne::allocate()
void PairGayBerne::settings(int narg, char **arg)
{
if (narg != 4) error->all("Illegal pair_style command");
if (narg != 4) error->all(FLERR,"Illegal pair_style command");
gamma = force->numeric(arg[0]);
upsilon = force->numeric(arg[1])/2.0;
@ -286,7 +283,7 @@ void PairGayBerne::settings(int narg, char **arg)
void PairGayBerne::coeff(int narg, char **arg)
{
if (narg < 10 || narg > 11)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -330,7 +327,7 @@ void PairGayBerne::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
@ -348,7 +345,7 @@ void PairGayBerne::init_style()
for (int i = 1; i <= atom->ntypes; i++) {
if (!atom->shape_consistency(i,shape1[i][0],shape1[i][1],shape1[i][2]))
error->all("Pair gayberne requires atoms with same type have same shape");
error->all(FLERR,"Pair gayberne requires atoms with same type have same shape");
if (shape1[i][0] == 0.0)
shape1[i][0] = shape1[i][1] = shape1[i][2] = 1.0;
shape2[i][0] = shape1[i][0]*shape1[i][0];
@ -366,7 +363,7 @@ void PairGayBerne::init_style()
double PairGayBerne::init_one(int i, int j)
{
if (setwell[i] == 0 || setwell[j] == 0)
error->all("Pair gayberne epsilon a,b,c coeffs are not all set");
error->all(FLERR,"Pair gayberne epsilon a,b,c coeffs are not all set");
if (setflag[i][j] == 0) {
epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
@ -545,7 +542,7 @@ double PairGayBerne::gayberne_analytic(const int i,const int j,double a1[3][3],
MathExtra::plus3(g1,g2,g12);
double kappa[3];
int ierror = MathExtra::mldivide3(g12,r12,kappa);
if (ierror) error->all("Bad matrix inversion in mldivide3");
if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
// tempv = G12^-1*r12hat
@ -576,7 +573,7 @@ double PairGayBerne::gayberne_analytic(const int i,const int j,double a1[3][3],
double iota[3];
MathExtra::plus3(b1,b2,b12);
ierror = MathExtra::mldivide3(b12,r12,iota);
if (ierror) error->all("Bad matrix inversion in mldivide3");
if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
// tempv = G12^-1*r12hat
@ -726,7 +723,7 @@ double PairGayBerne::gayberne_lj(const int i,const int j,double a1[3][3],
g12[1][2] = g1[1][2]; g12[2][1] = g1[2][1];
double kappa[3];
int ierror = MathExtra::mldivide3(g12,r12,kappa);
if (ierror) error->all("Bad matrix inversion in mldivide3");
if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
// tempv = G12^-1*r12hat
@ -762,7 +759,7 @@ double PairGayBerne::gayberne_lj(const int i,const int j,double a1[3][3],
b12[0][2] = b1[0][2]; b12[2][0] = b1[2][0];
b12[1][2] = b1[1][2]; b12[2][1] = b1[2][1];
ierror = MathExtra::mldivide3(b12,r12,iota);
if (ierror) error->all("Bad matrix inversion in mldivide3");
if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
// tempv = G12^-1*r12hat

View File

@ -31,9 +31,6 @@
#include "memory.h"
#include "error.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
using namespace LAMMPS_NS;
enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
@ -45,7 +42,7 @@ PairRESquared::PairRESquared(LAMMPS *lmp) : Pair(lmp),
cr60(pow(60.0,1.0/3.0))
{
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec) error->all("Pair resquared requires atom style ellipsoid");
if (!avec) error->all(FLERR,"Pair resquared requires atom style ellipsoid");
single_enable = 0;
@ -250,7 +247,7 @@ void PairRESquared::allocate()
void PairRESquared::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(arg[0]);
@ -271,7 +268,7 @@ void PairRESquared::settings(int narg, char **arg)
void PairRESquared::coeff(int narg, char **arg)
{
if (narg < 10 || narg > 11)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -315,7 +312,7 @@ void PairRESquared::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -331,7 +328,7 @@ void PairRESquared::init_style()
for (int i = 1; i <= atom->ntypes; i++) {
if (!atom->shape_consistency(i,shape1[i][0],shape1[i][1],shape1[i][2]))
error->all("Pair gayberne requires atoms with same type have same shape");
error->all(FLERR,"Pair gayberne requires atoms with same type have same shape");
if (setwell[i]) {
shape2[i][0] = shape1[i][0]*shape1[i][0];
shape2[i][1] = shape1[i][1]*shape1[i][1];
@ -348,7 +345,7 @@ void PairRESquared::init_style()
double PairRESquared::init_one(int i, int j)
{
if (setwell[i] == 0 || setwell[j] == 0)
error->all("Pair resquared epsilon a,b,c coeffs are not all set");
error->all(FLERR,"Pair resquared epsilon a,b,c coeffs are not all set");
int ishape = 0;
if (shape1[i][0] != 0.0 && shape1[i][1] != 0.0 && shape1[i][2] != 0.0)
@ -381,7 +378,7 @@ double PairRESquared::init_one(int i, int j)
sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
} else
error->all("Pair resquared epsilon and sigma coeffs are not all set");
error->all(FLERR,"Pair resquared epsilon and sigma coeffs are not all set");
}
epsilon[i][j] = epsilon[j][i];
sigma[i][j] = sigma[j][i];
@ -612,7 +609,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
double temp[3][3];
MathExtra::plus3(wi.gamma,wj.gamma,temp);
int ierror = MathExtra::mldivide3(temp,rhat,s);
if (ierror) error->all("Bad matrix inversion in mldivide3");
if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
sigma12 = 1.0/sqrt(0.5*MathExtra::dot3(s,rhat));
MathExtra::matvec(wi.A,rhat,z1);
@ -644,7 +641,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
MathExtra::times3(wj.aTe,wj.A,temp2);
MathExtra::plus3(temp,temp2,temp);
ierror = MathExtra::mldivide3(temp,rhat,w);
if (ierror) error->all("Bad matrix inversion in mldivide3");
if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
h12 = rnorm-sigma12;
eta = lambda/nu;
@ -898,7 +895,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
// energy
int ierror = MathExtra::mldivide3(gamma,rhat,s);
if (ierror) error->all("Bad matrix inversion in mldivide3");
if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
sigma12 = 1.0/sqrt(0.5*MathExtra::dot3(s,rhat));
double temp[3][3];
@ -907,7 +904,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
temp[1][1] += 1.0;
temp[2][2] += 1.0;
ierror = MathExtra::mldivide3(temp,rhat,w);
if (ierror) error->all("Bad matrix inversion in mldivide3");
if (ierror) error->all(FLERR,"Bad matrix inversion in mldivide3");
h12 = rnorm-sigma12;
chi = 2.0*MathExtra::dot3(rhat,w);

View File

@ -267,7 +267,7 @@ void AngleClass2::allocate()
void AngleClass2::coeff(int narg, char **arg)
{
if (narg < 2) error->all("Incorrect args for angle coefficients");
if (narg < 2) error->all(FLERR,"Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -276,7 +276,7 @@ void AngleClass2::coeff(int narg, char **arg)
int count = 0;
if (strcmp(arg[1],"bb") == 0) {
if (narg != 5) error->all("Incorrect args for angle coefficients");
if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients");
double bb_k_one = force->numeric(arg[2]);
double bb_r1_one = force->numeric(arg[3]);
@ -291,7 +291,7 @@ void AngleClass2::coeff(int narg, char **arg)
}
} else if (strcmp(arg[1],"ba") == 0) {
if (narg != 6) error->all("Incorrect args for angle coefficients");
if (narg != 6) error->all(FLERR,"Incorrect args for angle coefficients");
double ba_k1_one = force->numeric(arg[2]);
double ba_k2_one = force->numeric(arg[3]);
@ -308,7 +308,7 @@ void AngleClass2::coeff(int narg, char **arg)
}
} else {
if (narg != 5) error->all("Incorrect args for angle coefficients");
if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients");
double theta0_one = force->numeric(arg[1]);
double k2_one = force->numeric(arg[2]);
@ -327,7 +327,7 @@ void AngleClass2::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
for (int i = ilo; i <= ihi; i++)
if (setflag_a[i] == 1 && setflag_bb[i] == 1 && setflag_ba[i] == 1)

View File

@ -129,7 +129,7 @@ void BondClass2::allocate()
void BondClass2::coeff(int narg, char **arg)
{
if (narg != 5) error->all("Incorrect args for bond coefficients");
if (narg != 5) error->all(FLERR,"Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -150,7 +150,7 @@ void BondClass2::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------

View File

@ -31,9 +31,6 @@
using namespace LAMMPS_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
#define TOLERANCE 0.05
#define SMALL 0.0000001
@ -214,7 +211,7 @@ void DihedralClass2::compute(int eflag, int vflag)
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0);
error->warning(FLERR,str,0);
fprintf(screen," 1st atom: %d %g %g %g\n",
me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n",
@ -629,7 +626,7 @@ void DihedralClass2::allocate()
void DihedralClass2::coeff(int narg, char **arg)
{
if (narg < 2) error->all("Invalid coeffs for this dihedral style");
if (narg < 2) error->all(FLERR,"Invalid coeffs for this dihedral style");
if (!allocated) allocate();
int ilo,ihi;
@ -638,7 +635,7 @@ void DihedralClass2::coeff(int narg, char **arg)
int count = 0;
if (strcmp(arg[1],"mbt") == 0) {
if (narg != 6) error->all("Incorrect args for dihedral coefficients");
if (narg != 6) error->all(FLERR,"Incorrect args for dihedral coefficients");
double f1_one = force->numeric(arg[2]);
double f2_one = force->numeric(arg[3]);
@ -655,7 +652,7 @@ void DihedralClass2::coeff(int narg, char **arg)
}
} else if (strcmp(arg[1],"ebt") == 0) {
if (narg != 10) error->all("Incorrect args for dihedral coefficients");
if (narg != 10) error->all(FLERR,"Incorrect args for dihedral coefficients");
double f1_1_one = force->numeric(arg[2]);
double f2_1_one = force->numeric(arg[3]);
@ -680,7 +677,7 @@ void DihedralClass2::coeff(int narg, char **arg)
}
} else if (strcmp(arg[1],"at") == 0) {
if (narg != 10) error->all("Incorrect args for dihedral coefficients");
if (narg != 10) error->all(FLERR,"Incorrect args for dihedral coefficients");
double f1_1_one = force->numeric(arg[2]);
double f2_1_one = force->numeric(arg[3]);
@ -707,7 +704,7 @@ void DihedralClass2::coeff(int narg, char **arg)
}
} else if (strcmp(arg[1],"aat") == 0) {
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
double k_one = force->numeric(arg[2]);
double theta0_1_one = force->numeric(arg[3]);
@ -724,7 +721,7 @@ void DihedralClass2::coeff(int narg, char **arg)
}
} else if (strcmp(arg[1],"bb13") == 0) {
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
double k_one = force->numeric(arg[2]);
double r10_one = force->numeric(arg[3]);
@ -739,7 +736,7 @@ void DihedralClass2::coeff(int narg, char **arg)
}
} else {
if (narg != 7) error->all("Incorrect args for dihedral coefficients");
if (narg != 7) error->all(FLERR,"Incorrect args for dihedral coefficients");
double k1_one = force->numeric(arg[1]);
double phi1_one = force->numeric(arg[2]);
@ -762,7 +759,7 @@ void DihedralClass2::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
for (int i = ilo; i <= ihi; i++)
if (setflag_d[i] == 1 && setflag_mbt[i] == 1 && setflag_ebt[i] == 1 &&

View File

@ -162,7 +162,7 @@ void ImproperClass2::compute(int eflag, int vflag)
"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0);
error->warning(FLERR,str,0);
fprintf(screen," 1st atom: %d %g %g %g\n",
me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n",
@ -526,7 +526,7 @@ void ImproperClass2::allocate()
void ImproperClass2::coeff(int narg, char **arg)
{
if (narg < 2) error->all("Incorrect args for improper coefficients");
if (narg < 2) error->all(FLERR,"Incorrect args for improper coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -535,7 +535,7 @@ void ImproperClass2::coeff(int narg, char **arg)
int count = 0;
if (strcmp(arg[1],"aa") == 0) {
if (narg != 8) error->all("Incorrect args for improper coefficients");
if (narg != 8) error->all(FLERR,"Incorrect args for improper coefficients");
double k1_one = force->numeric(arg[2]);
double k2_one = force->numeric(arg[3]);
@ -558,7 +558,7 @@ void ImproperClass2::coeff(int narg, char **arg)
}
} else {
if (narg != 3) error->all("Incorrect args for improper coefficients");
if (narg != 3) error->all(FLERR,"Incorrect args for improper coefficients");
double k0_one = force->numeric(arg[1]);
double chi0_one = force->numeric(arg[2]);
@ -573,7 +573,7 @@ void ImproperClass2::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for improper coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for improper coefficients");
for (int i = ilo; i <= ihi; i++)
if (setflag_i[i] == 1 && setflag_aa[i] == 1) setflag[i] = 1;

View File

@ -24,9 +24,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PairLJClass2::PairLJClass2(LAMMPS *lmp) : Pair(lmp) {}
@ -161,7 +158,7 @@ void PairLJClass2::allocate()
void PairLJClass2::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(arg[0]);
@ -181,7 +178,7 @@ void PairLJClass2::settings(int narg, char **arg)
void PairLJClass2::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -205,7 +202,7 @@ void PairLJClass2::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------

View File

@ -25,9 +25,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PairLJClass2CoulCut::PairLJClass2CoulCut(LAMMPS *lmp) : Pair(lmp) {}
@ -187,7 +184,7 @@ void PairLJClass2CoulCut::allocate()
void PairLJClass2CoulCut::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul_global = cut_lj_global;
@ -212,7 +209,7 @@ void PairLJClass2CoulCut::settings(int narg, char **arg)
void PairLJClass2CoulCut::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 6) error->all("Incorrect args for pair coefficients");
if (narg < 4 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -239,7 +236,7 @@ void PairLJClass2CoulCut::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -249,7 +246,7 @@ void PairLJClass2CoulCut::coeff(int narg, char **arg)
void PairLJClass2CoulCut::init_style()
{
if (!atom->q_flag)
error->all("Pair style lj/class2/coul/cut requires atom attribute q");
error->all(FLERR,"Pair style lj/class2/coul/cut requires atom attribute q");
neighbor->request(this);
}

View File

@ -27,9 +27,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -202,7 +199,7 @@ void PairLJClass2CoulLong::allocate()
void PairLJClass2CoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
@ -224,7 +221,7 @@ void PairLJClass2CoulLong::settings(int narg, char **arg)
void PairLJClass2CoulLong::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 6) error->all("Incorrect args for pair coefficients");
if (narg < 4 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -248,7 +245,7 @@ void PairLJClass2CoulLong::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -258,7 +255,7 @@ void PairLJClass2CoulLong::coeff(int narg, char **arg)
void PairLJClass2CoulLong::init_style()
{
if (!atom->q_flag)
error->all("Pair style lj/class2/coul/long requires atom attribute q");
error->all(FLERR,"Pair style lj/class2/coul/long requires atom attribute q");
neighbor->request(this);
@ -267,7 +264,7 @@ void PairLJClass2CoulLong::init_style()
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
}

View File

@ -36,7 +36,7 @@ FixWallColloid::FixWallColloid(LAMMPS *lmp, int narg, char **arg) :
void FixWallColloid::init()
{
if (!atom->sphere_flag)
error->all("Fix wall/colloid requires atom style sphere");
error->all(FLERR,"Fix wall/colloid requires atom style sphere");
// insure all particles in group are extended particles
@ -51,7 +51,7 @@ void FixWallColloid::init()
int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall) error->all("Fix wall/colloid requires extended particles");
if (flagall) error->all(FLERR,"Fix wall/colloid requires extended particles");
FixWall::init();
}
@ -154,5 +154,5 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
ewall[m+1] += fwall;
}
if (onflag) error->one("Particle on or inside fix wall surface");
if (onflag) error->one(FLERR,"Particle on or inside fix wall surface");
}

View File

@ -30,9 +30,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
enum{SMALL_SMALL,SMALL_LARGE,LARGE_LARGE};
/* ---------------------------------------------------------------------- */
@ -144,7 +141,7 @@ void PairColloid::compute(int eflag, int vflag)
evdwl = 2.0/9.0*fR *
(1.0-(K[1]*(K[1]*(K[1]/3.0+3.0*K[2])+4.2*K[4])+K[2]*K[4]) *
sigma6[itype][jtype]/K[6]) - offset[itype][jtype];
if (rsq <= K[1]) error->one("Overlapping small/large in pair colloid");
if (rsq <= K[1]) error->one(FLERR,"Overlapping small/large in pair colloid");
break;
case LARGE_LARGE:
@ -182,7 +179,7 @@ void PairColloid::compute(int eflag, int vflag)
if (eflag)
evdwl += a12[itype][jtype]/6.0 *
(2.0*K[0]*(K[7]+K[8])-log(K[8]/K[7])) - offset[itype][jtype];
if (r <= K[1]) error->one("Overlapping large/large in pair colloid");
if (r <= K[1]) error->one(FLERR,"Overlapping large/large in pair colloid");
break;
}
@ -245,7 +242,7 @@ void PairColloid::allocate()
void PairColloid::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = force->numeric(arg[0]);
@ -265,7 +262,7 @@ void PairColloid::settings(int narg, char **arg)
void PairColloid::coeff(int narg, char **arg)
{
if (narg < 6 || narg > 7) error->all("Incorrect args for pair coefficients");
if (narg < 6 || narg > 7) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -281,7 +278,7 @@ void PairColloid::coeff(int narg, char **arg)
if (narg == 7) cut_one = force->numeric(arg[6]);
if (d1_one < 0.0 || d2_one < 0.0)
error->all("Invalid d1 or d2 value for pair colloid coeff");
error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff");
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -289,7 +286,7 @@ void PairColloid::coeff(int narg, char **arg)
a12[i][j] = a12_one;
sigma[i][j] = sigma_one;
if (i == j && d1_one != d2_one)
error->all("Invalid d1 or d2 value for pair colloid coeff");
error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff");
d1[i][j] = d1_one;
d2[i][j] = d2_one;
diameter[i][j] = 0.5*(d1_one+d2_one);
@ -299,7 +296,7 @@ void PairColloid::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------

View File

@ -34,9 +34,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PairLubricate::PairLubricate(LAMMPS *lmp) : Pair(lmp)
@ -305,7 +302,7 @@ void PairLubricate::allocate()
void PairLubricate::settings(int narg, char **arg)
{
if (narg != 9) error->all("Illegal pair_style command");
if (narg != 9) error->all(FLERR,"Illegal pair_style command");
mu = force->numeric(arg[0]);
flag1 = force->inumeric(arg[1]);
@ -319,7 +316,7 @@ void PairLubricate::settings(int narg, char **arg)
// initialize Marsaglia RNG with processor-unique seed
if (seed <= 0) error->all("Illegal pair_style command");
if (seed <= 0) error->all(FLERR,"Illegal pair_style command");
delete random;
random = new RanMars(lmp,seed + comm->me);
@ -343,7 +340,7 @@ void PairLubricate::settings(int narg, char **arg)
void PairLubricate::coeff(int narg, char **arg)
{
if (narg != 2 && narg != 4)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
@ -368,7 +365,7 @@ void PairLubricate::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -378,9 +375,9 @@ void PairLubricate::coeff(int narg, char **arg)
void PairLubricate::init_style()
{
if (!atom->sphere_flag)
error->all("Pair lubricate requires atom style sphere");
error->all(FLERR,"Pair lubricate requires atom style sphere");
if (comm->ghost_velocity == 0)
error->all("Pair lubricate requires ghost atoms store velocity");
error->all(FLERR,"Pair lubricate requires ghost atoms store velocity");
neighbor->request(this);
@ -390,9 +387,9 @@ void PairLubricate::init_style()
double rad,radtype;
for (int i = 1; i <= atom->ntypes; i++) {
if (!atom->radius_consistency(i,radtype))
error->all("Pair lubricate requires monodisperse particles");
error->all(FLERR,"Pair lubricate requires monodisperse particles");
if (i > 1 && radtype != rad)
error->all("Pair lubricate requires monodisperse particles");
error->all(FLERR,"Pair lubricate requires monodisperse particles");
rad = radtype;
}
}

View File

@ -122,7 +122,7 @@ void PairYukawaColloid::compute(int eflag, int vflag)
void PairYukawaColloid::init_style()
{
if (!atom->sphere_flag)
error->all("Pair yukawa/colloid requires atom style sphere");
error->all(FLERR,"Pair yukawa/colloid requires atom style sphere");
neighbor->request(this);
@ -130,7 +130,7 @@ void PairYukawaColloid::init_style()
for (int i = 1; i <= atom->ntypes; i++)
if (!atom->radius_consistency(i,rad[i]))
error->all("Pair yukawa/colloid requires atoms with same type "
error->all(FLERR,"Pair yukawa/colloid requires atoms with same type "
"have same radius");
}

View File

@ -60,7 +60,7 @@ void AtomVecDipole::grow(int n)
else nmax = n;
atom->nmax = nmax;
if (nmax < 0 || nmax > MAXSMALLINT)
error->one("Per-processor system is too big");
error->one(FLERR,"Per-processor system is too big");
tag = memory->grow(atom->tag,nmax,"atom:tag");
type = memory->grow(atom->type,nmax,"atom:type");
@ -762,11 +762,11 @@ void AtomVecDipole::data_atom(double *coord, int imagetmp, char **values)
tag[nlocal] = atoi(values[0]);
if (tag[nlocal] <= 0)
error->one("Invalid atom ID in Atoms section of data file");
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one("Invalid atom type in Atoms section of data file");
error->one(FLERR,"Invalid atom type in Atoms section of data file");
q[nlocal] = atof(values[2]);

View File

@ -24,9 +24,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PairDipoleCut::PairDipoleCut(LAMMPS *lmp) : Pair(lmp)
@ -294,7 +291,7 @@ void PairDipoleCut::allocate()
void PairDipoleCut::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2)
error->all("Incorrect args in pair_style command");
error->all(FLERR,"Incorrect args in pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul_global = cut_lj_global;
@ -320,7 +317,7 @@ void PairDipoleCut::settings(int narg, char **arg)
void PairDipoleCut::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 6)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -347,7 +344,7 @@ void PairDipoleCut::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -357,7 +354,7 @@ void PairDipoleCut::coeff(int narg, char **arg)
void PairDipoleCut::init_style()
{
if (!atom->q_flag || !atom->mu_flag || !atom->torque_flag)
error->all("Pair dipole/cut requires atom attributes q, mu, torque");
error->all(FLERR,"Pair dipole/cut requires atom attributes q, mu, torque");
neighbor->request(this);
}

View File

@ -43,10 +43,10 @@ extern double lmp_gpu_forces(double **f, double **tor, double *eatom,
FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (lmp->cuda) error->all("Cannot use fix GPU with USER-CUDA mode enabled");
if (lmp->cuda) error->all(FLERR,"Cannot use fix GPU with USER-CUDA mode enabled");
if (narg < 7) error->all("Illegal fix GPU command");
if (strcmp(arg[1],"all") != 0) error->all("Illegal fix GPU command");
if (narg < 7) error->all(FLERR,"Illegal fix GPU command");
if (strcmp(arg[1],"all") != 0) error->all(FLERR,"Illegal fix GPU command");
int first_gpu, last_gpu;
@ -55,16 +55,16 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
else if (strcmp(arg[3],"force/neigh") == 0) {
_gpu_mode = GPU_NEIGH;
if (domain->triclinic)
error->all("Cannot use force/neigh with triclinic box");
error->all(FLERR,"Cannot use force/neigh with triclinic box");
} else
error->all("Illegal fix GPU command");
error->all(FLERR,"Illegal fix GPU command");
first_gpu = atoi(arg[4]);
last_gpu = atoi(arg[5]);
_particle_split = force->numeric(arg[6]);
if (_particle_split==0 || _particle_split>1)
error->all("Illegal fix GPU command");
error->all(FLERR,"Illegal fix GPU command");
int nthreads = 1;
int threads_per_atom = -1;
@ -74,16 +74,16 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
else if (strcmp(arg[7],"nthreads") == 0)
nthreads = atoi(arg[8]);
else
error->all("Illegal fix GPU command");
error->all(FLERR,"Illegal fix GPU command");
} else if (narg != 7)
error->all("Illegal fix GPU command");
error->all(FLERR,"Illegal fix GPU command");
if (nthreads < 1)
error->all("Illegal fix GPU command");
error->all(FLERR,"Illegal fix GPU command");
#ifndef _OPENMP
if (nthreads > 1)
error->all("No OpenMP support compiled in");
error->all(FLERR,"No OpenMP support compiled in");
#endif
int gpu_flag = lmp_init_device(universe->uworld, world, first_gpu, last_gpu,
@ -115,16 +115,16 @@ void FixGPU::init()
{
// Can only have 1 gpu fix that must be the first fix for a run
if ((void*)modify->fix[0] != (void*)this)
error->all("GPU is not the first fix for this run");
error->all(FLERR,"GPU is not the first fix for this run");
// Hybrid cannot be used with force/neigh option
if (_gpu_mode == GPU_NEIGH)
if (force->pair_match("hybrid",1) != NULL ||
force->pair_match("hybrid/overlay",1) != NULL)
error->all("Cannot use pair hybrid with GPU neighbor builds");
error->all(FLERR,"Cannot use pair hybrid with GPU neighbor builds");
if (_particle_split < 0)
if (force->pair_match("hybrid",1) != NULL ||
force->pair_match("hybrid/overlay",1) != NULL)
error->all("Fix GPU split must be positive for hybrid pair styles");
error->all(FLERR,"Fix GPU split must be positive for hybrid pair styles");
}
/* ---------------------------------------------------------------------- */

View File

@ -28,17 +28,19 @@ namespace GPU_EXTRA {
MPI_Allreduce(&error_flag, &all_success, 1, MPI_INT, MPI_MIN, world);
if (all_success != 0) {
if (all_success == -1)
error->all("Accelerated style in input script but no fix gpu");
error->all(FLERR,"Accelerated style in input script but no fix gpu");
else if (all_success == -2)
error->all("Could not find/initialize a specified accelerator device");
error->all(FLERR,
"Could not find/initialize a specified accelerator device");
else if (all_success == -3)
error->all("Insufficient memory on accelerator");
error->all(FLERR,"Insufficient memory on accelerator");
else if (all_success == -4)
error->all("GPU library not compiled for this accelerator");
error->all(FLERR,"GPU library not compiled for this accelerator");
else if (all_success == -5)
error->all("Double precision is not supported on this accelerator");
error->all(FLERR,
"Double precision is not supported on this accelerator");
else
error->all("Unknown error in GPU library");
error->all(FLERR,"Unknown error in GPU library");
}
}

View File

@ -37,9 +37,6 @@
#include "kspace.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -126,7 +123,7 @@ void PairCGCMMCoulLongGPU::compute(int eflag, int vflag)
atom->nlocal, domain->boxlo, domain->prd);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -144,9 +141,9 @@ void PairCGCMMCoulLongGPU::init_style()
cut_respa = NULL;
if (!atom->q_flag)
error->all("Pair style cg/cmm/coul/long/gpu requires atom attribute q");
error->all(FLERR,"Pair style cg/cmm/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all("Cannot use newton pair with cg/cmm/coul/long/gpu pair style");
error->all(FLERR,"Cannot use newton pair with cg/cmm/coul/long/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;
@ -168,7 +165,7 @@ void PairCGCMMCoulLongGPU::init_style()
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables

View File

@ -16,19 +16,17 @@
Contributing author: Mike Brown <brownw@ornl.gov>
------------------------------------------------------------------------- */
#include "string.h"
#include "pair_cg_cmm_coul_msm.h"
#include "memory.h"
#include "atom.h"
#include "force.h"
#include "kspace.h"
#include "string.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
enum {C3=0,C4=1};
using namespace LAMMPS_NS;
enum {C3=0,C4=1};
/* ---------------------------------------------------------------------- */
PairCGCMMCoulMSM::PairCGCMMCoulMSM(LAMMPS *lmp) : PairCMMCommon(lmp)
@ -73,13 +71,13 @@ void PairCGCMMCoulMSM::settings(int narg, char **arg)
{
// strip off smoothing type and send args to parent
if (narg < 1) error->all("Illegal pair_style command");
if (narg < 1) error->all(FLERR,"Illegal pair_style command");
if (strcmp(arg[0],"C3") == 0)
_smooth = C3;
else if (strcmp(arg[0],"C4") == 0)
_smooth = C4;
else error->all("Illegal pair_style command");
else error->all(FLERR,"Illegal pair_style command");
PairCMMCommon::settings(narg-1,&arg[1]);
}
@ -89,7 +87,7 @@ void PairCGCMMCoulMSM::settings(int narg, char **arg)
void PairCGCMMCoulMSM::init_style()
{
if (!atom->q_flag)
error->all("Pair style cg/cut/coul/msm requires atom attribute q");
error->all(FLERR,"Pair style cg/cut/coul/msm requires atom attribute q");
PairCMMCommon::init_style();
_ia=-1.0/cut_coul_global;

View File

@ -36,10 +36,6 @@
#include "kspace.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
enum {C3=0,C4=1};
// External functions from cuda library for atom decomposition
int cmmm_gpu_init(const int ntypes, double **cutsq, int **cg_type,
@ -69,6 +65,8 @@ double cmmm_gpu_bytes();
using namespace LAMMPS_NS;
enum {C3=0,C4=1};
/* ---------------------------------------------------------------------- */
PairCGCMMCoulMSMGPU::PairCGCMMCoulMSMGPU(LAMMPS *lmp) : PairCGCMMCoulMSM(lmp),
@ -119,7 +117,7 @@ void PairCGCMMCoulMSMGPU::compute(int eflag, int vflag)
atom->nlocal, domain->boxlo, domain->prd);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -136,7 +134,7 @@ void PairCGCMMCoulMSMGPU::init_style()
{
PairCGCMMCoulMSM::init_style();
if (force->newton_pair)
error->all("Cannot use newton pair with cg/cmm/coul/msm/gpu pair style");
error->all(FLERR,"Cannot use newton pair with cg/cmm/coul/msm/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -36,9 +36,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int cmm_gpu_init(const int ntypes, double **cutsq, int **cg_types,
@ -111,7 +108,7 @@ void PairCGCMMGPU::compute(int eflag, int vflag)
vflag_atom, host_start, cpu_time, success);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -129,7 +126,7 @@ void PairCGCMMGPU::init_style()
cut_respa = NULL;
if (force->newton_pair)
error->all("Cannot use newton pair with GPU CGCMM pair style");
error->all(FLERR,"Cannot use newton pair with GPU CGCMM pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -37,9 +37,6 @@
#include "kspace.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -123,7 +120,7 @@ void PairCoulLongGPU::compute(int eflag, int vflag)
atom->nlocal, domain->boxlo, domain->prd);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -141,9 +138,9 @@ void PairCoulLongGPU::init_style()
cut_respa = NULL;
if (!atom->q_flag)
error->all("Pair style coul/long/gpu requires atom attribute q");
error->all(FLERR,"Pair style coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all("Cannot use newton pair with coul/long/gpu pair style");
error->all(FLERR,"Cannot use newton pair with coul/long/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double cell_size = sqrt(cut_coul) + neighbor->skin;
@ -153,7 +150,7 @@ void PairCoulLongGPU::init_style()
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables

View File

@ -38,9 +38,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int gb_gpu_init(const int ntypes, const double gamma, const double upsilon,
@ -77,7 +74,7 @@ PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp),
{
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all("Pair gayberne requires atom style ellipsoid");
error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
quat_nmax = 0;
quat = NULL;
}
@ -140,7 +137,7 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
cpu_time, success, quat);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start < inum) {
cpu_time = MPI_Wtime();
@ -156,9 +153,9 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
void PairGayBerneGPU::init_style()
{
if (force->newton_pair)
error->all("Cannot use newton pair with gayberne/gpu pair style");
error->all(FLERR,"Cannot use newton pair with gayberne/gpu pair style");
if (!atom->ellipsoid_flag)
error->all("Pair gayberne/gpu requires atom style ellipsoid");
error->all(FLERR,"Pair gayberne/gpu requires atom style ellipsoid");
// per-type shape precalculations
// require that atom shapes are identical within each type
@ -166,7 +163,7 @@ void PairGayBerneGPU::init_style()
for (int i = 1; i <= atom->ntypes; i++) {
if (!atom->shape_consistency(i,shape1[i][0],shape1[i][1],shape1[i][2]))
error->all("Pair gayberne/gpu requires atoms with same type have same shape");
error->all(FLERR,"Pair gayberne/gpu requires atoms with same type have same shape");
if (shape1[i][0] == 0.0)
shape1[i][0] = shape1[i][1] = shape1[i][2] = 1.0;
shape2[i][0] = shape1[i][0]*shape1[i][0];

View File

@ -36,9 +36,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int lj96_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@ -110,7 +107,7 @@ void PairLJ96CutGPU::compute(int eflag, int vflag)
vflag_atom, host_start, cpu_time, success);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -128,7 +125,7 @@ void PairLJ96CutGPU::init_style()
cut_respa = NULL;
if (force->newton_pair)
error->all("Cannot use newton pair with lj96/cut/gpu pair style");
error->all(FLERR,"Cannot use newton pair with lj96/cut/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -37,9 +37,6 @@
#include "kspace.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -129,7 +126,7 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag)
atom->nlocal, domain->boxlo, domain->prd);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -147,9 +144,9 @@ void PairLJCharmmCoulLongGPU::init_style()
cut_respa = NULL;
if (!atom->q_flag)
error->all("Pair style lj/charmm/coul/long/gpu requires atom attribute q");
error->all(FLERR,"Pair style lj/charmm/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all("Cannot use newton pair with lj/charmm/coul/long/gpu pair style");
error->all(FLERR,"Cannot use newton pair with lj/charmm/coul/long/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double cut;
@ -173,7 +170,7 @@ void PairLJCharmmCoulLongGPU::init_style()
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables

View File

@ -37,9 +37,6 @@
#include "kspace.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -126,7 +123,7 @@ void PairLJClass2CoulLongGPU::compute(int eflag, int vflag)
atom->nlocal, domain->boxlo, domain->prd);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -142,9 +139,9 @@ void PairLJClass2CoulLongGPU::compute(int eflag, int vflag)
void PairLJClass2CoulLongGPU::init_style()
{
if (!atom->q_flag)
error->all("Pair style lj/class2/coul/long/gpu requires atom attribute q");
error->all(FLERR,"Pair style lj/class2/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all("Cannot use newton pair with lj/class2/coul/long/gpu pair style");
error->all(FLERR,"Cannot use newton pair with lj/class2/coul/long/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;
@ -168,7 +165,7 @@ void PairLJClass2CoulLongGPU::init_style()
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
int maxspecial=0;

View File

@ -36,9 +36,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int lj96_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@ -109,7 +106,7 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
vflag_atom, host_start, cpu_time, success);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -125,7 +122,7 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
void PairLJClass2GPU::init_style()
{
if (force->newton_pair)
error->all("Cannot use newton pair with lj/class2/gpu pair style");
error->all(FLERR,"Cannot use newton pair with lj/class2/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -36,9 +36,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int ljc_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@ -117,7 +114,7 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
atom->nlocal, domain->boxlo, domain->prd);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -133,10 +130,10 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
void PairLJCutCoulCutGPU::init_style()
{
if (!atom->q_flag)
error->all("Pair style lj/cut/coul/cut/gpu requires atom attribute q");
error->all(FLERR,"Pair style lj/cut/coul/cut/gpu requires atom attribute q");
if (force->newton_pair)
error->all("Cannot use newton pair with lj/cut/coul/cut/gpu pair style");
error->all(FLERR,"Cannot use newton pair with lj/cut/coul/cut/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -37,9 +37,6 @@
#include "kspace.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -127,7 +124,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag)
atom->nlocal, domain->boxlo, domain->prd);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -145,9 +142,9 @@ void PairLJCutCoulLongGPU::init_style()
cut_respa = NULL;
if (!atom->q_flag)
error->all("Pair style lj/cut/coul/long/gpu requires atom attribute q");
error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q");
if (force->newton_pair)
error->all("Cannot use newton pair with lj/cut/could/cut/gpu pair style");
error->all(FLERR,"Cannot use newton pair with lj/cut/could/cut/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;
@ -171,7 +168,7 @@ void PairLJCutCoulLongGPU::init_style()
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables

View File

@ -36,9 +36,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@ -110,7 +107,7 @@ void PairLJCutGPU::compute(int eflag, int vflag)
vflag_atom, host_start, cpu_time, success);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -128,7 +125,7 @@ void PairLJCutGPU::init_style()
cut_respa = NULL;
if (force->newton_pair)
error->all("Cannot use newton pair with lj/cut/gpu pair style");
error->all(FLERR,"Cannot use newton pair with lj/cut/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -35,9 +35,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@ -115,7 +112,7 @@ void PairLJCutTGPU::compute(int eflag, int vflag)
vflag_atom, host_start, cpu_time, success);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -140,7 +137,7 @@ void PairLJCutTGPU::init_style()
cut_respa = NULL;
if (force->newton_pair)
error->all("Cannot use newton pair with lj/cut/tgpu pair style");
error->all(FLERR,"Cannot use newton pair with lj/cut/tgpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -36,9 +36,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int lje_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
@ -111,7 +108,7 @@ void PairLJExpandGPU::compute(int eflag, int vflag)
vflag_atom, host_start, cpu_time, success);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -127,7 +124,7 @@ void PairLJExpandGPU::compute(int eflag, int vflag)
void PairLJExpandGPU::init_style()
{
if (force->newton_pair)
error->all("Cannot use newton pair with lj/expand/gpu pair style");
error->all(FLERR,"Cannot use newton pair with lj/expand/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -36,9 +36,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int mor_gpu_init(const int ntypes, double **cutsq, double **host_morse1,
@ -109,7 +106,7 @@ void PairMorseGPU::compute(int eflag, int vflag)
vflag_atom, host_start, cpu_time, success);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start<inum) {
cpu_time = MPI_Wtime();
@ -125,7 +122,7 @@ void PairMorseGPU::compute(int eflag, int vflag)
void PairMorseGPU::init_style()
{
if (force->newton_pair)
error->all("Cannot use newton pair with morse/gpu pair style");
error->all(FLERR,"Cannot use newton pair with morse/gpu pair style");
// Repeat cutsq calculation because done after call to init_style
double maxcut = -1.0;

View File

@ -38,9 +38,6 @@
#include "string.h"
#include "gpu_extra.h"
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
int re_gpu_init(const int ntypes, double **shape, double **well,
@ -76,7 +73,7 @@ PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp),
{
avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
if (!avec)
error->all("Pair gayberne requires atom style ellipsoid");
error->all(FLERR,"Pair gayberne requires atom style ellipsoid");
quat_nmax = 0;
quat = NULL;
}
@ -139,7 +136,7 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
cpu_time, success, quat);
}
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (host_start < inum) {
cpu_time = MPI_Wtime();
@ -155,9 +152,9 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
void PairRESquaredGPU::init_style()
{
if (force->newton_pair)
error->all("Cannot use newton pair with resquared/gpu pair style");
error->all(FLERR,"Cannot use newton pair with resquared/gpu pair style");
if (!atom->ellipsoid_flag)
error->all("Pair resquared/gpu requires atom style ellipsoid");
error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid");
// per-type shape precalculations
// require that atom shapes are identical within each type
@ -165,7 +162,7 @@ void PairRESquaredGPU::init_style()
for (int i = 1; i <= atom->ntypes; i++) {
if (!atom->shape_consistency(i,shape1[i][0],shape1[i][1],shape1[i][2]))
error->all("Pair resquared/gpu requires atoms with same type have same shape");
error->all(FLERR,"Pair resquared/gpu requires atoms with same type have same shape");
if (setwell[i]) {
shape2[i][0] = shape1[i][0]*shape1[i][0];
shape2[i][1] = shape1[i][1]*shape1[i][1];

View File

@ -52,9 +52,6 @@ using namespace LAMMPS_NS;
#define ONEF 1.0
#endif
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
// External functions from cuda library for atom decomposition
#ifdef FFT_SINGLE
@ -82,7 +79,7 @@ double PPPM_GPU_API(bytes)();
PPPMGPU::PPPMGPU(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
{
if (narg != 1) error->all("Illegal kspace_style pppm/gpu command");
if (narg != 1) error->all(FLERR,"Illegal kspace_style pppm/gpu command");
density_brick_gpu = vd_brick = NULL;
}
@ -106,7 +103,7 @@ void PPPMGPU::init()
// GPU precision specific init.
if (order>8)
error->all("Cannot use order greater than 8 with pppm/gpu.");
error->all(FLERR,"Cannot use order greater than 8 with pppm/gpu.");
PPPM_GPU_API(clear)(poisson_time);
int success;
@ -140,9 +137,9 @@ void PPPMGPU::compute(int eflag, int vflag)
atom->q, domain->boxlo, delxinv, delyinv,
delzinv);
if (!success)
error->one("Out of memory on GPGPU");
error->one(FLERR,"Out of memory on GPGPU");
if (flag != 0)
error->one("Out of range atoms - cannot compute PPPM");
error->one(FLERR,"Out of range atoms - cannot compute PPPM");
int i;

View File

@ -27,10 +27,10 @@ using namespace LAMMPS_NS;
FixFreeze::FixFreeze(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg != 3) error->all("Illegal fix freeze command");
if (narg != 3) error->all(FLERR,"Illegal fix freeze command");
if (!atom->torque_flag)
error->all("Fix freeze requires atom attribute torque");
error->all(FLERR,"Fix freeze requires atom attribute torque");
vector_flag = 1;
size_vector = 3;
@ -61,7 +61,7 @@ void FixFreeze::init()
int count = 0;
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"freeze") == 0) count++;
if (count > 1) error->all("More than one fix freeze");
if (count > 1) error->all(FLERR,"More than one fix freeze");
}
/* ---------------------------------------------------------------------- */

View File

@ -39,12 +39,12 @@ using namespace LAMMPS_NS;
FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 6) error->all("Illegal fix pour command");
if (narg < 6) error->all(FLERR,"Illegal fix pour command");
time_depend = 1;
if (!atom->radius_flag || !atom->rmass_flag)
error->all("Fix pour requires atom attributes radius, rmass");
error->all(FLERR,"Fix pour requires atom attributes radius, rmass");
// required args
@ -52,7 +52,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
ntype = atoi(arg[4]);
seed = atoi(arg[5]);
if (seed <= 0) error->all("Illegal fix pour command");
if (seed <= 0) error->all(FLERR,"Illegal fix pour command");
PI = 4.0*atan(1.0);
@ -71,32 +71,32 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
int iarg = 6;
while (iarg < narg) {
if (strcmp(arg[iarg],"region") == 0) {
if (iarg+2 > narg) error->all("Illegal fix pour command");
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
iregion = domain->find_region(arg[iarg+1]);
if (iregion == -1) error->all("Fix pour region ID does not exist");
if (iregion == -1) error->all(FLERR,"Fix pour region ID does not exist");
iarg += 2;
} else if (strcmp(arg[iarg],"diam") == 0) {
if (iarg+3 > narg) error->all("Illegal fix pour command");
if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
radius_lo = 0.5 * atof(arg[iarg+1]);
radius_hi = 0.5 * atof(arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"dens") == 0) {
if (iarg+3 > narg) error->all("Illegal fix pour command");
if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
density_lo = atof(arg[iarg+1]);
density_hi = atof(arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"vol") == 0) {
if (iarg+3 > narg) error->all("Illegal fix pour command");
if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command");
volfrac = atof(arg[iarg+1]);
maxattempt = atoi(arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"rate") == 0) {
if (iarg+2 > narg) error->all("Illegal fix pour command");
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command");
rate = atof(arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"vel") == 0) {
if (domain->dimension == 3) {
if (iarg+6 > narg) error->all("Illegal fix pour command");
if (iarg+6 > narg) error->all(FLERR,"Illegal fix pour command");
vxlo = atof(arg[iarg+1]);
vxhi = atof(arg[iarg+2]);
vylo = atof(arg[iarg+3]);
@ -104,23 +104,23 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
vz = atof(arg[iarg+5]);
iarg += 6;
} else {
if (iarg+4 > narg) error->all("Illegal fix pour command");
if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command");
vxlo = atof(arg[iarg+1]);
vxhi = atof(arg[iarg+2]);
vy = atof(arg[iarg+3]);
vz = 0.0;
iarg += 4;
}
} else error->all("Illegal fix pour command");
} else error->all(FLERR,"Illegal fix pour command");
}
// error checks on region and its extent being inside simulation box
if (iregion == -1) error->all("Must specify a region in fix pour");
if (iregion == -1) error->all(FLERR,"Must specify a region in fix pour");
if (domain->regions[iregion]->bboxflag == 0)
error->all("Fix pour region does not support a bounding box");
error->all(FLERR,"Fix pour region does not support a bounding box");
if (domain->regions[iregion]->dynamic_check())
error->all("Fix pour region cannot be dynamic");
error->all(FLERR,"Fix pour region cannot be dynamic");
if (strcmp(domain->regions[iregion]->style,"block") == 0) {
region_style = 1;
@ -133,7 +133,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] ||
ylo < domain->boxlo[1] || yhi > domain->boxhi[1] ||
zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
error->all("Insertion region extends outside simulation box");
error->all(FLERR,"Insertion region extends outside simulation box");
} else if (strcmp(domain->regions[iregion]->style,"cylinder") == 0) {
region_style = 2;
char axis = ((RegCylinder *) domain->regions[iregion])->axis;
@ -143,15 +143,15 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
zlo = ((RegCylinder *) domain->regions[iregion])->lo;
zhi = ((RegCylinder *) domain->regions[iregion])->hi;
if (axis != 'z')
error->all("Must use a z-axis cylinder with fix pour");
error->all(FLERR,"Must use a z-axis cylinder with fix pour");
if (xc-rc < domain->boxlo[0] || xc+rc > domain->boxhi[0] ||
yc-rc < domain->boxlo[1] || yc+rc > domain->boxhi[1] ||
zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
error->all("Insertion region extends outside simulation box");
} else error->all("Must use a block or cylinder region with fix pour");
error->all(FLERR,"Insertion region extends outside simulation box");
} else error->all(FLERR,"Must use a block or cylinder region with fix pour");
if (region_style == 2 && domain->dimension == 2)
error->all("Must use a block region with fix pour for 2d simulations");
error->all(FLERR,"Must use a block region with fix pour for 2d simulations");
// random number generator, same for all procs
@ -171,7 +171,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
for (ifix = 0; ifix < modify->nfix; ifix++)
if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
if (ifix == modify->nfix)
error->all("No fix gravity defined for fix pour");
error->all(FLERR,"No fix gravity defined for fix pour");
grav = - ((FixGravity *) modify->fix[ifix])->magnitude * force->ftm2v;
// nfreq = timesteps between insertions
@ -260,7 +260,7 @@ int FixPour::setmask()
void FixPour::init()
{
if (domain->triclinic) error->all("Cannot use fix pour with triclinic box");
if (domain->triclinic) error->all(FLERR,"Cannot use fix pour with triclinic box");
// insure gravity fix exists
// for 3d must point in -z, for 2d must point in -y
@ -270,7 +270,7 @@ void FixPour::init()
for (ifix = 0; ifix < modify->nfix; ifix++)
if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
if (ifix == modify->nfix)
error->all("No fix gravity defined for fix pour");
error->all(FLERR,"No fix gravity defined for fix pour");
double xgrav = ((FixGravity *) modify->fix[ifix])->xgrav;
double ygrav = ((FixGravity *) modify->fix[ifix])->ygrav;
@ -279,16 +279,16 @@ void FixPour::init()
if (domain->dimension == 3) {
if (fabs(xgrav) > EPSILON || fabs(ygrav) > EPSILON ||
fabs(zgrav+1.0) > EPSILON)
error->all("Gravity must point in -z to use with fix pour in 3d");
error->all(FLERR,"Gravity must point in -z to use with fix pour in 3d");
} else {
if (fabs(xgrav) > EPSILON || fabs(ygrav+1.0) > EPSILON ||
fabs(zgrav) > EPSILON)
error->all("Gravity must point in -y to use with fix pour in 2d");
error->all(FLERR,"Gravity must point in -y to use with fix pour in 2d");
}
double gnew = - ((FixGravity *) modify->fix[ifix])->magnitude * force->ftm2v;
if (gnew != grav)
error->all("Gravity changed since fix pour was created");
error->all(FLERR,"Gravity changed since fix pour was created");
}
/* ----------------------------------------------------------------------
@ -415,7 +415,7 @@ void FixPour::pre_exchange()
ninserted += nnear-nprevious;
if (nnear - nprevious < nnew && me == 0)
error->warning("Less insertions than requested",0);
error->warning(FLERR,"Less insertions than requested",0);
// check if new atom is in my sub-box or above it if I'm highest proc
// if so, add to my list via create_atom()
@ -573,5 +573,5 @@ void FixPour::xyz_random(double h, double *coord)
void FixPour::reset_dt()
{
error->all("Cannot change timestep with fix pour");
error->all(FLERR,"Cannot change timestep with fix pour");
}

View File

@ -36,18 +36,15 @@ enum{HOOKE,HOOKE_HISTORY,HERTZ_HISTORY};
#define BIG 1.0e20
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
/* ---------------------------------------------------------------------- */
FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 10) error->all("Illegal fix wall/gran command");
if (narg < 10) error->all(FLERR,"Illegal fix wall/gran command");
if (!atom->sphere_flag)
error->all("Fix wall/gran requires atom style sphere");
error->all(FLERR,"Fix wall/gran requires atom style sphere");
restart_peratom = 1;
create_attribute = 1;
@ -69,7 +66,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
error->all("Illegal fix wall/gran command");
error->all(FLERR,"Illegal fix wall/gran command");
// convert Kn and Kt from pressure units to force/distance^2 if Hertzian
@ -82,7 +79,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
int iarg = 9;
if (strcmp(arg[iarg],"xplane") == 0) {
if (narg < iarg+3) error->all("Illegal fix wall/gran command");
if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command");
wallstyle = XPLANE;
if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG;
else lo = atof(arg[iarg+1]);
@ -90,7 +87,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
else hi = atof(arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"yplane") == 0) {
if (narg < iarg+3) error->all("Illegal fix wall/gran command");
if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command");
wallstyle = YPLANE;
if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG;
else lo = atof(arg[iarg+1]);
@ -98,7 +95,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
else hi = atof(arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"zplane") == 0) {
if (narg < iarg+3) error->all("Illegal fix wall/gran command");
if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command");
wallstyle = ZPLANE;
if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG;
else lo = atof(arg[iarg+1]);
@ -106,7 +103,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
else hi = atof(arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"zcylinder") == 0) {
if (narg < iarg+2) error->all("Illegal fix wall/gran command");
if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command");
wallstyle = ZCYLINDER;
lo = hi = 0.0;
cylradius = atof(arg[iarg+1]);
@ -120,45 +117,45 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
while (iarg < narg) {
if (strcmp(arg[iarg],"wiggle") == 0) {
if (iarg+4 > narg) error->all("Illegal fix wall/gran command");
if (iarg+4 > narg) error->all(FLERR,"Illegal fix wall/gran command");
if (strcmp(arg[iarg+1],"x") == 0) axis = 0;
else if (strcmp(arg[iarg+1],"y") == 0) axis = 1;
else if (strcmp(arg[iarg+1],"z") == 0) axis = 2;
else error->all("Illegal fix wall/gran command");
else error->all(FLERR,"Illegal fix wall/gran command");
amplitude = atof(arg[iarg+2]);
period = atof(arg[iarg+3]);
wiggle = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"shear") == 0) {
if (iarg+3 > narg) error->all("Illegal fix wall/gran command");
if (iarg+3 > narg) error->all(FLERR,"Illegal fix wall/gran command");
if (strcmp(arg[iarg+1],"x") == 0) axis = 0;
else if (strcmp(arg[iarg+1],"y") == 0) axis = 1;
else if (strcmp(arg[iarg+1],"z") == 0) axis = 2;
else error->all("Illegal fix wall/gran command");
else error->all(FLERR,"Illegal fix wall/gran command");
vshear = atof(arg[iarg+2]);
wshear = 1;
iarg += 3;
} else error->all("Illegal fix wall/gran command");
} else error->all(FLERR,"Illegal fix wall/gran command");
}
if (wallstyle == XPLANE && domain->xperiodic)
error->all("Cannot use wall in periodic dimension");
error->all(FLERR,"Cannot use wall in periodic dimension");
if (wallstyle == YPLANE && domain->yperiodic)
error->all("Cannot use wall in periodic dimension");
error->all(FLERR,"Cannot use wall in periodic dimension");
if (wallstyle == ZPLANE && domain->zperiodic)
error->all("Cannot use wall in periodic dimension");
error->all(FLERR,"Cannot use wall in periodic dimension");
if (wallstyle == ZCYLINDER && (domain->xperiodic || domain->yperiodic))
error->all("Cannot use wall in periodic dimension");
error->all(FLERR,"Cannot use wall in periodic dimension");
if (wiggle && wshear) error->all("Cannot wiggle and shear fix wall/gran");
if (wiggle && wshear) error->all(FLERR,"Cannot wiggle and shear fix wall/gran");
if (wiggle && wallstyle == ZCYLINDER && axis != 2)
error->all("Invalid wiggle direction for fix wall/gran");
error->all(FLERR,"Invalid wiggle direction for fix wall/gran");
if (wshear && wallstyle == XPLANE && axis == 0)
error->all("Invalid shear direction for fix wall/gran");
error->all(FLERR,"Invalid shear direction for fix wall/gran");
if (wshear && wallstyle == YPLANE && axis == 1)
error->all("Invalid shear direction for fix wall/gran");
error->all(FLERR,"Invalid shear direction for fix wall/gran");
if (wshear && wallstyle == ZPLANE && axis == 2)
error->all("Invalid shear direction for fix wall/gran");
error->all(FLERR,"Invalid shear direction for fix wall/gran");
// setup oscillations
@ -226,7 +223,7 @@ void FixWallGran::init()
pairstyle = HOOKE_HISTORY;
else if (force->pair_match("gran/hertz/history",1))
pairstyle = HERTZ_HISTORY;
else error->all("Fix wall/gran is incompatible with Pair style");
else error->all(FLERR,"Fix wall/gran is incompatible with Pair style");
}
/* ---------------------------------------------------------------------- */

View File

@ -28,9 +28,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PairGranHertzHistory::PairGranHertzHistory(LAMMPS *lmp) :
@ -256,7 +253,7 @@ void PairGranHertzHistory::compute(int eflag, int vflag)
void PairGranHertzHistory::settings(int narg, char **arg)
{
if (narg != 6) error->all("Illegal pair_style command");
if (narg != 6) error->all(FLERR,"Illegal pair_style command");
kn = force->numeric(arg[0]);
if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
@ -272,7 +269,7 @@ void PairGranHertzHistory::settings(int narg, char **arg)
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
error->all("Illegal pair_style command");
error->all(FLERR,"Illegal pair_style command");
// convert Kn and Kt from pressure units to force/distance^2

View File

@ -25,9 +25,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PairGranHooke::PairGranHooke(LAMMPS *lmp) : PairGranHookeHistory(lmp)

View File

@ -38,9 +38,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp)
@ -311,7 +308,7 @@ void PairGranHookeHistory::allocate()
void PairGranHookeHistory::settings(int narg, char **arg)
{
if (narg != 6) error->all("Illegal pair_style command");
if (narg != 6) error->all(FLERR,"Illegal pair_style command");
kn = force->numeric(arg[0]);
if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
@ -327,7 +324,7 @@ void PairGranHookeHistory::settings(int narg, char **arg)
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
error->all("Illegal pair_style command");
error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
@ -336,7 +333,7 @@ void PairGranHookeHistory::settings(int narg, char **arg)
void PairGranHookeHistory::coeff(int narg, char **arg)
{
if (narg > 2) error->all("Incorrect args for pair coefficients");
if (narg > 2) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -351,7 +348,7 @@ void PairGranHookeHistory::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -365,9 +362,9 @@ void PairGranHookeHistory::init_style()
// error and warning checks
if (!atom->sphere_flag)
error->all("Pair granular requires atom style sphere");
error->all(FLERR,"Pair granular requires atom style sphere");
if (comm->ghost_velocity == 0)
error->all("Pair granular requires ghost atoms store velocity");
error->all(FLERR,"Pair granular requires ghost atoms store velocity");
// need a half neigh list and optionally a granular history neigh list
@ -389,7 +386,7 @@ void PairGranHookeHistory::init_style()
// if first init, create Fix needed for storing shear history
if (history && force->newton_pair == 1)
error->all("Pair granular with shear history requires newton pair off");
error->all(FLERR,"Pair granular with shear history requires newton pair off");
if (history && fix_history == NULL) {
char **fixarg = new char*[3];

View File

@ -33,14 +33,11 @@ using namespace LAMMPS_NS;
#define SMALL 0.00001
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
Ewald::Ewald(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
{
if (narg != 1) error->all("Illegal kspace_style ewald command");
if (narg != 1) error->all(FLERR,"Illegal kspace_style ewald command");
precision = atof(arg[0]);
PI = 4.0*atan(1.0);
@ -81,18 +78,18 @@ void Ewald::init()
// error check
if (domain->triclinic) error->all("Cannot use Ewald with triclinic box");
if (domain->triclinic) error->all(FLERR,"Cannot use Ewald with triclinic box");
if (domain->dimension == 2)
error->all("Cannot use Ewald with 2d simulation");
error->all(FLERR,"Cannot use Ewald with 2d simulation");
if (!atom->q_flag) error->all("Kspace style requires atom attribute q");
if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q");
if (slabflag == 0 && domain->nonperiodic > 0)
error->all("Cannot use nonperiodic boundaries with Ewald");
error->all(FLERR,"Cannot use nonperiodic boundaries with Ewald");
if (slabflag == 1) {
if (domain->xperiodic != 1 || domain->yperiodic != 1 ||
domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
error->all("Incorrect boundaries with slab Ewald");
error->all(FLERR,"Incorrect boundaries with slab Ewald");
}
// extract short-range Coulombic cutoff from pair style
@ -101,11 +98,11 @@ void Ewald::init()
scale = 1.0;
if (force->pair == NULL)
error->all("KSpace style is incompatible with Pair style");
error->all(FLERR,"KSpace style is incompatible with Pair style");
int itmp;
double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp);
if (p_cutoff == NULL)
error->all("KSpace style is incompatible with Pair style");
error->all(FLERR,"KSpace style is incompatible with Pair style");
double cutoff = *p_cutoff;
qsum = qsqsum = 0.0;
@ -121,11 +118,11 @@ void Ewald::init()
qsqsum = tmp;
if (qsqsum == 0.0)
error->all("Cannot use kspace solver on system with no charge");
error->all(FLERR,"Cannot use kspace solver on system with no charge");
if (fabs(qsum) > SMALL && comm->me == 0) {
char str[128];
sprintf(str,"System is not charge neutral, net charge = %g",qsum);
error->warning(str);
error->warning(FLERR,str);
}
// setup K-space resolution

View File

@ -30,7 +30,7 @@ FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow,
in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
scaled,permute,nbuf);
if (plan == NULL) error->one("Could not create 3d FFT plan");
if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan");
}
/* ---------------------------------------------------------------------- */

View File

@ -31,9 +31,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -213,7 +210,7 @@ void PairBornCoulLong::allocate()
void PairBornCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
@ -235,7 +232,7 @@ void PairBornCoulLong::settings(int narg, char **arg)
void PairBornCoulLong::coeff(int narg, char **arg)
{
if (narg < 7 || narg > 8) error->all("Incorrect args for pair coefficients");
if (narg < 7 || narg > 8) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -245,7 +242,7 @@ void PairBornCoulLong::coeff(int narg, char **arg)
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
double sigma_one = force->numeric(arg[4]);
if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
double c_one = force->numeric(arg[5]);
double d_one = force->numeric(arg[6]);
@ -266,7 +263,7 @@ void PairBornCoulLong::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -275,7 +272,7 @@ void PairBornCoulLong::coeff(int narg, char **arg)
double PairBornCoulLong::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
double cut = MAX(cut_lj[i][j],cut_coul);
cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
@ -345,14 +342,14 @@ double PairBornCoulLong::init_one(int i, int j)
void PairBornCoulLong::init_style()
{
if (!atom->q_flag)
error->all("Pair style born/coul/long requires atom attribute q");
error->all(FLERR,"Pair style born/coul/long requires atom attribute q");
cut_coulsq = cut_coul * cut_coul;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
neighbor->request(this);

View File

@ -27,9 +27,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -202,7 +199,7 @@ void PairBuckCoulLong::allocate()
void PairBuckCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
@ -224,7 +221,7 @@ void PairBuckCoulLong::settings(int narg, char **arg)
void PairBuckCoulLong::coeff(int narg, char **arg)
{
if (narg < 5 || narg > 6) error->all("Incorrect args for pair coefficients");
if (narg < 5 || narg > 6) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -233,7 +230,7 @@ void PairBuckCoulLong::coeff(int narg, char **arg)
double a_one = force->numeric(arg[2]);
double rho_one = force->numeric(arg[3]);
if (rho_one <= 0) error->all("Incorrect args for pair coefficients");
if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients");
double c_one = force->numeric(arg[4]);
double cut_lj_one = cut_lj_global;
@ -251,7 +248,7 @@ void PairBuckCoulLong::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -260,7 +257,7 @@ void PairBuckCoulLong::coeff(int narg, char **arg)
double PairBuckCoulLong::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
double cut = MAX(cut_lj[i][j],cut_coul);
cut_ljsq[i][j] = cut_lj[i][j] * cut_lj[i][j];
@ -322,14 +319,14 @@ double PairBuckCoulLong::init_one(int i, int j)
void PairBuckCoulLong::init_style()
{
if (!atom->q_flag)
error->all("Pair style buck/coul/long requires atom attribute q");
error->all(FLERR,"Pair style buck/coul/long requires atom attribute q");
cut_coulsq = cut_coul * cut_coul;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
neighbor->request(this);

View File

@ -34,9 +34,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -199,7 +196,7 @@ void PairCoulLong::allocate()
void PairCoulLong::settings(int narg, char **arg)
{
if (narg != 1) error->all("Illegal pair_style command");
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_coul = force->numeric(arg[0]);
}
@ -210,7 +207,7 @@ void PairCoulLong::settings(int narg, char **arg)
void PairCoulLong::coeff(int narg, char **arg)
{
if (narg != 2) error->all("Incorrect args for pair coefficients");
if (narg != 2) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -226,7 +223,7 @@ void PairCoulLong::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -236,7 +233,7 @@ void PairCoulLong::coeff(int narg, char **arg)
void PairCoulLong::init_style()
{
if (!atom->q_flag)
error->all("Pair style lj/cut/coul/long requires atom attribute q");
error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
neighbor->request(this);
@ -248,13 +245,13 @@ void PairCoulLong::init_style()
((Respa *) update->integrate)->level_inner >= 0) {
cut_respa = ((Respa *) update->integrate)->cutoff;
if (cut_coul < cut_respa[3])
error->all("Pair cutoff < Respa interior cutoff");
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
} else cut_respa = NULL;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables

View File

@ -37,9 +37,6 @@ using namespace LAMMPS_NS;
enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; // same as in pair.cpp
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -656,7 +653,7 @@ void PairLJCharmmCoulLong::allocate()
void PairLJCharmmCoulLong::settings(int narg, char **arg)
{
if (narg != 2 && narg != 3) error->all("Illegal pair_style command");
if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command");
cut_lj_inner = force->numeric(arg[0]);
cut_lj = force->numeric(arg[1]);
@ -670,7 +667,7 @@ void PairLJCharmmCoulLong::settings(int narg, char **arg)
void PairLJCharmmCoulLong::coeff(int narg, char **arg)
{
if (narg != 4 && narg != 6) error->all("Illegal pair_coeff command");
if (narg != 4 && narg != 6) error->all(FLERR,"Illegal pair_coeff command");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -698,7 +695,7 @@ void PairLJCharmmCoulLong::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -708,7 +705,7 @@ void PairLJCharmmCoulLong::coeff(int narg, char **arg)
void PairLJCharmmCoulLong::init_style()
{
if (!atom->q_flag)
error->all("Pair style lj/charmm/coul/long requires atom attribute q");
error->all(FLERR,"Pair style lj/charmm/coul/long requires atom attribute q");
// request regular or rRESPA neighbor lists
@ -749,7 +746,7 @@ void PairLJCharmmCoulLong::init_style()
// require cut_lj_inner < cut_lj
if (cut_lj_inner >= cut_lj)
error->all("Pair inner cutoff >= Pair outer cutoff");
error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
cut_lj_innersq = cut_lj_inner * cut_lj_inner;
cut_ljsq = cut_lj * cut_lj;
@ -765,15 +762,15 @@ void PairLJCharmmCoulLong::init_style()
((Respa *) update->integrate)->level_inner >= 0) {
cut_respa = ((Respa *) update->integrate)->cutoff;
if (MIN(cut_lj,cut_coul) < cut_respa[3])
error->all("Pair cutoff < Respa interior cutoff");
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
if (cut_lj_inner < cut_respa[1])
error->all("Pair inner cutoff < Respa interior cutoff");
error->all(FLERR,"Pair inner cutoff < Respa interior cutoff");
} else cut_respa = NULL;
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables

View File

@ -35,9 +35,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -593,7 +590,7 @@ void PairLJCutCoulLong::allocate()
void PairLJCutCoulLong::settings(int narg, char **arg)
{
if (narg < 1 || narg > 2) error->all("Illegal pair_style command");
if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command");
cut_lj_global = force->numeric(arg[0]);
if (narg == 1) cut_coul = cut_lj_global;
@ -615,7 +612,7 @@ void PairLJCutCoulLong::settings(int narg, char **arg)
void PairLJCutCoulLong::coeff(int narg, char **arg)
{
if (narg < 4 || narg > 5) error->all("Incorrect args for pair coefficients");
if (narg < 4 || narg > 5) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -639,7 +636,7 @@ void PairLJCutCoulLong::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -649,7 +646,7 @@ void PairLJCutCoulLong::coeff(int narg, char **arg)
void PairLJCutCoulLong::init_style()
{
if (!atom->q_flag)
error->all("Pair style lj/cut/coul/long requires atom attribute q");
error->all(FLERR,"Pair style lj/cut/coul/long requires atom attribute q");
// request regular or rRESPA neighbor lists
@ -699,7 +696,7 @@ void PairLJCutCoulLong::init_style()
// insure use of KSpace long-range solver, set g_ewald
if (force->kspace == NULL)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
g_ewald = force->kspace->g_ewald;
// setup force tables
@ -756,7 +753,7 @@ double PairLJCutCoulLong::init_one(int i, int j)
// check interior rRESPA cutoff
if (cut_respa && MIN(cut_lj[i][j],cut_coul) < cut_respa[3])
error->all("Pair cutoff < Respa interior cutoff");
error->all(FLERR,"Pair cutoff < Respa interior cutoff");
// compute I,J contribution to long-range tail correction
// count total # of atoms of type I and J via Allreduce

View File

@ -37,9 +37,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
@ -369,7 +366,7 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
void PairLJCutCoulLongTIP4P::settings(int narg, char **arg)
{
if (narg < 6 || narg > 7) error->all("Illegal pair_style command");
if (narg < 6 || narg > 7) error->all(FLERR,"Illegal pair_style command");
typeO = force->inumeric(arg[0]);
typeH = force->inumeric(arg[1]);
@ -398,17 +395,17 @@ void PairLJCutCoulLongTIP4P::settings(int narg, char **arg)
void PairLJCutCoulLongTIP4P::init_style()
{
if (atom->tag_enable == 0)
error->all("Pair style lj/cut/coul/long/tip4p requires atom IDs");
error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires atom IDs");
if (!force->newton_pair)
error->all("Pair style lj/cut/coul/long/tip4p requires newton pair on");
error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires newton pair on");
if (!atom->q_flag)
error->all("Pair style lj/cut/coul/long/tip4p requires atom attribute q");
error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires atom attribute q");
if (strcmp(force->kspace_style,"pppm/tip4p") != 0)
error->all("Pair style is incompatible with KSpace style");
error->all(FLERR,"Pair style is incompatible with KSpace style");
if (force->bond == NULL)
error->all("Must use a bond style with TIP4P potential");
error->all(FLERR,"Must use a bond style with TIP4P potential");
if (force->angle == NULL)
error->all("Must use an angle style with TIP4P potential");
error->all(FLERR,"Must use an angle style with TIP4P potential");
PairLJCutCoulLong::init_style();
@ -482,9 +479,9 @@ void PairLJCutCoulLongTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
iH1 = atom->map(atom->tag[i] + 1);
iH2 = atom->map(atom->tag[i] + 2);
if (iH1 == -1 || iH2 == -1) error->one("TIP4P hydrogen is missing");
if (iH1 == -1 || iH2 == -1) error->one(FLERR,"TIP4P hydrogen is missing");
if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
error->one("TIP4P hydrogen has incorrect atom type");
error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
double **x = atom->x;

View File

@ -51,14 +51,11 @@ using namespace LAMMPS_NS;
#define ONEF 1.0
#endif
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
{
if (narg < 1) error->all("Illegal kspace_style pppm command");
if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");
precision = atof(arg[0]);
PI = 4.0*atan(1.0);
@ -115,23 +112,23 @@ void PPPM::init()
// error check
if (domain->triclinic)
error->all("Cannot (yet) use PPPM with triclinic box");
if (domain->dimension == 2) error->all("Cannot use PPPM with 2d simulation");
error->all(FLERR,"Cannot (yet) use PPPM with triclinic box");
if (domain->dimension == 2) error->all(FLERR,"Cannot use PPPM with 2d simulation");
if (!atom->q_flag) error->all("Kspace style requires atom attribute q");
if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q");
if (slabflag == 0 && domain->nonperiodic > 0)
error->all("Cannot use nonperiodic boundaries with PPPM");
error->all(FLERR,"Cannot use nonperiodic boundaries with PPPM");
if (slabflag == 1) {
if (domain->xperiodic != 1 || domain->yperiodic != 1 ||
domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
error->all("Incorrect boundaries with slab PPPM");
error->all(FLERR,"Incorrect boundaries with slab PPPM");
}
if (order > MAXORDER) {
char str[128];
sprintf(str,"PPPM order cannot be greater than %d",MAXORDER);
error->all(str);
error->all(FLERR,str);
}
// free all arrays previously allocated
@ -144,11 +141,11 @@ void PPPM::init()
scale = 1.0;
if (force->pair == NULL)
error->all("KSpace style is incompatible with Pair style");
error->all(FLERR,"KSpace style is incompatible with Pair style");
int itmp;
double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp);
if (p_cutoff == NULL)
error->all("KSpace style is incompatible with Pair style");
error->all(FLERR,"KSpace style is incompatible with Pair style");
cutoff = *p_cutoff;
// if kspace is TIP4P, extract TIP4P params from pair style
@ -158,14 +155,14 @@ void PPPM::init()
if (strcmp(force->kspace_style,"pppm/tip4p") == 0) {
if (force->pair == NULL)
error->all("KSpace style is incompatible with Pair style");
error->all(FLERR,"KSpace style is incompatible with Pair style");
double *p_qdist = (double *) force->pair->extract("qdist",itmp);
int *p_typeO = (int *) force->pair->extract("typeO",itmp);
int *p_typeH = (int *) force->pair->extract("typeH",itmp);
int *p_typeA = (int *) force->pair->extract("typeA",itmp);
int *p_typeB = (int *) force->pair->extract("typeB",itmp);
if (!p_qdist || !p_typeO || !p_typeH || !p_typeA || !p_typeB)
error->all("KSpace style is incompatible with Pair style");
error->all(FLERR,"KSpace style is incompatible with Pair style");
qdist = *p_qdist;
typeO = *p_typeO;
typeH = *p_typeH;
@ -173,13 +170,13 @@ void PPPM::init()
int typeB = *p_typeB;
if (force->angle == NULL || force->bond == NULL)
error->all("Bond and angle potentials must be defined for TIP4P");
error->all(FLERR,"Bond and angle potentials must be defined for TIP4P");
if (typeA < 1 || typeA > atom->nangletypes ||
force->angle->setflag[typeA] == 0)
error->all("Bad TIP4P angle type for PPPM/TIP4P");
error->all(FLERR,"Bad TIP4P angle type for PPPM/TIP4P");
if (typeB < 1 || typeB > atom->nbondtypes ||
force->bond->setflag[typeB] == 0)
error->all("Bad TIP4P bond type for PPPM/TIP4P");
error->all(FLERR,"Bad TIP4P bond type for PPPM/TIP4P");
double theta = force->angle->equilibrium_angle(typeA);
double blen = force->bond->equilibrium_distance(typeB);
alpha = qdist / (cos(0.5*theta) * blen);
@ -200,11 +197,11 @@ void PPPM::init()
qsqsum = tmp;
if (qsqsum == 0.0)
error->all("Cannot use kspace solver on system with no charge");
error->all(FLERR,"Cannot use kspace solver on system with no charge");
if (fabs(qsum) > SMALL && me == 0) {
char str[128];
sprintf(str,"System is not charge neutral, net charge = %g",qsum);
error->warning(str);
error->warning(FLERR,str);
}
// setup FFT grid resolution and g_ewald
@ -216,14 +213,14 @@ void PPPM::init()
while (order > 0) {
if (iteration && me == 0)
error->warning("Reducing PPPM order b/c stencil extends "
error->warning(FLERR,"Reducing PPPM order b/c stencil extends "
"beyond neighbor processor");
iteration++;
set_grid();
if (nx_pppm >= OFFSET || ny_pppm >= OFFSET || nz_pppm >= OFFSET)
error->all("PPPM grid is too large");
error->all(FLERR,"PPPM grid is too large");
// global indices of PPPM grid range from 0 to N-1
// nlo_in,nhi_in = lower/upper limits of the 3d sub-brick of
@ -394,7 +391,7 @@ void PPPM::init()
order--;
}
if (order == 0) error->all("PPPM order has been reduced to 0");
if (order == 0) error->all(FLERR,"PPPM order has been reduced to 0");
// decomposition of FFT mesh
// global indices range from 0 to N-1
@ -946,7 +943,7 @@ void PPPM::set_grid()
g_ewald = gew2;
fmid = diffpr(h_x,h_y,h_z,q2,acons);
if (f*fmid >= 0.0) error->all("Cannot compute PPPM G");
if (f*fmid >= 0.0) error->all(FLERR,"Cannot compute PPPM G");
rtb = f < 0.0 ? (dgew=gew2-gew1,gew1) : (dgew=gew1-gew2,gew2);
ncount = 0;
while (fabs(dgew) > SMALL && fmid != 0.0) {
@ -955,7 +952,7 @@ void PPPM::set_grid()
fmid = diffpr(h_x,h_y,h_z,q2,acons);
if (fmid <= 0.0) rtb = g_ewald;
ncount++;
if (ncount > LARGE) error->all("Cannot compute PPPM G");
if (ncount > LARGE) error->all(FLERR,"Cannot compute PPPM G");
}
}
@ -1499,7 +1496,7 @@ void PPPM::particle_map()
nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag = 1;
}
if (flag) error->one("Out of range atoms - cannot compute PPPM");
if (flag) error->one(FLERR,"Out of range atoms - cannot compute PPPM");
}
/* ----------------------------------------------------------------------

View File

@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
PPPMCG::PPPMCG(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
{
if ((narg < 1) || (narg > 2)) error->all("Illegal kspace_style pppm/cg command");
if ((narg < 1) || (narg > 2)) error->all(FLERR,"Illegal kspace_style pppm/cg command");
if (narg == 2)
smallq = atof(arg[1]);
@ -232,7 +232,7 @@ void PPPMCG::particle_map()
nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag = 1;
}
if (flag) error->one("Out of range atoms - cannot compute PPPM");
if (flag) error->one(FLERR,"Out of range atoms - cannot compute PPPM");
}
/* ----------------------------------------------------------------------

View File

@ -82,7 +82,7 @@ void PPPMTIP4P::particle_map()
int flag_all;
MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
if (flag_all) error->all("Out of range atoms - cannot compute PPPM");
if (flag_all) error->all(FLERR,"Out of range atoms - cannot compute PPPM");
}
/* ----------------------------------------------------------------------
@ -253,9 +253,9 @@ void PPPMTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
iH1 = atom->map(atom->tag[i] + 1);
iH2 = atom->map(atom->tag[i] + 2);
if (iH1 == -1 || iH2 == -1) error->one("TIP4P hydrogen is missing");
if (iH1 == -1 || iH2 == -1) error->one(FLERR,"TIP4P hydrogen is missing");
if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
error->one("TIP4P hydrogen has incorrect atom type");
error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
double **x = atom->x;

View File

@ -30,7 +30,7 @@ Remap::Remap(LAMMPS *lmp, MPI_Comm comm,
in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
nqty,permute,memory,precision);
if (plan == NULL) error->one("Could not create 3d remap plan");
if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan");
}
/* ---------------------------------------------------------------------- */

View File

@ -32,14 +32,11 @@
using namespace LAMMPS_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
/* ---------------------------------------------------------------------- */
FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
{
if (narg < 5) error->all("Illegal fix qeq/comb command");
if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb command");
peratom_flag = 1;
size_peratom_cols = 0;
@ -49,7 +46,7 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
precision = force->numeric(arg[4]);
if (nevery <= 0 || precision <= 0.0)
error->all("Illegal fix qeq/comb command");
error->all(FLERR,"Illegal fix qeq/comb command");
MPI_Comm_rank(world,&me);
@ -60,17 +57,17 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
int iarg = 5;
while (iarg < narg) {
if (strcmp(arg[iarg],"file") == 0) {
if (iarg+2 > narg) error->all("Illegal fix qeq/comb command");
if (iarg+2 > narg) error->all(FLERR,"Illegal fix qeq/comb command");
if (me == 0) {
fp = fopen(arg[iarg+1],"w");
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open fix qeq/comb file %s",arg[iarg+1]);
error->one(str);
error->one(FLERR,str);
}
}
iarg += 2;
} else error->all("Illegal fix qeq/comb command");
} else error->all(FLERR,"Illegal fix qeq/comb command");
}
nmax = atom->nmax;
@ -111,16 +108,16 @@ int FixQEQComb::setmask()
void FixQEQComb::init()
{
if (!atom->q_flag)
error->all("Fix qeq/comb requires atom attribute q");
error->all(FLERR,"Fix qeq/comb requires atom attribute q");
comb = (PairComb *) force->pair_match("comb",1);
if (comb == NULL) error->all("Must use pair_style comb with fix qeq/comb");
if (comb == NULL) error->all(FLERR,"Must use pair_style comb with fix qeq/comb");
if (strstr(update->integrate_style,"respa"))
nlevels_respa = ((Respa *) update->integrate)->nlevels;
ngroup = group->count(igroup);
if (ngroup == 0) error->all("Fix qeq/comb group has no atoms");
if (ngroup == 0) error->all(FLERR,"Fix qeq/comb group has no atoms");
}
/* ---------------------------------------------------------------------- */

View File

@ -31,9 +31,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MAXLINE 1024
/* ---------------------------------------------------------------------- */
@ -423,7 +420,7 @@ void PairADP::allocate()
void PairADP::settings(int narg, char **arg)
{
if (narg > 0) error->all("Illegal pair_style command");
if (narg > 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
@ -438,12 +435,12 @@ void PairADP::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read ADP parameter file
@ -472,7 +469,7 @@ void PairADP::coeff(int narg, char **arg)
for (j = 0; j < setfl->nelements; j++)
if (strcmp(arg[i],setfl->elements[j]) == 0) break;
if (j < setfl->nelements) map[i-2] = j;
else error->all("No matching element in ADP potential file");
else error->all(FLERR,"No matching element in ADP potential file");
}
// clear setflag since coeff() called once with I,J = * *
@ -496,7 +493,7 @@ void PairADP::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
@ -549,7 +546,7 @@ void PairADP::read_file(char *filename)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open ADP potential file %s",filename);
error->one(str);
error->one(FLERR,str);
}
}
@ -570,7 +567,7 @@ void PairADP::read_file(char *filename)
sscanf(line,"%d",&file->nelements);
int nwords = atom->count_words(line);
if (nwords != file->nelements + 1)
error->all("Incorrect element names in ADP potential file");
error->all(FLERR,"Incorrect element names in ADP potential file");
char **words = new char*[file->nelements+1];
nwords = 0;

View File

@ -34,9 +34,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MAXLINE 1024
#define TOL 1.0e-9
#define PGDELTA 1
@ -135,7 +132,7 @@ void PairAIREBO::allocate()
void PairAIREBO::settings(int narg, char **arg)
{
if (narg != 1 && narg != 3) error->all("Illegal pair_style command");
if (narg != 1 && narg != 3) error->all(FLERR,"Illegal pair_style command");
cutlj = force->numeric(arg[0]);
@ -155,12 +152,12 @@ void PairAIREBO::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to C and H
// map[i] = which element (0,1) the Ith atom type is, -1 if NULL
@ -173,7 +170,7 @@ void PairAIREBO::coeff(int narg, char **arg)
map[i-2] = 0;
} else if (strcmp(arg[i],"H") == 0) {
map[i-2] = 1;
} else error->all("Incorrect args for pair coefficients");
} else error->all(FLERR,"Incorrect args for pair coefficients");
}
// read potential file and initialize fitting splines
@ -198,7 +195,7 @@ void PairAIREBO::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -208,9 +205,9 @@ void PairAIREBO::coeff(int narg, char **arg)
void PairAIREBO::init_style()
{
if (atom->tag_enable == 0)
error->all("Pair style AIREBO requires atom IDs");
error->all(FLERR,"Pair style AIREBO requires atom IDs");
if (force->newton_pair == 0)
error->all("Pair style AIREBO requires newton pair on");
error->all(FLERR,"Pair style AIREBO requires newton pair on");
// need a full neighbor list, including neighbors of ghosts
@ -232,7 +229,7 @@ void PairAIREBO::init_style()
double PairAIREBO::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
// convert to C,H types
@ -371,7 +368,7 @@ void PairAIREBO::REBO_neigh()
REBO_numneigh[i] = n;
npnt += n;
if (npnt >= pgsize)
error->one("Neighbor list overflow, boost neigh_modify one or page");
error->one(FLERR,"Neighbor list overflow, boost neigh_modify one or page");
}
}
@ -3401,7 +3398,7 @@ void PairAIREBO::read_file(char *filename)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open AIREBO potential file %s",filename);
error->one(str);
error->one(FLERR,str);
}
// skip initial comment lines

View File

@ -417,7 +417,7 @@ void PairComb::allocate()
void PairComb::settings(int narg, char **arg)
{
if (narg > 0) error->all("Illegal pair_style command");
if (narg > 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
@ -431,12 +431,12 @@ void PairComb::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if NULL
@ -502,7 +502,7 @@ void PairComb::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -512,11 +512,11 @@ void PairComb::coeff(int narg, char **arg)
void PairComb::init_style()
{
if (atom->tag_enable == 0)
error->all("Pair style COMB requires atom IDs");
error->all(FLERR,"Pair style COMB requires atom IDs");
if (force->newton_pair == 0)
error->all("Pair style COMB requires newton pair on");
error->all(FLERR,"Pair style COMB requires newton pair on");
if (!atom->q_flag)
error->all("Pair style COMB requires atom attribute q");
error->all(FLERR,"Pair style COMB requires atom attribute q");
// ptr to QEQ fix
@ -538,7 +538,7 @@ void PairComb::init_style()
double PairComb::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
return cutmax;
}
@ -561,7 +561,7 @@ void PairComb::read_file(char *file)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open COMB potential file %s",file);
error->one(str);
error->one(FLERR,str);
}
}
@ -611,7 +611,7 @@ void PairComb::read_file(char *file)
}
if (nwords != params_per_line)
error->all("Incorrect format in COMB potential file");
error->all(FLERR,"Incorrect format in COMB potential file");
// words = ptrs to all words in line
@ -719,13 +719,13 @@ void PairComb::read_file(char *file)
// params[nparams].dj < 0.0 || params[nparams].dk < 0.0 ||
// params[nparams].dl < 0.0 || params[nparams].dm < 0.0 ||
params[nparams].esm1 < 0.0)
error->all("Illegal COMB parameter");
error->all(FLERR,"Illegal COMB parameter");
if (params[nparams].lam11 < params[nparams].lam21 ||
params[nparams].lam12 < params[nparams].lam22 ||
params[nparams].biga1< params[nparams].bigb1 ||
params[nparams].biga2< params[nparams].bigb2)
error->all("Illegal COMB parameter");
error->all(FLERR,"Illegal COMB parameter");
nparams++;
}
@ -753,11 +753,11 @@ void PairComb::setup()
for (m = 0; m < nparams; m++) {
if (i == params[m].ielement && j == params[m].jelement &&
k == params[m].kelement) {
if (n >= 0) error->all("Potential file has duplicate entry");
if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
n = m;
}
}
if (n < 0) error->all("Potential file is missing an entry");
if (n < 0) error->all(FLERR,"Potential file is missing an entry");
elem2param[i][j][k] = n;
}
@ -1779,14 +1779,14 @@ double PairComb::qfo_self(Param *param, double qi, double selfpot)
// char str[128];
// sprintf(str,"Pair COMB charge %.10f with force %.10f hit min barrier",
// qi,self_d);
// error->warning(str,0);
// error->warning(FLERR,str,0);
self_d += 4.0 * cmin * pow((qi-qmin),3);
}
if (qi > qmax) {
// char str[128];
// sprintf(str,"Pair COMB charge %.10f with force %.10f hit max barrier",
// qi,self_d);
// error->warning(str,0);
// error->warning(FLERR,str,0);
self_d += 4.0 * cmax * pow((qi-qmax),3);
}

View File

@ -30,9 +30,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MAXLINE 1024
/* ---------------------------------------------------------------------- */
@ -332,7 +329,7 @@ void PairEAM::allocate()
void PairEAM::settings(int narg, char **arg)
{
if (narg > 0) error->all("Illegal pair_style command");
if (narg > 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
@ -344,7 +341,7 @@ void PairEAM::coeff(int narg, char **arg)
{
if (!allocated) allocate();
if (narg != 3) error->all("Incorrect args for pair coefficients");
if (narg != 3) error->all(FLERR,"Incorrect args for pair coefficients");
// parse pair of atom types
@ -384,7 +381,7 @@ void PairEAM::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -440,7 +437,7 @@ void PairEAM::read_file(char *filename)
if (fptr == NULL) {
char str[128];
sprintf(str,"Cannot open EAM potential file %s",filename);
error->one(str);
error->one(FLERR,str);
}
}

View File

@ -47,12 +47,12 @@ void PairEAMAlloy::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read EAM setfl file
@ -79,7 +79,7 @@ void PairEAMAlloy::coeff(int narg, char **arg)
for (j = 0; j < setfl->nelements; j++)
if (strcmp(arg[i],setfl->elements[j]) == 0) break;
if (j < setfl->nelements) map[i-2] = j;
else error->all("No matching element in EAM potential file");
else error->all(FLERR,"No matching element in EAM potential file");
}
// clear setflag since coeff() called once with I,J = * *
@ -103,7 +103,7 @@ void PairEAMAlloy::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -125,7 +125,7 @@ void PairEAMAlloy::read_file(char *filename)
if (fptr == NULL) {
char str[128];
sprintf(str,"Cannot open EAM potential file %s",filename);
error->one(str);
error->one(FLERR,str);
}
}
@ -146,7 +146,7 @@ void PairEAMAlloy::read_file(char *filename)
sscanf(line,"%d",&file->nelements);
int nwords = atom->count_words(line);
if (nwords != file->nelements + 1)
error->all("Incorrect element names in EAM potential file");
error->all(FLERR,"Incorrect element names in EAM potential file");
char **words = new char*[file->nelements+1];
nwords = 0;

View File

@ -47,12 +47,12 @@ void PairEAMFS::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read EAM Finnis-Sinclair file
@ -79,7 +79,7 @@ void PairEAMFS::coeff(int narg, char **arg)
for (j = 0; j < fs->nelements; j++)
if (strcmp(arg[i],fs->elements[j]) == 0) break;
if (j < fs->nelements) map[i-2] = j;
else error->all("No matching element in EAM potential file");
else error->all(FLERR,"No matching element in EAM potential file");
}
// clear setflag since coeff() called once with I,J = * *
@ -103,7 +103,7 @@ void PairEAMFS::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -125,7 +125,7 @@ void PairEAMFS::read_file(char *filename)
if (fptr == NULL) {
char str[128];
sprintf(str,"Cannot open EAM potential file %s",filename);
error->one(str);
error->one(FLERR,str);
}
}
@ -146,7 +146,7 @@ void PairEAMFS::read_file(char *filename)
sscanf(line,"%d",&file->nelements);
int nwords = atom->count_words(line);
if (nwords != file->nelements + 1)
error->all("Incorrect element names in EAM potential file");
error->all(FLERR,"Incorrect element names in EAM potential file");
char **words = new char*[file->nelements+1];
nwords = 0;

View File

@ -30,9 +30,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MAXLINE 1024
/* ---------------------------------------------------------------------- */
@ -344,7 +341,7 @@ void PairEIM::allocate()
void PairEIM::settings(int narg, char **arg)
{
if (narg > 0) error->all("Illegal pair_style command");
if (narg > 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
@ -357,12 +354,12 @@ void PairEIM::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg < 5) error->all("Incorrect args for pair coefficients");
if (narg < 5) error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read EIM element names before filename
// nelements = # of EIM elements to read from file
@ -373,7 +370,7 @@ void PairEIM::coeff(int narg, char **arg)
delete [] elements;
}
nelements = narg - 3 - atom->ntypes;
if (nelements < 1) error->all("Incorrect args for pair coefficients");
if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
elements = new char*[nelements];
for (i = 0; i < nelements; i++) {
@ -397,7 +394,7 @@ void PairEIM::coeff(int narg, char **arg)
if (strcmp(arg[i],elements[j]) == 0) break;
if (j < nelements) map[m] = j;
else if (strcmp(arg[i],"NULL") == 0) map[m] = -1;
else error->all("Incorrect args for pair coefficients");
else error->all(FLERR,"Incorrect args for pair coefficients");
}
// clear setflag since coeff() called once with I,J = * *
@ -419,7 +416,7 @@ void PairEIM::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -462,7 +459,7 @@ void PairEIM::read_file(char *filename)
if (fptr == NULL) {
char str[128];
sprintf(str,"Cannot open EIM potential file %s",filename);
error->one(str);
error->one(FLERR,str);
}
}
@ -491,7 +488,7 @@ void PairEIM::read_file(char *filename)
if (me == 0)
if (!grabglobal(fptr))
error->one("Could not grab global entry from EIM potential file");
error->one(FLERR,"Could not grab global entry from EIM potential file");
MPI_Bcast(&setfl->division,1,MPI_DOUBLE,0,world);
MPI_Bcast(&setfl->rbig,1,MPI_DOUBLE,0,world);
MPI_Bcast(&setfl->rsmall,1,MPI_DOUBLE,0,world);
@ -499,7 +496,7 @@ void PairEIM::read_file(char *filename)
for (int i = 0; i < nelements; i++) {
if (me == 0)
if (!grabsingle(fptr,i))
error->one("Could not grab element entry from EIM potential file");
error->one(FLERR,"Could not grab element entry from EIM potential file");
MPI_Bcast(&setfl->ielement[i],1,MPI_INT,0,world);
MPI_Bcast(&setfl->mass[i],1,MPI_DOUBLE,0,world);
MPI_Bcast(&setfl->negativity[i],1,MPI_DOUBLE,0,world);
@ -517,7 +514,7 @@ void PairEIM::read_file(char *filename)
else ij = nelements*(j+1) - (j+1)*(j+2)/2 + i;
if (me == 0)
if (grabpair(fptr,i,j) == 0)
error->one("Could not grab pair entry from EIM potential file");
error->one(FLERR,"Could not grab pair entry from EIM potential file");
MPI_Bcast(&setfl->rcutphiA[ij],1,MPI_DOUBLE,0,world);
MPI_Bcast(&setfl->rcutphiR[ij],1,MPI_DOUBLE,0,world);
MPI_Bcast(&setfl->Eb[ij],1,MPI_DOUBLE,0,world);

View File

@ -27,7 +27,7 @@ PairREBO::PairREBO(LAMMPS *lmp) : PairAIREBO(lmp) {}
void PairREBO::settings(int narg, char **arg)
{
if (narg != 0) error->all("Illegal pair_style command");
if (narg != 0) error->all(FLERR,"Illegal pair_style command");
cutlj = 0.0;
ljflag = torflag = 0;

View File

@ -215,7 +215,7 @@ void PairSW::allocate()
void PairSW::settings(int narg, char **arg)
{
if (narg != 0) error->all("Illegal pair_style command");
if (narg != 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
@ -229,12 +229,12 @@ void PairSW::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if NULL
@ -287,7 +287,7 @@ void PairSW::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -297,9 +297,9 @@ void PairSW::coeff(int narg, char **arg)
void PairSW::init_style()
{
if (atom->tag_enable == 0)
error->all("Pair style Stillinger-Weber requires atom IDs");
error->all(FLERR,"Pair style Stillinger-Weber requires atom IDs");
if (force->newton_pair == 0)
error->all("Pair style Stillinger-Weber requires newton pair on");
error->all(FLERR,"Pair style Stillinger-Weber requires newton pair on");
// need a full neighbor list
@ -314,7 +314,7 @@ void PairSW::init_style()
double PairSW::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
return cutmax;
}
@ -338,7 +338,7 @@ void PairSW::read_file(char *file)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open Stillinger-Weber potential file %s",file);
error->one(str);
error->one(FLERR,str);
}
}
@ -389,7 +389,7 @@ void PairSW::read_file(char *file)
}
if (nwords != params_per_line)
error->all("Incorrect format in Stillinger-Weber potential file");
error->all(FLERR,"Incorrect format in Stillinger-Weber potential file");
// words = ptrs to all words in line
@ -439,7 +439,7 @@ void PairSW::read_file(char *file)
params[nparams].gamma < 0.0 || params[nparams].biga < 0.0 ||
params[nparams].bigb < 0.0 || params[nparams].powerp < 0.0 ||
params[nparams].powerq < 0.0 || params[nparams].tol < 0.0)
error->all("Illegal Stillinger-Weber parameter");
error->all(FLERR,"Illegal Stillinger-Weber parameter");
nparams++;
}
@ -468,11 +468,11 @@ void PairSW::setup()
for (m = 0; m < nparams; m++) {
if (i == params[m].ielement && j == params[m].jelement &&
k == params[m].kelement) {
if (n >= 0) error->all("Potential file has duplicate entry");
if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
n = m;
}
}
if (n < 0) error->all("Potential file is missing an entry");
if (n < 0) error->all(FLERR,"Potential file is missing an entry");
elem2param[i][j][k] = n;
}

View File

@ -256,7 +256,7 @@ void PairTersoff::allocate()
void PairTersoff::settings(int narg, char **arg)
{
if (narg != 0) error->all("Illegal pair_style command");
if (narg != 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
@ -270,12 +270,12 @@ void PairTersoff::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg != 3 + atom->ntypes)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if NULL
@ -328,7 +328,7 @@ void PairTersoff::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -338,9 +338,9 @@ void PairTersoff::coeff(int narg, char **arg)
void PairTersoff::init_style()
{
if (atom->tag_enable == 0)
error->all("Pair style Tersoff requires atom IDs");
error->all(FLERR,"Pair style Tersoff requires atom IDs");
if (force->newton_pair == 0)
error->all("Pair style Tersoff requires newton pair on");
error->all(FLERR,"Pair style Tersoff requires newton pair on");
// need a full neighbor list
@ -355,7 +355,7 @@ void PairTersoff::init_style()
double PairTersoff::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all("All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
return cutmax;
}
@ -379,7 +379,7 @@ void PairTersoff::read_file(char *file)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open Tersoff potential file %s",file);
error->one(str);
error->one(FLERR,str);
}
}
@ -429,7 +429,7 @@ void PairTersoff::read_file(char *file)
}
if (nwords != params_per_line)
error->all("Incorrect format in Tersoff potential file");
error->all(FLERR,"Incorrect format in Tersoff potential file");
// words = ptrs to all words in line
@ -490,7 +490,7 @@ void PairTersoff::read_file(char *file)
params[nparams].powerm - params[nparams].powermint != 0.0 ||
(params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
params[nparams].gamma < 0.0)
error->all("Illegal Tersoff parameter");
error->all(FLERR,"Illegal Tersoff parameter");
nparams++;
}
@ -518,11 +518,11 @@ void PairTersoff::setup()
for (m = 0; m < nparams; m++) {
if (i == params[m].ielement && j == params[m].jelement &&
k == params[m].kelement) {
if (n >= 0) error->all("Potential file has duplicate entry");
if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
n = m;
}
}
if (n < 0) error->all("Potential file is missing an entry");
if (n < 0) error->all(FLERR,"Potential file is missing an entry");
elem2param[i][j][k] = n;
}

View File

@ -54,7 +54,7 @@ PairTersoffZBL::PairTersoffZBL(LAMMPS *lmp) : PairTersoff(lmp)
global_a_0 = 0.529;
global_epsilon_0 = 0.00552635 * 0.043365121;
global_e = 1.0;
} else error->all("Pair tersoff/zbl requires metal or real units");
} else error->all(FLERR,"Pair tersoff/zbl requires metal or real units");
}
/* ---------------------------------------------------------------------- */
@ -76,7 +76,7 @@ void PairTersoffZBL::read_file(char *file)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open Tersoff potential file %s",file);
error->one(str);
error->one(FLERR,str);
}
}
@ -126,7 +126,7 @@ void PairTersoffZBL::read_file(char *file)
}
if (nwords != params_per_line)
error->all("Incorrect format in Tersoff potential file");
error->all(FLERR,"Incorrect format in Tersoff potential file");
// words = ptrs to all words in line
@ -195,7 +195,7 @@ void PairTersoffZBL::read_file(char *file)
params[nparams].gamma < 0.0 ||
params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
error->all("Illegal Tersoff parameter");
error->all(FLERR,"Illegal Tersoff parameter");
nparams++;
}

View File

@ -29,20 +29,17 @@
using namespace LAMMPS_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
/* ---------------------------------------------------------------------- */
FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 6) error->all("Illegal fix bond/break command");
if (narg < 6) error->all(FLERR,"Illegal fix bond/break command");
MPI_Comm_rank(world,&me);
nevery = atoi(arg[3]);
if (nevery <= 0) error->all("Illegal fix bond/break command");
if (nevery <= 0) error->all(FLERR,"Illegal fix bond/break command");
force_reneighbor = 1;
next_reneighbor = -1;
@ -55,8 +52,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
double cutoff = atof(arg[5]);
if (btype < 1 || btype > atom->nbondtypes)
error->all("Invalid bond type in fix bond/break command");
if (cutoff < 0.0) error->all("Illegal fix bond/break command");
error->all(FLERR,"Invalid bond type in fix bond/break command");
if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/break command");
cutsq = cutoff*cutoff;
@ -68,20 +65,20 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
int iarg = 6;
while (iarg < narg) {
if (strcmp(arg[iarg],"prob") == 0) {
if (iarg+3 > narg) error->all("Illegal fix bond/break command");
if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/break command");
fraction = atof(arg[iarg+1]);
seed = atoi(arg[iarg+2]);
if (fraction < 0.0 || fraction > 1.0)
error->all("Illegal fix bond/break command");
if (seed <= 0) error->all("Illegal fix bond/break command");
error->all(FLERR,"Illegal fix bond/break command");
if (seed <= 0) error->all(FLERR,"Illegal fix bond/break command");
iarg += 3;
} else error->all("Illegal fix bond/break command");
} else error->all(FLERR,"Illegal fix bond/break command");
}
// error check
if (atom->molecular == 0)
error->all("Cannot use fix bond/break with non-molecular systems");
error->all(FLERR,"Cannot use fix bond/break with non-molecular systems");
// initialize Marsaglia RNG with processor-unique seed
@ -137,13 +134,13 @@ void FixBondBreak::init()
force->special_lj[3] != 1.0) flag = 1;
if (force->special_coul[1] != 0.0 || force->special_coul[2] != 1.0 ||
force->special_coul[3] != 1.0) flag = 1;
if (flag) error->all("Fix bond/break requires special_bonds = 0,1,1");
if (flag) error->all(FLERR,"Fix bond/break requires special_bonds = 0,1,1");
// warn if angles, dihedrals, impropers are being used
if (force->angle || force->dihedral || force->improper) {
if (me == 0)
error->warning("Broken bonds will not alter angles, "
error->warning(FLERR,"Broken bonds will not alter angles, "
"dihedrals, or impropers");
}

View File

@ -33,20 +33,17 @@ using namespace LAMMPS_NS;
#define BIG 1.0e20
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
/* ---------------------------------------------------------------------- */
FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 8) error->all("Illegal fix bond/create command");
if (narg < 8) error->all(FLERR,"Illegal fix bond/create command");
MPI_Comm_rank(world,&me);
nevery = atoi(arg[3]);
if (nevery <= 0) error->all("Illegal fix bond/create command");
if (nevery <= 0) error->all(FLERR,"Illegal fix bond/create command");
force_reneighbor = 1;
next_reneighbor = -1;
@ -62,10 +59,10 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
if (iatomtype < 1 || iatomtype > atom->ntypes ||
jatomtype < 1 || jatomtype > atom->ntypes)
error->all("Invalid atom type in fix bond/create command");
if (cutoff < 0.0) error->all("Illegal fix bond/create command");
error->all(FLERR,"Invalid atom type in fix bond/create command");
if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/create command");
if (btype < 1 || btype > atom->nbondtypes)
error->all("Invalid bond type in fix bond/create command");
error->all(FLERR,"Invalid bond type in fix bond/create command");
cutsq = cutoff*cutoff;
@ -81,39 +78,39 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
int iarg = 8;
while (iarg < narg) {
if (strcmp(arg[iarg],"iparam") == 0) {
if (iarg+3 > narg) error->all("Illegal fix bond/create command");
if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command");
imaxbond = atoi(arg[iarg+1]);
inewtype = atoi(arg[iarg+2]);
if (imaxbond < 0) error->all("Illegal fix bond/create command");
if (imaxbond < 0) error->all(FLERR,"Illegal fix bond/create command");
if (inewtype < 1 || inewtype > atom->ntypes)
error->all("Invalid atom type in fix bond/create command");
error->all(FLERR,"Invalid atom type in fix bond/create command");
iarg += 3;
} else if (strcmp(arg[iarg],"jparam") == 0) {
if (iarg+3 > narg) error->all("Illegal fix bond/create command");
if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command");
jmaxbond = atoi(arg[iarg+1]);
jnewtype = atoi(arg[iarg+2]);
if (jmaxbond < 0) error->all("Illegal fix bond/create command");
if (jmaxbond < 0) error->all(FLERR,"Illegal fix bond/create command");
if (jnewtype < 1 || jnewtype > atom->ntypes)
error->all("Invalid atom type in fix bond/create command");
error->all(FLERR,"Invalid atom type in fix bond/create command");
iarg += 3;
} else if (strcmp(arg[iarg],"prob") == 0) {
if (iarg+3 > narg) error->all("Illegal fix bond/create command");
if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command");
fraction = atof(arg[iarg+1]);
seed = atoi(arg[iarg+2]);
if (fraction < 0.0 || fraction > 1.0)
error->all("Illegal fix bond/create command");
if (seed <= 0) error->all("Illegal fix bond/create command");
error->all(FLERR,"Illegal fix bond/create command");
if (seed <= 0) error->all(FLERR,"Illegal fix bond/create command");
iarg += 3;
} else error->all("Illegal fix bond/create command");
} else error->all(FLERR,"Illegal fix bond/create command");
}
// error check
if (atom->molecular == 0)
error->all("Cannot use fix bond/create with non-molecular systems");
error->all(FLERR,"Cannot use fix bond/create with non-molecular systems");
if (iatomtype == jatomtype &&
((imaxbond != jmaxbond) || (inewtype != jnewtype)))
error->all("Inconsistent iparam/jparam values in fix bond/create command");
error->all(FLERR,"Inconsistent iparam/jparam values in fix bond/create command");
// initialize Marsaglia RNG with processor-unique seed
@ -179,24 +176,24 @@ void FixBondCreate::init()
// check cutoff for iatomtype,jatomtype
if (force->pair == NULL || cutsq > force->pair->cutsq[iatomtype][jatomtype])
error->all("Fix bond/create cutoff is longer than pairwise cutoff");
error->all(FLERR,"Fix bond/create cutoff is longer than pairwise cutoff");
// require special bonds = 0,1,1
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0)
error->all("Fix bond/create requires special_bonds lj = 0,1,1");
error->all(FLERR,"Fix bond/create requires special_bonds lj = 0,1,1");
if (atom->q_flag)
if (force->special_coul[1] != 0.0 || force->special_coul[2] != 1.0 ||
force->special_coul[3] != 1.0)
error->all("Fix bond/create requires special_bonds coul = 0,1,1");
error->all(FLERR,"Fix bond/create requires special_bonds coul = 0,1,1");
// warn if angles, dihedrals, impropers are being used
if (force->angle || force->dihedral || force->improper) {
if (me == 0)
error->warning("Created bonds will not create angles, "
error->warning(FLERR,"Created bonds will not create angles, "
"dihedrals, or impropers");
}
@ -251,7 +248,7 @@ void FixBondCreate::setup(int vflag)
if (newton_bond) {
m = atom->map(bond_atom[i][j]);
if (m < 0)
error->one("Could not count initial bonds in fix bond/create");
error->one(FLERR,"Could not count initial bonds in fix bond/create");
bondcount[m]++;
}
}
@ -411,7 +408,7 @@ void FixBondCreate::post_integrate()
if (!newton_bond || tag[i] < tag[j]) {
if (num_bond[i] == atom->bond_per_atom)
error->one("New bond exceeded bonds per atom in fix bond/create");
error->one(FLERR,"New bond exceeded bonds per atom in fix bond/create");
bond_type[i][num_bond[i]] = btype;
bond_atom[i][num_bond[i]] = tag[j];
num_bond[i]++;
@ -424,7 +421,7 @@ void FixBondCreate::post_integrate()
n1 = nspecial[i][0];
n3 = nspecial[i][2];
if (n3 == atom->maxspecial)
error->one("New bond exceeded special list size in fix bond/create");
error->one(FLERR,"New bond exceeded special list size in fix bond/create");
for (m = n3; m > n1; m--) slist[m+1] = slist[m];
slist[n1] = tag[j];
nspecial[i][0]++;

View File

@ -41,7 +41,7 @@ using namespace LAMMPS_NS;
FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg != 6) error->all("Illegal fix bond/swap command");
if (narg != 6) error->all(FLERR,"Illegal fix bond/swap command");
vector_flag = 1;
size_vector = 2;
@ -111,11 +111,11 @@ void FixBondSwap::init()
// require an atom style with molecule IDs
if (atom->molecule == NULL)
error->all("Must use atom style with molecule IDs with fix bond/swap");
error->all(FLERR,"Must use atom style with molecule IDs with fix bond/swap");
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all("Temperature ID for fix bond/swap does not exist");
error->all(FLERR,"Temperature ID for fix bond/swap does not exist");
temperature = modify->compute[icompute];
// pair and bonds must be defined
@ -123,20 +123,20 @@ void FixBondSwap::init()
// special bonds must be 0 1 1
if (force->pair == NULL || force->bond == NULL)
error->all("Fix bond/swap requires pair and bond styles");
error->all(FLERR,"Fix bond/swap requires pair and bond styles");
if (force->pair->single_enable == 0)
error->all("Pair style does not support fix bond/swap");
error->all(FLERR,"Pair style does not support fix bond/swap");
if (force->angle == NULL && atom->nangles > 0 && comm->me == 0)
error->warning("Fix bond/swap will ignore defined angles");
error->warning(FLERR,"Fix bond/swap will ignore defined angles");
if (force->dihedral || force->improper)
error->all("Fix bond/swap cannot use dihedral or improper styles");
error->all(FLERR,"Fix bond/swap cannot use dihedral or improper styles");
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0)
error->all("Fix bond/swap requires special_bonds = 0,1,1");
error->all(FLERR,"Fix bond/swap requires special_bonds = 0,1,1");
// need a half neighbor list, built when ever re-neighboring occurs
@ -596,7 +596,7 @@ void FixBondSwap::pre_neighbor()
int FixBondSwap::modify_param(int narg, char **arg)
{
if (strcmp(arg[0],"temp") == 0) {
if (narg < 2) error->all("Illegal fix_modify command");
if (narg < 2) error->all(FLERR,"Illegal fix_modify command");
if (tflag) {
modify->delete_compute(id_temp);
tflag = 0;
@ -607,13 +607,13 @@ int FixBondSwap::modify_param(int narg, char **arg)
strcpy(id_temp,arg[1]);
int icompute = modify->find_compute(id_temp);
if (icompute < 0) error->all("Could not find fix_modify temperature ID");
if (icompute < 0) error->all(FLERR,"Could not find fix_modify temperature ID");
temperature = modify->compute[icompute];
if (temperature->tempflag == 0)
error->all("Fix_modify temperature ID does not compute temperature");
error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
if (temperature->igroup != igroup && comm->me == 0)
error->warning("Group for fix_modify temp != fix group");
error->warning(FLERR,"Group for fix_modify temp != fix group");
return 2;
}
return 0;

View File

@ -40,7 +40,7 @@ using namespace LAMMPS_NS;
FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 11) error->all("Illegal fix GCMC command");
if (narg < 11) error->all(FLERR,"Illegal fix GCMC command");
vector_flag = 1;
size_vector = 6;
@ -61,12 +61,12 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) :
displace = atof(arg[10]);
if (ntype <= 0 || ntype > atom->ntypes)
error->all("Invalid atom type in fix GCMC command");
if (nexchanges < 0) error->all("Illegal fix GCMC command");
if (nmcmoves < 0) error->all("Illegal fix GCMC command");
if (seed <= 0) error->all("Illegal fix GCMC command");
if (reservoir_temperature < 0.0) error->all("Illegal fix GCMC command");
if (displace < 0.0) error->all("Illegal fix GCMC command");
error->all(FLERR,"Invalid atom type in fix GCMC command");
if (nexchanges < 0) error->all(FLERR,"Illegal fix GCMC command");
if (nmcmoves < 0) error->all(FLERR,"Illegal fix GCMC command");
if (seed <= 0) error->all(FLERR,"Illegal fix GCMC command");
if (reservoir_temperature < 0.0) error->all(FLERR,"Illegal fix GCMC command");
if (displace < 0.0) error->all(FLERR,"Illegal fix GCMC command");
// compute beta, lambda, sigma, and the zz factor
@ -157,7 +157,7 @@ void FixGCMC::init()
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall)
error->all("Cannot do GCMC on atoms in atom_modify first group");
error->all(FLERR,"Cannot do GCMC on atoms in atom_modify first group");
}
// if molflag not set, warn if any deletable atom has a mol ID
@ -173,16 +173,16 @@ void FixGCMC::init()
int flagall;
MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
if (flagall && comm->me == 0)
error->warning("Fix GCMC may delete atom with non-zero molecule ID");
error->warning(FLERR,"Fix GCMC may delete atom with non-zero molecule ID");
}
if (molflag && atom->molecule_flag == 0)
error->all("Fix GCMC molecule command requires atom attribute molecule");
error->all(FLERR,"Fix GCMC molecule command requires atom attribute molecule");
if (molflag != 0) error->all("Fix GCMC molecule feature does not yet work");
if (molflag != 0) error->all(FLERR,"Fix GCMC molecule feature does not yet work");
if (force->pair->single_enable == 0)
error->all("Fix GCMC incompatible with given pair_style");
error->all(FLERR,"Fix GCMC incompatible with given pair_style");
}
/* ----------------------------------------------------------------------
@ -485,17 +485,17 @@ double FixGCMC::energy(int i, double *coord)
void FixGCMC::options(int narg, char **arg)
{
if (narg < 0) error->all("Illegal fix GCMC command");
if (narg < 0) error->all(FLERR,"Illegal fix GCMC command");
int iarg = 0;
while (iarg < narg) {
if (strcmp(arg[iarg],"molecule") == 0) {
if (iarg+2 > narg) error->all("Illegal fix GCMC command");
if (iarg+2 > narg) error->all(FLERR,"Illegal fix GCMC command");
if (strcmp(arg[iarg+1],"no") == 0) molflag = 0;
else if (strcmp(arg[iarg+1],"yes") == 0) molflag = 1;
else error->all("Illegal fix evaporate command");
else error->all(FLERR,"Illegal fix evaporate command");
iarg += 2;
} else error->all("Illegal fix GCMC command");
} else error->all(FLERR,"Illegal fix GCMC command");
}
}

View File

@ -32,9 +32,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
/* ---------------------------------------------------------------------- */
PairDSMC::PairDSMC(LAMMPS *lmp) : Pair(lmp)
@ -157,9 +154,9 @@ void PairDSMC::compute(int eflag, int vflag)
convert_double_to_equivalent_int(num_of_collisions_double);
if (num_of_collisions > number_of_A)
error->warning("Pair dsmc: num_of_collisions > number_of_A",0);
error->warning(FLERR,"Pair dsmc: num_of_collisions > number_of_A",0);
if (num_of_collisions > number_of_B)
error->warning("Pair dsmc: num_of_collisions > number_of_B",0);
error->warning(FLERR,"Pair dsmc: num_of_collisions > number_of_B",0);
// perform collisions on pairs of particles in icell
@ -208,7 +205,7 @@ void PairDSMC::allocate()
void PairDSMC::settings(int narg, char **arg)
{
if (narg != 6) error->all("Illegal pair_style command");
if (narg != 6) error->all(FLERR,"Illegal pair_style command");
cut_global = 0.0;
max_cell_size = force->numeric(arg[0]);
@ -220,8 +217,8 @@ void PairDSMC::settings(int narg, char **arg)
// initialize Marsaglia RNG with processor-unique seed
if (max_cell_size <= 0.0) error->all("Illegal pair_style command");
if (seed <= 0) error->all("Illegal pair_style command");
if (max_cell_size <= 0.0) error->all(FLERR,"Illegal pair_style command");
if (seed <= 0) error->all(FLERR,"Illegal pair_style command");
if (random) delete random;
random = new RanMars(lmp,seed + comm->me);
@ -243,7 +240,7 @@ void PairDSMC::settings(int narg, char **arg)
void PairDSMC::coeff(int narg, char **arg)
{
if (narg < 3 || narg > 4) error->all("Incorrect args for pair coefficients");
if (narg < 3 || narg > 4) error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
@ -265,7 +262,7 @@ void PairDSMC::coeff(int narg, char **arg)
}
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -518,7 +515,7 @@ void PairDSMC::scatter_random(int i, int j, int icell)
int PairDSMC::convert_double_to_equivalent_int(double input_double)
{
if (input_double > INT_MAX)
error->all("Tried to convert a double to int, but input_double > INT_MAX");
error->all(FLERR,"Tried to convert a double to int, but input_double > INT_MAX");
int output_int = static_cast<int>(input_double + random->uniform());
return output_int;

View File

@ -32,9 +32,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MAXLINE 1024
enum{FCC,BCC,HCP,DIM,DIAMOND,B1,C11,L12,B2};
@ -247,7 +244,7 @@ void PairMEAM::compute(int eflag, int vflag)
if (errorflag) {
char str[128];
sprintf(str,"MEAM library error %d",errorflag);
error->one(str);
error->one(FLERR,str);
}
offset += numneigh_half[i];
}
@ -262,7 +259,7 @@ void PairMEAM::compute(int eflag, int vflag)
if (errorflag) {
char str[128];
sprintf(str,"MEAM library error %d",errorflag);
error->one(str);
error->one(FLERR,str);
}
comm->forward_comm_pair(this);
@ -290,7 +287,7 @@ void PairMEAM::compute(int eflag, int vflag)
if (errorflag) {
char str[128];
sprintf(str,"MEAM library error %d",errorflag);
error->one(str);
error->one(FLERR,str);
}
offset += numneigh_half[i];
}
@ -323,7 +320,7 @@ void PairMEAM::allocate()
void PairMEAM::settings(int narg, char **arg)
{
if (narg != 0) error->all("Illegal pair_style command");
if (narg != 0) error->all(FLERR,"Illegal pair_style command");
}
/* ----------------------------------------------------------------------
@ -336,12 +333,12 @@ void PairMEAM::coeff(int narg, char **arg)
if (!allocated) allocate();
if (narg < 6) error->all("Incorrect args for pair coefficients");
if (narg < 6) error->all(FLERR,"Incorrect args for pair coefficients");
// insure I,J args are * *
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all("Incorrect args for pair coefficients");
error->all(FLERR,"Incorrect args for pair coefficients");
// read MEAM element names between 2 filenames
// nelements = # of MEAM elements
@ -353,7 +350,7 @@ void PairMEAM::coeff(int narg, char **arg)
delete [] mass;
}
nelements = narg - 4 - atom->ntypes;
if (nelements < 1) error->all("Incorrect args for pair coefficients");
if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
elements = new char*[nelements];
mass = new double[nelements];
@ -379,7 +376,7 @@ void PairMEAM::coeff(int narg, char **arg)
if (strcmp(arg[i],elements[j]) == 0) break;
if (j < nelements) map[m] = j;
else if (strcmp(arg[i],"NULL") == 0) map[m] = -1;
else error->all("Incorrect args for pair coefficients");
else error->all(FLERR,"Incorrect args for pair coefficients");
}
// clear setflag since coeff() called once with I,J = * *
@ -401,7 +398,7 @@ void PairMEAM::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -411,7 +408,7 @@ void PairMEAM::coeff(int narg, char **arg)
void PairMEAM::init_style()
{
if (force->newton_pair == 0)
error->all("Pair style MEAM requires newton pair on");
error->all(FLERR,"Pair style MEAM requires newton pair on");
// need full and half neighbor list
@ -464,7 +461,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open MEAM potential file %s",globalfile);
error->one(str);
error->one(FLERR,str);
}
}
@ -544,7 +541,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
}
if (nwords != params_per_line)
error->all("Incorrect format in MEAM potential file");
error->all(FLERR,"Incorrect format in MEAM potential file");
// words = ptrs to all words in line
// strip single and double quotes from words
@ -571,7 +568,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
else if (strcmp(words[1],"hcp") == 0) lat[i] = HCP;
else if (strcmp(words[1],"dim") == 0) lat[i] = DIM;
else if (strcmp(words[1],"dia") == 0) lat[i] = DIAMOND;
else error->all("Unrecognized lattice type in MEAM file 1");
else error->all(FLERR,"Unrecognized lattice type in MEAM file 1");
// store parameters
@ -599,7 +596,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
// error if didn't find all elements in file
if (nset != nelements)
error->all("Did not find all elements in MEAM library file");
error->all(FLERR,"Did not find all elements in MEAM library file");
// pass element parameters to MEAM package
@ -645,7 +642,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open MEAM potential file %s",userfile);
error->one(str);
error->one(FLERR,str);
}
}
@ -695,7 +692,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
char str[128];
sprintf(str,"Keyword %s in MEAM parameter file not recognized",
params[0]);
error->all(str);
error->all(FLERR,str);
}
nindex = nparams - 2;
for (i = 0; i < nindex; i++) index[i] = atoi(params[i+1]);
@ -712,7 +709,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
else if (strcmp(params[nparams-1],"c11") == 0) value = C11;
else if (strcmp(params[nparams-1],"l12") == 0) value = L12;
else if (strcmp(params[nparams-1],"b2") == 0) value = B2;
else error->all("Unrecognized lattice type in MEAM file 2");
else error->all(FLERR,"Unrecognized lattice type in MEAM file 2");
}
else value = atof(params[nparams-1]);
@ -723,7 +720,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
if (errorflag) {
char str[128];
sprintf(str,"MEAM library error %d",errorflag);
error->all(str);
error->all(FLERR,str);
}
}

View File

@ -193,7 +193,7 @@ void AngleCharmm::allocate()
void AngleCharmm::coeff(int narg, char **arg)
{
if (narg != 5) error->all("Incorrect args for angle coefficients");
if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -216,7 +216,7 @@ void AngleCharmm::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */

View File

@ -152,7 +152,7 @@ void AngleCosine::allocate()
void AngleCosine::coeff(int narg, char **arg)
{
if (narg != 2) error->all("Incorrect args for angle coefficients");
if (narg != 2) error->all(FLERR,"Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -167,7 +167,7 @@ void AngleCosine::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */

View File

@ -199,7 +199,7 @@ void AngleCosinePeriodic::allocate()
void AngleCosinePeriodic::coeff(int narg, char **arg)
{
if (narg != 4) error->all("Incorrect args for angle coefficients");
if (narg != 4) error->all(FLERR,"Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -208,7 +208,7 @@ void AngleCosinePeriodic::coeff(int narg, char **arg)
double c_one = atof(arg[1]);
int b_one = atoi(arg[2]);
int n_one = atoi(arg[3]);
if (n_one <= 0) error->all("Incorrect args for angle coefficients");
if (n_one <= 0) error->all(FLERR,"Incorrect args for angle coefficients");
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -219,7 +219,7 @@ void AngleCosinePeriodic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */

View File

@ -164,7 +164,7 @@ void AngleCosineSquared::allocate()
void AngleCosineSquared::coeff(int narg, char **arg)
{
if (narg != 3) error->all("Incorrect args for angle coefficients");
if (narg != 3) error->all(FLERR,"Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -183,7 +183,7 @@ void AngleCosineSquared::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */

View File

@ -164,7 +164,7 @@ void AngleHarmonic::allocate()
void AngleHarmonic::coeff(int narg, char **arg)
{
if (narg != 3) error->all("Incorrect args for angle coefficients");
if (narg != 3) error->all(FLERR,"Incorrect args for angle coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -183,7 +183,7 @@ void AngleHarmonic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for angle coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients");
}
/* ---------------------------------------------------------------------- */

View File

@ -162,7 +162,7 @@ void AngleHybrid::settings(int narg, char **arg)
{
int i,m,istyle;
if (narg < 1) error->all("Illegal angle_style command");
if (narg < 1) error->all(FLERR,"Illegal angle_style command");
// delete old lists, since cannot just change settings
@ -212,11 +212,11 @@ void AngleHybrid::settings(int narg, char **arg)
while (i < narg) {
for (m = 0; m < nstyles; m++)
if (strcmp(arg[i],keywords[m]) == 0)
error->all("Angle style hybrid cannot use same pair style twice");
error->all(FLERR,"Angle style hybrid cannot use same pair style twice");
if (strcmp(arg[i],"hybrid") == 0)
error->all("Angle style hybrid cannot have hybrid as an argument");
error->all(FLERR,"Angle style hybrid cannot have hybrid as an argument");
if (strcmp(arg[i],"none") == 0)
error->all("Angle style hybrid cannot have none as an argument");
error->all(FLERR,"Angle style hybrid cannot have none as an argument");
styles[nstyles] = force->new_angle(arg[i]);
keywords[nstyles] = new char[strlen(arg[i])+1];
strcpy(keywords[nstyles],arg[i]);
@ -252,7 +252,7 @@ void AngleHybrid::coeff(int narg, char **arg)
if (m == nstyles) {
if (strcmp(arg[1],"none") == 0) none = 1;
else if (strcmp(arg[1],"skip") == 0) none = skip = 1;
else error->all("Angle coeff for hybrid has invalid style");
else error->all(FLERR,"Angle coeff for hybrid has invalid style");
}
// move 1st arg to 2nd arg
@ -286,7 +286,8 @@ void AngleHybrid::coeff(int narg, char **arg)
double AngleHybrid::equilibrium_angle(int i)
{
if (map[i] < 0) error->one("Invoked angle equil angle on angle style none");
if (map[i] < 0)
error->one(FLERR,"Invoked angle equil angle on angle style none");
return styles[map[i]]->equilibrium_angle(i);
}
@ -335,7 +336,7 @@ void AngleHybrid::read_restart(FILE *fp)
double AngleHybrid::single(int type, int i1, int i2, int i3)
{
if (map[type] < 0) error->one("Invoked angle single on angle style none");
if (map[type] < 0) error->one(FLERR,"Invoked angle single on angle style none");
return styles[map[type]]->single(type,i1,i2,i3);
}

View File

@ -29,9 +29,6 @@
using namespace LAMMPS_NS;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
enum{LINEAR,SPLINE};
#define MAXLINE 1024
@ -183,14 +180,14 @@ void AngleTable::allocate()
void AngleTable::settings(int narg, char **arg)
{
if (narg != 2) error->all("Illegal angle_style command");
if (narg != 2) error->all(FLERR,"Illegal angle_style command");
if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR;
else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE;
else error->all("Unknown table style in angle style table");
else error->all(FLERR,"Unknown table style in angle style table");
tablength = force->inumeric(arg[1]);
if (tablength < 2) error->all("Illegal number of angle table entries");
if (tablength < 2) error->all(FLERR,"Illegal number of angle table entries");
// delete old tables, since cannot just change settings
@ -213,7 +210,7 @@ void AngleTable::settings(int narg, char **arg)
void AngleTable::coeff(int narg, char **arg)
{
if (narg != 3) error->all("Illegal angle_coeff command");
if (narg != 3) error->all(FLERR,"Illegal angle_coeff command");
if (!allocated) allocate();
int ilo,ihi;
@ -230,13 +227,13 @@ void AngleTable::coeff(int narg, char **arg)
// error check on table parameters
if (tb->ninput <= 1) error->one("Invalid angle table length");
if (tb->ninput <= 1) error->one(FLERR,"Invalid angle table length");
double alo,ahi;
alo = tb->afile[0];
ahi = tb->afile[tb->ninput-1];
if (fabs(alo-0.0) > TINY || fabs(ahi-180.0) > TINY)
error->all("Angle table must range from 0 to 180 degrees");
error->all(FLERR,"Angle table must range from 0 to 180 degrees");
// convert theta from degrees to radians
@ -261,7 +258,7 @@ void AngleTable::coeff(int narg, char **arg)
}
ntables++;
if (count == 0) error->all("Illegal angle_coeff command");
if (count == 0) error->all(FLERR,"Illegal angle_coeff command");
}
/* ----------------------------------------------------------------------
@ -372,14 +369,14 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open file %s",file);
error->one(str);
error->one(FLERR,str);
}
// loop until section found with matching keyword
while (1) {
if (fgets(line,MAXLINE,fp) == NULL)
error->one("Did not find keyword in table file");
error->one(FLERR,"Did not find keyword in table file");
if (strspn(line," \t\n") == strlen(line)) continue; // blank line
if (line[0] == '#') continue; // comment
if (strstr(line,keyword) == line) break; // matching keyword
@ -510,12 +507,12 @@ void AngleTable::param_extract(Table *tb, char *line)
word = strtok(NULL," \t\n\r\f");
tb->theta0 = atof(word);
} else {
error->one("Invalid keyword in angle table parameters");
error->one(FLERR,"Invalid keyword in angle table parameters");
}
word = strtok(NULL," \t\n\r\f");
}
if (tb->ninput == 0) error->one("Angle table parameters did not set N");
if (tb->ninput == 0) error->one(FLERR,"Angle table parameters did not set N");
}
/* ----------------------------------------------------------------------

View File

@ -23,9 +23,6 @@
using namespace LAMMPS_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
#define DELTA 10000
/* ---------------------------------------------------------------------- */
@ -61,7 +58,7 @@ void AtomVecAngle::grow(int n)
else nmax = n;
atom->nmax = nmax;
if (nmax < 0 || nmax > MAXSMALLINT)
error->one("Per-processor system is too big");
error->one(FLERR,"Per-processor system is too big");
tag = memory->grow(atom->tag,nmax,"atom:tag");
type = memory->grow(atom->type,nmax,"atom:type");
@ -763,13 +760,13 @@ void AtomVecAngle::data_atom(double *coord, int imagetmp, char **values)
tag[nlocal] = atoi(values[0]);
if (tag[nlocal] <= 0)
error->one("Invalid atom ID in Atoms section of data file");
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
molecule[nlocal] = atoi(values[1]);
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one("Invalid atom type in Atoms section of data file");
error->one(FLERR,"Invalid atom type in Atoms section of data file");
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];

View File

@ -24,9 +24,6 @@
using namespace LAMMPS_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
#define DELTA 10000
/* ---------------------------------------------------------------------- */
@ -62,7 +59,7 @@ void AtomVecBond::grow(int n)
else nmax = n;
atom->nmax = nmax;
if (nmax < 0 || nmax > MAXSMALLINT)
error->one("Per-processor system is too big");
error->one(FLERR,"Per-processor system is too big");
tag = memory->grow(atom->tag,nmax,"atom:tag");
type = memory->grow(atom->type,nmax,"atom:type");
@ -723,13 +720,13 @@ void AtomVecBond::data_atom(double *coord, int imagetmp, char **values)
tag[nlocal] = atoi(values[0]);
if (tag[nlocal] <= 0)
error->one("Invalid atom ID in Atoms section of data file");
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
molecule[nlocal] = atoi(values[1]);
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one("Invalid atom type in Atoms section of data file");
error->one(FLERR,"Invalid atom type in Atoms section of data file");
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];

View File

@ -24,9 +24,6 @@
using namespace LAMMPS_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
#define DELTA 10000
/* ---------------------------------------------------------------------- */
@ -62,7 +59,7 @@ void AtomVecFull::grow(int n)
else nmax = n;
atom->nmax = nmax;
if (nmax < 0 || nmax > MAXSMALLINT)
error->one("Per-processor system is too big");
error->one(FLERR,"Per-processor system is too big");
tag = memory->grow(atom->tag,nmax,"atom:tag");
type = memory->grow(atom->type,nmax,"atom:type");
@ -926,13 +923,13 @@ void AtomVecFull::data_atom(double *coord, int imagetmp, char **values)
tag[nlocal] = atoi(values[0]);
if (tag[nlocal] <= 0)
error->one("Invalid atom ID in Atoms section of data file");
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
molecule[nlocal] = atoi(values[1]);
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one("Invalid atom type in Atoms section of data file");
error->one(FLERR,"Invalid atom type in Atoms section of data file");
q[nlocal] = atof(values[3]);

View File

@ -24,9 +24,6 @@
using namespace LAMMPS_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
#define DELTA 10000
/* ---------------------------------------------------------------------- */
@ -62,7 +59,7 @@ void AtomVecMolecular::grow(int n)
else nmax = n;
atom->nmax = nmax;
if (nmax < 0 || nmax > MAXSMALLINT)
error->one("Per-processor system is too big");
error->one(FLERR,"Per-processor system is too big");
tag = memory->grow(atom->tag,nmax,"atom:tag");
type = memory->grow(atom->type,nmax,"atom:type");
@ -909,13 +906,13 @@ void AtomVecMolecular::data_atom(double *coord, int imagetmp, char **values)
tag[nlocal] = atoi(values[0]);
if (tag[nlocal] <= 0)
error->one("Invalid atom ID in Atoms section of data file");
error->one(FLERR,"Invalid atom ID in Atoms section of data file");
molecule[nlocal] = atoi(values[1]);
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one("Invalid atom type in Atoms section of data file");
error->one(FLERR,"Invalid atom type in Atoms section of data file");
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];

View File

@ -89,8 +89,8 @@ void BondFENE::compute(int eflag, int vflag)
char str[128];
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
error->warning(str,0);
if (rlogarg <= -3.0) error->one("Bad FENE bond");
error->warning(FLERR,str,0);
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
rlogarg = 0.1;
}
@ -151,7 +151,7 @@ void BondFENE::allocate()
void BondFENE::coeff(int narg, char **arg)
{
if (narg != 5) error->all("Incorrect args for bond coefficients");
if (narg != 5) error->all(FLERR,"Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -172,7 +172,7 @@ void BondFENE::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -186,7 +186,7 @@ void BondFENE::init_style()
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0) {
if (comm->me == 0)
error->warning("Use special bonds = 0,1,1 with bond style fene");
error->warning(FLERR,"Use special bonds = 0,1,1 with bond style fene");
}
}
@ -246,8 +246,8 @@ double BondFENE::single(int type, double rsq, int i, int j)
char str[128];
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %g",
update->ntimestep,sqrt(rsq));
error->warning(str,0);
if (rlogarg <= -3.0) error->one("Bad FENE bond");
error->warning(FLERR,str,0);
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
rlogarg = 0.1;
}

View File

@ -94,8 +94,8 @@ void BondFENEExpand::compute(int eflag, int vflag)
char str[128];
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
error->warning(str,0);
if (rlogarg <= -3.0) error->one("Bad FENE bond");
error->warning(FLERR,str,0);
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
rlogarg = 0.1;
}
@ -157,7 +157,7 @@ void BondFENEExpand::allocate()
void BondFENEExpand::coeff(int narg, char **arg)
{
if (narg != 6) error->all("Incorrect args for bond coefficients");
if (narg != 6) error->all(FLERR,"Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -180,7 +180,7 @@ void BondFENEExpand::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -194,7 +194,7 @@ void BondFENEExpand::init_style()
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0) {
if (comm->me == 0)
error->warning("Use special bonds = 0,1,1 with bond style fene/expand");
error->warning(FLERR,"Use special bonds = 0,1,1 with bond style fene/expand");
}
}
@ -260,8 +260,8 @@ double BondFENEExpand::single(int type, double rsq, int i, int j)
char str[128];
sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %g",
update->ntimestep,sqrt(rsq));
error->warning(str,0);
if (rlogarg <= -3.0) error->one("Bad FENE bond");
error->warning(FLERR,str,0);
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
rlogarg = 0.1;
}

View File

@ -118,7 +118,7 @@ void BondHarmonic::allocate()
void BondHarmonic::coeff(int narg, char **arg)
{
if (narg != 3) error->all("Incorrect args for bond coefficients");
if (narg != 3) error->all(FLERR,"Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -135,7 +135,7 @@ void BondHarmonic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------

View File

@ -123,7 +123,7 @@ void BondMorse::allocate()
void BondMorse::coeff(int narg, char **arg)
{
if (narg != 4) error->all("Incorrect args for bond coefficients");
if (narg != 4) error->all(FLERR,"Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -142,7 +142,7 @@ void BondMorse::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------

View File

@ -120,7 +120,7 @@ void BondNonlinear::allocate()
void BondNonlinear::coeff(int narg, char **arg)
{
if (narg != 4) error->all("Incorrect args for bond coefficients");
if (narg != 4) error->all(FLERR,"Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -139,7 +139,7 @@ void BondNonlinear::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
}
/* ---------------------------------------------------------------------- */

View File

@ -200,7 +200,7 @@ void BondQuartic::allocate()
void BondQuartic::coeff(int narg, char **arg)
{
if (narg != 6) error->all("Incorrect args for bond coefficients");
if (narg != 6) error->all(FLERR,"Incorrect args for bond coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -223,7 +223,7 @@ void BondQuartic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for bond coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients");
}
/* ----------------------------------------------------------------------
@ -233,19 +233,19 @@ void BondQuartic::coeff(int narg, char **arg)
void BondQuartic::init_style()
{
if (force->pair == NULL || force->pair->single_enable == 0)
error->all("Pair style does not support bond_style quartic");
error->all(FLERR,"Pair style does not support bond_style quartic");
if (force->angle)
error->all("Bond style quartic cannot be used with 3,4-body interactions");
error->all(FLERR,"Bond style quartic cannot be used with 3,4-body interactions");
if (force->dihedral)
error->all("Bond style quartic cannot be used with 3,4-body interactions");
error->all(FLERR,"Bond style quartic cannot be used with 3,4-body interactions");
if (force->improper)
error->all("Bond style quartic cannot be used with 3,4-body interactions");
error->all(FLERR,"Bond style quartic cannot be used with 3,4-body interactions");
// special bonds must be 1 1 1
if (force->special_lj[1] != 1.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0)
error->all("Bond style quartic requires special_bonds = 1,1,1");
error->all(FLERR,"Bond style quartic requires special_bonds = 1,1,1");
}
/* ----------------------------------------------------------------------

View File

@ -33,9 +33,6 @@ enum{LINEAR,SPLINE};
#define MAXLINE 1024
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
/* ---------------------------------------------------------------------- */
BondTable::BondTable(LAMMPS *lmp) : Bond(lmp)
@ -135,14 +132,14 @@ void BondTable::allocate()
void BondTable::settings(int narg, char **arg)
{
if (narg != 2) error->all("Illegal bond_style command");
if (narg != 2) error->all(FLERR,"Illegal bond_style command");
if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR;
else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE;
else error->all("Unknown table style in bond style table");
else error->all(FLERR,"Unknown table style in bond style table");
tablength = force->inumeric(arg[1]);
if (tablength < 2) error->all("Illegal number of bond table entries");
if (tablength < 2) error->all(FLERR,"Illegal number of bond table entries");
// delete old tables, since cannot just change settings
@ -165,7 +162,7 @@ void BondTable::settings(int narg, char **arg)
void BondTable::coeff(int narg, char **arg)
{
if (narg != 3) error->all("Illegal bond_coeff command");
if (narg != 3) error->all(FLERR,"Illegal bond_coeff command");
if (!allocated) allocate();
int ilo,ihi;
@ -182,11 +179,11 @@ void BondTable::coeff(int narg, char **arg)
// error check on table parameters
if (tb->ninput <= 1) error->one("Invalid bond table length");
if (tb->ninput <= 1) error->one(FLERR,"Invalid bond table length");
tb->lo = tb->rfile[0];
tb->hi = tb->rfile[tb->ninput-1];
if (tb->lo >= tb->hi) error->all("Bond table values are not increasing");
if (tb->lo >= tb->hi) error->all(FLERR,"Bond table values are not increasing");
// spline read-in and compute r,e,f vectors within table
@ -204,7 +201,7 @@ void BondTable::coeff(int narg, char **arg)
}
ntables++;
if (count == 0) error->all("Illegal bond_coeff command");
if (count == 0) error->all(FLERR,"Illegal bond_coeff command");
}
/* ----------------------------------------------------------------------
@ -296,14 +293,14 @@ void BondTable::read_table(Table *tb, char *file, char *keyword)
if (fp == NULL) {
char str[128];
sprintf(str,"Cannot open file %s",file);
error->one(str);
error->one(FLERR,str);
}
// loop until section found with matching keyword
while (1) {
if (fgets(line,MAXLINE,fp) == NULL)
error->one("Did not find keyword in table file");
error->one(FLERR,"Did not find keyword in table file");
if (strspn(line," \t\n") == strlen(line)) continue; // blank line
if (line[0] == '#') continue; // comment
if (strstr(line,keyword) == line) break; // matching keyword
@ -433,12 +430,12 @@ void BondTable::param_extract(Table *tb, char *line)
word = strtok(NULL," \t\n\r\f");
tb->r0 = atof(word);
} else {
error->one("Invalid keyword in bond table parameters");
error->one(FLERR,"Invalid keyword in bond table parameters");
}
word = strtok(NULL," \t\n\r\f");
}
if (tb->ninput == 0) error->one("Bond table parameters did not set N");
if (tb->ninput == 0) error->one(FLERR,"Bond table parameters did not set N");
}
/* ----------------------------------------------------------------------

View File

@ -151,7 +151,7 @@ void DihedralCharmm::compute(int eflag, int vflag)
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0);
error->warning(FLERR,str,0);
fprintf(screen," 1st atom: %d %g %g %g\n",
me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n",
@ -324,7 +324,7 @@ void DihedralCharmm::allocate()
void DihedralCharmm::coeff(int narg, char **arg)
{
if (narg != 5) error->all("Incorrect args for dihedral coefficients");
if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -340,9 +340,9 @@ void DihedralCharmm::coeff(int narg, char **arg)
double weight_one = force->numeric(arg[4]);
if (multiplicity_one < 0)
error->all("Incorrect multiplicity arg for dihedral coefficients");
error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
if (weight_one < 0.0 || weight_one > 1.0)
error->all("Incorrect weight arg for dihedral coefficients");
error->all(FLERR,"Incorrect weight arg for dihedral coefficients");
double PI = 4.0*atan(1.0);
@ -358,7 +358,7 @@ void DihedralCharmm::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------
@ -377,14 +377,14 @@ void DihedralCharmm::init_style()
if (weightflag) {
int itmp;
if (force->pair == NULL)
error->all("Dihedral charmm is incompatible with Pair style");
error->all(FLERR,"Dihedral charmm is incompatible with Pair style");
lj14_1 = (double **) force->pair->extract("lj14_1",itmp);
lj14_2 = (double **) force->pair->extract("lj14_2",itmp);
lj14_3 = (double **) force->pair->extract("lj14_3",itmp);
lj14_4 = (double **) force->pair->extract("lj14_4",itmp);
int *ptr = (int *) force->pair->extract("implicit",itmp);
if (!lj14_1 || !lj14_2 || !lj14_3 || !lj14_4 || !ptr)
error->all("Dihedral charmm is incompatible with Pair style");
error->all(FLERR,"Dihedral charmm is incompatible with Pair style");
implicit = *ptr;
}
}

View File

@ -141,7 +141,7 @@ void DihedralHarmonic::compute(int eflag, int vflag)
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0);
error->warning(FLERR,str,0);
fprintf(screen," 1st atom: %d %g %g %g\n",
me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n",
@ -272,7 +272,7 @@ void DihedralHarmonic::allocate()
void DihedralHarmonic::coeff(int narg, char **arg)
{
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
if (narg != 4) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -287,9 +287,9 @@ void DihedralHarmonic::coeff(int narg, char **arg)
// backwards compatibility and is probably not needed
if (sign_one != -1 && sign_one != 1)
error->all("Incorrect sign arg for dihedral coefficients");
error->all(FLERR,"Incorrect sign arg for dihedral coefficients");
if (multiplicity_one < 0)
error->all("Incorrect multiplicity arg for dihedral coefficients");
error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
int count = 0;
for (int i = ilo; i <= ihi; i++) {
@ -307,7 +307,7 @@ void DihedralHarmonic::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------

View File

@ -32,9 +32,6 @@
using namespace LAMMPS_NS;
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
#define TOLERANCE 0.05
#define SMALL 0.001
#define SMALLER 0.00001
@ -173,7 +170,7 @@ void DihedralHelix::compute(int eflag, int vflag)
sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(str,0);
error->warning(FLERR,str,0);
fprintf(screen," 1st atom: %d %g %g %g\n",
me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n",
@ -284,7 +281,7 @@ void DihedralHelix::allocate()
void DihedralHelix::coeff(int narg, char **arg)
{
if (narg != 4) error->all("Incorrect args for dihedral coefficients");
if (narg != 4) error->all(FLERR,"Incorrect args for dihedral coefficients");
if (!allocated) allocate();
int ilo,ihi;
@ -303,7 +300,7 @@ void DihedralHelix::coeff(int narg, char **arg)
count++;
}
if (count == 0) error->all("Incorrect args for dihedral coefficients");
if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients");
}
/* ----------------------------------------------------------------------

View File

@ -168,12 +168,12 @@ void DihedralHybrid::settings(int narg, char **arg)
for (int m = 0; m < nstyles; m++) {
for (int i = 0; i < m; i++)
if (strcmp(arg[m],arg[i]) == 0)
error->all("Dihedral style hybrid cannot use "
error->all(FLERR,"Dihedral style hybrid cannot use "
"same dihedral style twice");
if (strcmp(arg[m],"hybrid") == 0)
error->all("Dihedral style hybrid cannot have hybrid as an argument");
error->all(FLERR,"Dihedral style hybrid cannot have hybrid as an argument");
if (strcmp(arg[m],"none") == 0)
error->all("Dihedral style hybrid cannot have none as an argument");
error->all(FLERR,"Dihedral style hybrid cannot have none as an argument");
styles[m] = force->new_dihedral(arg[m]);
keywords[m] = new char[strlen(arg[m])+1];
strcpy(keywords[m],arg[m]);
@ -203,7 +203,7 @@ void DihedralHybrid::coeff(int narg, char **arg)
if (m == nstyles) {
if (strcmp(arg[1],"none") == 0) none = 1;
else if (strcmp(arg[1],"skip") == 0) none = skip = 1;
else error->all("Dihedral coeff for hybrid has invalid style");
else error->all(FLERR,"Dihedral coeff for hybrid has invalid style");
}
// move 1st arg to 2nd arg

Some files were not shown because too many files have changed in this diff Show More