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

This commit is contained in:
sjplimp 2013-06-28 19:00:58 +00:00
parent fcc992d386
commit aa33af4032
94 changed files with 638 additions and 590 deletions

View File

@ -163,9 +163,9 @@ void Balance::command(int narg, char **arg)
if (dimension == 3) zflag = DYNAMIC;
if (strlen(arg[iarg+1]) > 3) error->all(FLERR,"Illegal balance command");
strcpy(bstr,arg[iarg+1]);
nitermax = atoi(arg[iarg+2]);
nitermax = force->inumeric(FLERR,arg[iarg+2]);
if (nitermax <= 0) error->all(FLERR,"Illegal balance command");
thresh = atof(arg[iarg+3]);
thresh = force->numeric(FLERR,arg[iarg+3]);
if (thresh < 1.0) error->all(FLERR,"Illegal balance command");
iarg += 4;

View File

@ -27,12 +27,13 @@
#include "output.h"
#include "group.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
enum{XYZ,TILT,BOUNDARY,ORTHO,TRICLINIC,SET,REMAP};
enum{FINAL,DELTA,SCALE};
enum{X,Y,Z,YZ,XZ,XY};
enum{XYZ=0,TILT,BOUNDARY,ORTHO,TRICLINIC,SET,REMAP};
enum{FINAL=0,DELTA,SCALE};
enum{X=0,Y,Z,YZ,XZ,XY};
/* ---------------------------------------------------------------------- */
@ -66,6 +67,7 @@ void ChangeBox::command(int narg, char **arg)
int dimension = domain->dimension;
ops = new Operation[narg-1];
memset(ops,0,(narg-1)*sizeof(Operation));
nops = 0;
int index;
@ -85,23 +87,23 @@ void ChangeBox::command(int narg, char **arg)
if (strcmp(arg[iarg+1],"final") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command");
ops[nops].flavor = FINAL;
ops[nops].flo = atof(arg[iarg+2]);
ops[nops].fhi = atof(arg[iarg+3]);
ops[nops].flo = force->numeric(FLERR,arg[iarg+2]);
ops[nops].fhi = force->numeric(FLERR,arg[iarg+3]);
ops[nops].vdim1 = ops[nops].vdim2 = -1;
nops++;
iarg += 4;
} else if (strcmp(arg[iarg+1],"delta") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command");
ops[nops].flavor = DELTA;
ops[nops].dlo = atof(arg[iarg+2]);
ops[nops].dhi = atof(arg[iarg+3]);
ops[nops].dlo = force->numeric(FLERR,arg[iarg+2]);
ops[nops].dhi = force->numeric(FLERR,arg[iarg+3]);
ops[nops].vdim1 = ops[nops].vdim2 = -1;
nops++;
iarg += 4;
} else if (strcmp(arg[iarg+1],"scale") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
ops[nops].flavor = SCALE;
ops[nops].scale = atof(arg[iarg+2]);
ops[nops].scale = force->numeric(FLERR,arg[iarg+2]);
ops[nops].vdim1 = ops[nops].vdim2 = -1;
nops++;
iarg += 3;
@ -131,13 +133,13 @@ void ChangeBox::command(int narg, char **arg)
if (strcmp(arg[iarg+1],"final") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
ops[nops].flavor = FINAL;
ops[nops].ftilt = atof(arg[iarg+2]);
ops[nops].ftilt = force->numeric(FLERR,arg[iarg+2]);
nops++;
iarg += 3;
} else if (strcmp(arg[iarg+1],"delta") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
ops[nops].flavor = DELTA;
ops[nops].dtilt = atof(arg[iarg+2]);
ops[nops].dtilt = force->numeric(FLERR,arg[iarg+2]);
nops++;
iarg += 3;
} else error->all(FLERR,"Illegal change_box command");

View File

@ -1699,7 +1699,7 @@ void Comm::set(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"cutoff") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
cutghostuser = atof(arg[iarg+1]);
cutghostuser = force->numeric(FLERR,arg[iarg+1]);
if (cutghostuser < 0.0)
error->all(FLERR,"Invalid cutoff in communicate command");
iarg += 2;
@ -1723,11 +1723,11 @@ void Comm::set_processors(int narg, char **arg)
if (narg < 3) error->all(FLERR,"Illegal processors command");
if (strcmp(arg[0],"*") == 0) user_procgrid[0] = 0;
else user_procgrid[0] = atoi(arg[0]);
else user_procgrid[0] = force->inumeric(FLERR,arg[0]);
if (strcmp(arg[1],"*") == 0) user_procgrid[1] = 0;
else user_procgrid[1] = atoi(arg[1]);
else user_procgrid[1] = force->inumeric(FLERR,arg[1]);
if (strcmp(arg[2],"*") == 0) user_procgrid[2] = 0;
else user_procgrid[2] = atoi(arg[2]);
else user_procgrid[2] = force->inumeric(FLERR,arg[2]);
if (user_procgrid[0] < 0 || user_procgrid[1] < 0 || user_procgrid[2] < 0)
error->all(FLERR,"Illegal processors command");
@ -1748,13 +1748,13 @@ void Comm::set_processors(int narg, char **arg)
if (iarg+6 > narg) error->all(FLERR,"Illegal processors command");
gridflag = TWOLEVEL;
ncores = atoi(arg[iarg+2]);
ncores = force->inumeric(FLERR,arg[iarg+2]);
if (strcmp(arg[iarg+3],"*") == 0) user_coregrid[0] = 0;
else user_coregrid[0] = atoi(arg[iarg+3]);
else user_coregrid[0] = force->inumeric(FLERR,arg[iarg+3]);
if (strcmp(arg[iarg+4],"*") == 0) user_coregrid[1] = 0;
else user_coregrid[1] = atoi(arg[iarg+4]);
else user_coregrid[1] = force->inumeric(FLERR,arg[iarg+4]);
if (strcmp(arg[iarg+5],"*") == 0) user_coregrid[2] = 0;
else user_coregrid[2] = atoi(arg[iarg+5]);
else user_coregrid[2] = force->inumeric(FLERR,arg[iarg+5]);
if (ncores <= 0 || user_coregrid[0] < 0 ||
user_coregrid[1] < 0 || user_coregrid[2] < 0)
@ -1797,8 +1797,8 @@ void Comm::set_processors(int narg, char **arg)
error->all(FLERR,
"Cannot use processors part command "
"without using partitions");
int isend = atoi(arg[iarg+1]);
int irecv = atoi(arg[iarg+2]);
int isend = force->inumeric(FLERR,arg[iarg+1]);
int irecv = force->inumeric(FLERR,arg[iarg+2]);
if (isend < 1 || isend > universe->nworlds ||
irecv < 1 || irecv > universe->nworlds || isend == irecv)
error->all(FLERR,"Invalid partitions in processors part command");

View File

@ -24,6 +24,7 @@
#include "atom_masks.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -111,7 +112,7 @@ void Compute::modify_params(int narg, char **arg)
while (iarg < narg) {
if (strcmp(arg[iarg],"extra") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
extra_dof = atoi(arg[iarg+1]);
extra_dof = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"dynamic") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");

View File

@ -41,7 +41,7 @@ ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[3],"fcc") == 0) nnn = 12;
else if (strcmp(arg[3],"bcc") == 0) nnn = 8;
else nnn = atoi(arg[3]);
else nnn = force->inumeric(FLERR,arg[3]);
if (nnn <= 0 || nnn % 2)
error->all(FLERR,"Illegal neighbor value for compute centro/atom command");

View File

@ -36,7 +36,7 @@ ComputeClusterAtom::ComputeClusterAtom(LAMMPS *lmp, int narg, char **arg) :
{
if (narg != 4) error->all(FLERR,"Illegal compute cluster/atom command");
double cutoff = atof(arg[3]);
double cutoff = force->numeric(FLERR,arg[3]);
cutsq = cutoff*cutoff;
peratom_flag = 1;

View File

@ -49,7 +49,7 @@ ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) :
peratom_flag = 1;
size_peratom_cols = 0;
double cutoff = atof(arg[3]);
double cutoff = force->numeric(FLERR,arg[3]);
if (cutoff < 0.0) error->all(FLERR,"Illegal compute cna/atom command");
cutsq = cutoff*cutoff;

View File

@ -36,7 +36,7 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 4) error->all(FLERR,"Illegal compute coord/atom command");
double cutoff = atof(arg[3]);
double cutoff = force->numeric(FLERR,arg[3]);
cutsq = cutoff*cutoff;
ncol = narg-4 + 1;

View File

@ -45,7 +45,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
array_flag = 1;
extarray = 0;
nbin = atoi(arg[3]);
nbin = force->inumeric(FLERR,arg[3]);
if (nbin < 1) error->all(FLERR,"Illegal compute rdf command");
if (narg == 4) npairs = 1;
else npairs = (narg-4)/2;

View File

@ -20,6 +20,7 @@
#include "group.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -37,9 +38,9 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
MPI_Comm_rank(world,&me);
nstart = atoi(arg[3]);
nstop = atoi(arg[4]);
nskip = atoi(arg[5]);
nstart = force->inumeric(FLERR,arg[3]);
nstop = force->inumeric(FLERR,arg[4]);
nskip = force->inumeric(FLERR,arg[5]);
if (nstart < 1 || nstop < nstart || nskip < 1)
error->all(FLERR,"Illegal compute slice command");

View File

@ -25,6 +25,7 @@
#include "region.h"
#include "random_park.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -50,7 +51,7 @@ void CreateAtoms::command(int narg, char **arg)
// parse arguments
if (narg < 2) error->all(FLERR,"Illegal create_atoms command");
itype = atoi(arg[0]);
itype = force->inumeric(FLERR,arg[0]);
if (itype <= 0 || itype > atom->ntypes)
error->all(FLERR,"Invalid atom type in create_atoms command");
@ -68,15 +69,15 @@ void CreateAtoms::command(int narg, char **arg)
} else if (strcmp(arg[1],"single") == 0) {
style = SINGLE;
if (narg < 5) error->all(FLERR,"Illegal create_atoms command");
xone[0] = atof(arg[2]);
xone[1] = atof(arg[3]);
xone[2] = atof(arg[4]);
xone[0] = force->numeric(FLERR,arg[2]);
xone[1] = force->numeric(FLERR,arg[3]);
xone[2] = force->numeric(FLERR,arg[4]);
iarg = 5;
} else if (strcmp(arg[1],"random") == 0) {
style = RANDOM;
if (narg < 5) error->all(FLERR,"Illegal create_atoms command");
nrandom = atoi(arg[2]);
seed = atoi(arg[3]);
nrandom = force->inumeric(FLERR,arg[2]);
seed = force->inumeric(FLERR,arg[3]);
if (strcmp(arg[4],"NULL") == 0) nregion = -1;
else {
nregion = domain->find_region(arg[4]);
@ -98,8 +99,8 @@ void CreateAtoms::command(int narg, char **arg)
while (iarg < narg) {
if (strcmp(arg[iarg],"basis") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
int ibasis = atoi(arg[iarg+1]);
itype = atoi(arg[iarg+2]);
int ibasis = force->inumeric(FLERR,arg[iarg+1]);
itype = force->inumeric(FLERR,arg[iarg+2]);
if (ibasis <= 0 || ibasis > nbasis ||
itype <= 0 || itype > atom->ntypes)
error->all(FLERR,"Invalid basis setting in create_atoms command");

View File

@ -94,7 +94,7 @@ void CreateBox::command(int narg, char **arg)
// set atom and topology type quantities
atom->ntypes = atoi(arg[0]);
atom->ntypes = force->inumeric(FLERR,arg[0]);
atom->nbondtypes = 0;
atom->nangletypes = 0;
atom->ndihedraltypes = 0;

View File

@ -228,7 +228,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
// read args
double cut = atof(arg[1]);
double cut = force->numeric(FLERR,arg[1]);
double cutsq = cut*cut;
int igroup1 = group->find(arg[2]);
@ -375,8 +375,8 @@ void DeleteAtoms::delete_porosity(int narg, char **arg)
int iregion = domain->find_region(arg[1]);
if (iregion == -1) error->all(FLERR,"Could not find delete_atoms region ID");
double porosity_fraction = atof(arg[2]);
int seed = atoi(arg[3]);
double porosity_fraction = force->numeric(FLERR,arg[2]);
int seed = force->inumeric(FLERR,arg[3]);
options(narg-4,&arg[4]);
RanMars *random = new RanMars(lmp,seed + comm->me);

View File

@ -76,7 +76,7 @@ void DeleteBonds::command(int narg, char **arg)
int which;
if (style != MULTI && style != STATS) {
if (narg < 3) error->all(FLERR,"Illegal delete_bonds command");
which = atoi(arg[2]);
which = force->inumeric(FLERR,arg[2]);
iarg++;
}

View File

@ -26,6 +26,7 @@
#include "math_const.h"
#include "random_park.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -89,9 +90,9 @@ void DisplaceAtoms::command(int narg, char **arg)
if (style == MOVE) {
double delx = xscale*atof(arg[2]);
double dely = yscale*atof(arg[3]);
double delz = zscale*atof(arg[4]);
double delx = xscale*force->numeric(FLERR,arg[2]);
double dely = yscale*force->numeric(FLERR,arg[3]);
double delz = zscale*force->numeric(FLERR,arg[4]);
double **x = atom->x;
int *mask = atom->mask;
@ -118,14 +119,14 @@ void DisplaceAtoms::command(int narg, char **arg)
double d_lo,d_hi;
if (d_dim == 0) {
d_lo = xscale*atof(arg[3]);
d_hi = xscale*atof(arg[4]);
d_lo = xscale*force->numeric(FLERR,arg[3]);
d_hi = xscale*force->numeric(FLERR,arg[4]);
} else if (d_dim == 1) {
d_lo = yscale*atof(arg[3]);
d_hi = yscale*atof(arg[4]);
d_lo = yscale*force->numeric(FLERR,arg[3]);
d_hi = yscale*force->numeric(FLERR,arg[4]);
} else if (d_dim == 2) {
d_lo = zscale*atof(arg[3]);
d_hi = zscale*atof(arg[4]);
d_lo = zscale*force->numeric(FLERR,arg[3]);
d_hi = zscale*force->numeric(FLERR,arg[4]);
}
int coord_dim;
@ -136,14 +137,14 @@ void DisplaceAtoms::command(int narg, char **arg)
double coord_lo,coord_hi;
if (coord_dim == 0) {
coord_lo = xscale*atof(arg[6]);
coord_hi = xscale*atof(arg[7]);
coord_lo = xscale*force->numeric(FLERR,arg[6]);
coord_hi = xscale*force->numeric(FLERR,arg[7]);
} else if (coord_dim == 1) {
coord_lo = yscale*atof(arg[6]);
coord_hi = yscale*atof(arg[7]);
coord_lo = yscale*force->numeric(FLERR,arg[6]);
coord_hi = yscale*force->numeric(FLERR,arg[7]);
} else if (coord_dim == 2) {
coord_lo = zscale*atof(arg[6]);
coord_hi = zscale*atof(arg[7]);
coord_lo = zscale*force->numeric(FLERR,arg[6]);
coord_hi = zscale*force->numeric(FLERR,arg[7]);
}
double **x = atom->x;
@ -169,10 +170,10 @@ void DisplaceAtoms::command(int narg, char **arg)
if (style == RANDOM) {
RanPark *random = new RanPark(lmp,1);
double dx = xscale*atof(arg[2]);
double dy = yscale*atof(arg[3]);
double dz = zscale*atof(arg[4]);
int seed = atoi(arg[5]);
double dx = xscale*force->numeric(FLERR,arg[2]);
double dy = yscale*force->numeric(FLERR,arg[3]);
double dz = zscale*force->numeric(FLERR,arg[4]);
int seed = force->inumeric(FLERR,arg[5]);
if (seed <= 0) error->all(FLERR,"Illegal displace_atoms random command");
double **x = atom->x;
@ -207,13 +208,13 @@ void DisplaceAtoms::command(int narg, char **arg)
double a[3],b[3],c[3],d[3],disp[3],runit[3];
int dim = domain->dimension;
point[0] = xscale*atof(arg[2]);
point[1] = yscale*atof(arg[3]);
point[2] = zscale*atof(arg[4]);
axis[0] = atof(arg[5]);
axis[1] = atof(arg[6]);
axis[2] = atof(arg[7]);
double theta = atof(arg[8]);
point[0] = xscale*force->numeric(FLERR,arg[2]);
point[1] = yscale*force->numeric(FLERR,arg[3]);
point[2] = zscale*force->numeric(FLERR,arg[4]);
axis[0] = force->numeric(FLERR,arg[5]);
axis[1] = force->numeric(FLERR,arg[6]);
axis[2] = force->numeric(FLERR,arg[7]);
double theta = force->numeric(FLERR,arg[8]);
if (dim == 2 and (axis[0] != 0.0 || axis[1] != 0.0))
error->all(FLERR,"Invalid displace_atoms rotate axis for 2d");

View File

@ -25,6 +25,7 @@
#include "output.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -667,7 +668,7 @@ void Dump::modify_params(int narg, char **arg)
strcpy(output->var_dump[idump],&arg[iarg+1][2]);
n = 0;
} else {
n = atoi(arg[iarg+1]);
n = force->inumeric(FLERR,arg[iarg+1]);
if (n <= 0) error->all(FLERR,"Illegal dump_modify command");
}
output->every_dump[idump] = n;
@ -684,7 +685,7 @@ void Dump::modify_params(int narg, char **arg)
if (!multiproc)
error->all(FLERR,"Cannot use dump_modify fileper "
"without % in dump file name");
int nper = atoi(arg[iarg+1]);
int nper = force->inumeric(FLERR,arg[iarg+1]);
if (nper <= 0) error->all(FLERR,"Illegal dump_modify command");
multiproc = nprocs/nper;
@ -730,7 +731,7 @@ void Dump::modify_params(int narg, char **arg)
if (!multiproc)
error->all(FLERR,"Cannot use dump_modify nfile "
"without % in dump file name");
int nfile = atoi(arg[iarg+1]);
int nfile = force->inumeric(FLERR,arg[iarg+1]);
if (nfile <= 0) error->all(FLERR,"Illegal dump_modify command");
nfile = MIN(nfile,nprocs);
@ -760,7 +761,7 @@ void Dump::modify_params(int narg, char **arg)
} else if (strcmp(arg[iarg],"pad") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
padflag = atoi(arg[iarg+1]);
padflag = force->inumeric(FLERR,arg[iarg+1]);
if (padflag < 0) error->all(FLERR,"Illegal dump_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"sort") == 0) {
@ -772,7 +773,7 @@ void Dump::modify_params(int narg, char **arg)
sortorder = ASCEND;
} else {
sort_flag = 1;
sortcol = atoi(arg[iarg+1]);
sortcol = force->inumeric(FLERR,arg[iarg+1]);
sortorder = ASCEND;
if (sortcol == 0) error->all(FLERR,"Illegal dump_modify command");
if (sortcol < 0) {

View File

@ -57,7 +57,7 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) :
clearstep = 1;
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
// size_one may be shrunk below if additional optional args exist
@ -1565,7 +1565,7 @@ int DumpCustom::modify_param(int narg, char **arg)
// set threshhold value
thresh_value[nthresh] = atof(arg[3]);
thresh_value[nthresh] = force->numeric(FLERR,arg[3]);
nthresh++;
return 4;

View File

@ -113,7 +113,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg],"adiam") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
adiam = NUMERIC;
adiamvalue = atof(arg[iarg+1]);
adiamvalue = force->numeric(FLERR,arg[iarg+1]);
if (adiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
iarg += 2;
@ -135,7 +135,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
else error->all(FLERR,"Illegal dump image command");
if (!islower(arg[iarg+2][0])) {
bdiam = NUMERIC;
bdiamvalue = atof(arg[iarg+2]);
bdiamvalue = force->numeric(FLERR,arg[iarg+2]);
if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
} else if (strcmp(arg[iarg+2],"atom") == 0) bdiam = ATOM;
else if (strcmp(arg[iarg+2],"type") == 0) bdiam = TYPE;
@ -145,8 +145,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"size") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
int width = atoi(arg[iarg+1]);
int height = atoi(arg[iarg+2]);
int width = force->inumeric(FLERR,arg[iarg+1]);
int height = force->inumeric(FLERR,arg[iarg+2]);
if (width <= 0 || height <= 0)
error->all(FLERR,"Illegal dump image command");
image->width = width;
@ -160,7 +160,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
thetastr = new char[n];
strcpy(thetastr,&arg[iarg+1][2]);
} else {
double theta = atof(arg[iarg+1]);
double theta = force->numeric(FLERR,arg[iarg+1]);
if (theta < 0.0 || theta > 180.0)
error->all(FLERR,"Invalid dump image theta value");
theta *= MY_PI/180.0;
@ -171,7 +171,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
phistr = new char[n];
strcpy(phistr,&arg[iarg+2][2]);
} else {
double phi = atof(arg[iarg+2]);
double phi = force->numeric(FLERR,arg[iarg+2]);
phi *= MY_PI/180.0;
image->phi = phi;
}
@ -187,19 +187,19 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
cxstr = new char[n];
strcpy(cxstr,&arg[iarg+2][2]);
cflag = DYNAMIC;
} else cx = atof(arg[iarg+2]);
} else cx = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
cystr = new char[n];
strcpy(cystr,&arg[iarg+3][2]);
cflag = DYNAMIC;
} else cy = atof(arg[iarg+3]);
} else cy = force->numeric(FLERR,arg[iarg+3]);
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
int n = strlen(&arg[iarg+4][2]) + 1;
czstr = new char[n];
strcpy(czstr,&arg[iarg+4][2]);
cflag = DYNAMIC;
} else cz = atof(arg[iarg+4]);
} else cz = force->numeric(FLERR,arg[iarg+4]);
iarg += 5;
} else if (strcmp(arg[iarg],"up") == 0) {
@ -208,17 +208,17 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
int n = strlen(&arg[iarg+1][2]) + 1;
upxstr = new char[n];
strcpy(upxstr,&arg[iarg+1][2]);
} else image->up[0] = atof(arg[iarg+1]);
} else image->up[0] = force->numeric(FLERR,arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
upystr = new char[n];
strcpy(upystr,&arg[iarg+2][2]);
} else image->up[1] = atof(arg[iarg+2]);
} else image->up[1] = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
upzstr = new char[n];
strcpy(upzstr,&arg[iarg+3][2]);
} else image->up[2] = atof(arg[iarg+3]);
} else image->up[2] = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"zoom") == 0) {
@ -228,7 +228,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
zoomstr = new char[n];
strcpy(zoomstr,&arg[iarg+1][2]);
} else {
double zoom = atof(arg[iarg+1]);
double zoom = force->numeric(FLERR,arg[iarg+1]);
if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command");
image->zoom = zoom;
}
@ -242,7 +242,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
perspstr = new char[n];
strcpy(perspstr,&arg[iarg+1][2]);
} else {
double persp = atof(arg[iarg+1]);
double persp = force->numeric(FLERR,arg[iarg+1]);
if (persp < 0.0) error->all(FLERR,"Illegal dump image command");
image->persp = persp;
}
@ -253,7 +253,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg+1],"yes") == 0) boxflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) boxflag = NO;
else error->all(FLERR,"Illegal dump image command");
boxdiam = atof(arg[iarg+2]);
boxdiam = force->numeric(FLERR,arg[iarg+2]);
if (boxdiam < 0.0) error->all(FLERR,"Illegal dump image command");
iarg += 3;
@ -262,15 +262,15 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg+1],"yes") == 0) axesflag = YES;
else if (strcmp(arg[iarg+1],"no") == 0) axesflag = NO;
else error->all(FLERR,"Illegal dump image command");
axeslen = atof(arg[iarg+2]);
axesdiam = atof(arg[iarg+3]);
axeslen = force->numeric(FLERR,arg[iarg+2]);
axesdiam = force->numeric(FLERR,arg[iarg+3]);
if (axeslen < 0.0 || axesdiam < 0.0)
error->all(FLERR,"Illegal dump image command");
iarg += 4;
} else if (strcmp(arg[iarg],"shiny") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
double shiny = atof(arg[iarg+1]);
double shiny = force->numeric(FLERR,arg[iarg+1]);
if (shiny < 0.0 || shiny > 1.0)
error->all(FLERR,"Illegal dump image command");
image->shiny = shiny;
@ -281,10 +281,10 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg+1],"yes") == 0) image->ssao = YES;
else if (strcmp(arg[iarg+1],"no") == 0) image->ssao = NO;
else error->all(FLERR,"Illegal dump image command");
int seed = atoi(arg[iarg+2]);
int seed = force->inumeric(FLERR,arg[iarg+2]);
if (seed <= 0) error->all(FLERR,"Illegal dump image command");
image->seed = seed;
double ssaoint = atof(arg[iarg+3]);
double ssaoint = force->numeric(FLERR,arg[iarg+3]);
if (ssaoint < 0.0 || ssaoint > 1.0)
error->all(FLERR,"Illegal dump image command");
image->ssaoint = ssaoint;
@ -929,7 +929,7 @@ int DumpImage::modify_param(int narg, char **arg)
if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
int nlo,nhi;
force->bounds(arg[1],atom->ntypes,nlo,nhi);
double diam = atof(arg[2]);
double diam = force->numeric(FLERR,arg[2]);
if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
for (int i = nlo; i <= nhi; i++) diamtype[i] = diam;
return 3;
@ -940,7 +940,7 @@ int DumpImage::modify_param(int narg, char **arg)
if (strlen(arg[3]) != 2) error->all(FLERR,"Illegal dump_modify command");
int factor = 2;
if (arg[3][0] == 's') factor = 1;
int nentry = atoi(arg[5]);
int nentry = force->inumeric(FLERR,arg[5]);
if (nentry < 1) error->all(FLERR,"Illegal dump_modify command");
int n = 6 + factor*nentry;
if (narg < n) error->all(FLERR,"Illegal dump_modify command");
@ -991,7 +991,7 @@ int DumpImage::modify_param(int narg, char **arg)
error->all(FLERR,"Dump modify bdiam not allowed with no bond types");
int nlo,nhi;
force->bounds(arg[1],atom->ntypes,nlo,nhi);
double diam = atof(arg[2]);
double diam = force->numeric(FLERR,arg[2]);
if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command");
for (int i = nlo; i <= nhi; i++) bdiamtype[i] = diam;
return 3;
@ -1017,7 +1017,7 @@ int DumpImage::modify_param(int narg, char **arg)
if (strcmp(arg[0],"color") == 0) {
if (narg < 5) error->all(FLERR,"Illegal dump_modify command");
int flag = image->addcolor(arg[1],atof(arg[2]),atof(arg[3]),atof(arg[4]));
int flag = image->addcolor(arg[1],force->numeric(FLERR,arg[2]),force->numeric(FLERR,arg[3]),force->numeric(FLERR,arg[4]));
if (flag) error->all(FLERR,"Illegal dump_modify command");
return 5;
}

View File

@ -23,6 +23,7 @@
#include "update.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -39,7 +40,7 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) :
clearstep = 1;
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
size_one = nfield = narg-5;
pack_choice = new FnPtrPack[nfield];

View File

@ -24,6 +24,7 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -51,7 +52,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
xstr = new char[n];
strcpy(xstr,&arg[3][2]);
} else {
xvalue = atof(arg[3]);
xvalue = force->numeric(FLERR,arg[3]);
xstyle = CONSTANT;
}
if (strstr(arg[4],"v_") == arg[4]) {
@ -59,7 +60,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
ystr = new char[n];
strcpy(ystr,&arg[4][2]);
} else {
yvalue = atof(arg[4]);
yvalue = force->numeric(FLERR,arg[4]);
ystyle = CONSTANT;
}
if (strstr(arg[5],"v_") == arg[5]) {
@ -67,7 +68,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
zstr = new char[n];
strcpy(zstr,&arg[5][2]);
} else {
zvalue = atof(arg[5]);
zvalue = force->numeric(FLERR,arg[5]);
zstyle = CONSTANT;
}

View File

@ -23,6 +23,7 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -38,9 +39,9 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 7) error->all(FLERR,"Illegal fix ave/atom command");
nevery = atoi(arg[3]);
nrepeat = atoi(arg[4]);
peratom_freq = atoi(arg[5]);
nevery = force->inumeric(FLERR,arg[3]);
nrepeat = force->inumeric(FLERR,arg[4]);
peratom_freq = force->inumeric(FLERR,arg[5]);
// parse remaining values

View File

@ -28,6 +28,7 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -49,9 +50,9 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
MPI_Comm_rank(world,&me);
nevery = atoi(arg[3]);
nrepeat = atoi(arg[4]);
nfreq = atoi(arg[5]);
nevery = force->inumeric(FLERR,arg[3]);
nrepeat = force->inumeric(FLERR,arg[4]);
nfreq = force->inumeric(FLERR,arg[5]);
global_freq = nfreq;
// parse values until one isn't recognized
@ -124,11 +125,11 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
iarg += 2;
} else if (strcmp(arg[iarg],"start") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
startstep = atoi(arg[iarg+1]);
startstep = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"prefactor") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
prefactor = atof(arg[iarg+1]);
prefactor = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"file") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");

View File

@ -23,6 +23,7 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -49,9 +50,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
MPI_Comm_rank(world,&me);
nevery = atoi(arg[3]);
nrepeat = atoi(arg[4]);
nfreq = atoi(arg[5]);
nevery = force->inumeric(FLERR,arg[3]);
nrepeat = force->inumeric(FLERR,arg[4]);
nfreq = force->inumeric(FLERR,arg[5]);
global_freq = nfreq;
vector_flag = 1;
@ -61,9 +62,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
size_array_cols = 3;
extarray = 0;
lo = atof(arg[6]);
hi = atof(arg[7]);
nbins = atoi(arg[8]);
lo = force->numeric(FLERR,arg[6]);
hi = force->numeric(FLERR,arg[7]);
nbins = force->inumeric(FLERR,arg[8]);
// scan values to count them
// then read options so know mode = SCALAR/VECTOR before re-reading values
@ -939,14 +940,14 @@ void FixAveHisto::options(int narg, char **arg)
else error->all(FLERR,"Illegal fix ave/histo command");
if (ave == WINDOW) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/histo command");
nwindow = atoi(arg[iarg+2]);
nwindow = force->inumeric(FLERR,arg[iarg+2]);
if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/histo command");
}
iarg += 2;
if (ave == WINDOW) iarg++;
} else if (strcmp(arg[iarg],"start") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
startstep = atoi(arg[iarg+1]);
startstep = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"mode") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");

View File

@ -52,9 +52,9 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
MPI_Comm_rank(world,&me);
nevery = atoi(arg[3]);
nrepeat = atoi(arg[4]);
nfreq = atoi(arg[5]);
nevery = force->inumeric(FLERR,arg[3]);
nrepeat = force->inumeric(FLERR,arg[4]);
nfreq = force->inumeric(FLERR,arg[5]);
global_freq = nfreq;
no_change_box = 1;
@ -75,9 +75,9 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
else if (strcmp(arg[iarg+1],"center") == 0) originflag[ndim] = CENTER;
else if (strcmp(arg[iarg+1],"upper") == 0) originflag[ndim] = UPPER;
else originflag[ndim] = COORD;
if (originflag[ndim] == COORD) origin[ndim] = atof(arg[iarg+1]);
if (originflag[ndim] == COORD) origin[ndim] = force->numeric(FLERR,arg[iarg+1]);
delta[ndim] = atof(arg[iarg+2]);
delta[ndim] = force->numeric(FLERR,arg[iarg+2]);
ndim++;
iarg += 3;
}
@ -213,7 +213,7 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
else error->all(FLERR,"Illegal fix ave/spatial command");
if (ave == WINDOW) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
nwindow = atoi(arg[iarg+2]);
nwindow = force->inumeric(FLERR,arg[iarg+2]);
if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/spatial command");
}
iarg += 2;

View File

@ -26,6 +26,7 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -47,9 +48,9 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
MPI_Comm_rank(world,&me);
nevery = atoi(arg[3]);
nrepeat = atoi(arg[4]);
nfreq = atoi(arg[5]);
nevery = force->inumeric(FLERR,arg[3]);
nrepeat = force->inumeric(FLERR,arg[4]);
nfreq = force->inumeric(FLERR,arg[5]);
global_freq = nfreq;
@ -855,14 +856,14 @@ void FixAveTime::options(int narg, char **arg)
else error->all(FLERR,"Illegal fix ave/time command");
if (ave == WINDOW) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/time command");
nwindow = atoi(arg[iarg+2]);
nwindow = force->inumeric(FLERR,arg[iarg+2]);
if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/time command");
}
iarg += 2;
if (ave == WINDOW) iarg++;
} else if (strcmp(arg[iarg],"start") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
startstep = atoi(arg[iarg+1]);
startstep = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"mode") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
@ -873,7 +874,7 @@ void FixAveTime::options(int narg, char **arg)
} else if (strcmp(arg[iarg],"off") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
memory->grow(offlist,noff+1,"ave/time:offlist");
offlist[noff++] = atoi(arg[iarg+1]);
offlist[noff++] = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"overwrite") == 0) {
overwrite = 1;

View File

@ -24,6 +24,7 @@
#include "input.h"
#include "variable.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -51,7 +52,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[3],"NULL") == 0) {
xstyle = NONE;
} else {
xvalue = atof(arg[3]);
xvalue = force->numeric(FLERR,arg[3]);
xstyle = CONSTANT;
}
if (strstr(arg[4],"v_") == arg[4]) {
@ -61,7 +62,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[4],"NULL") == 0) {
ystyle = NONE;
} else {
yvalue = atof(arg[4]);
yvalue = force->numeric(FLERR,arg[4]);
ystyle = CONSTANT;
}
if (strstr(arg[5],"v_") == arg[5]) {
@ -71,7 +72,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[5],"NULL") == 0) {
zstyle = NONE;
} else {
zvalue = atof(arg[5]);
zvalue = force->numeric(FLERR,arg[5]);
zstyle = CONSTANT;
}

View File

@ -46,11 +46,11 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
int dimension = domain->dimension;
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (strlen(arg[4]) > 3) error->all(FLERR,"Illegal fix balance command");
strcpy(bstr,arg[4]);
nitermax = atoi(arg[5]);
thresh = atof(arg[6]);
nitermax = force->inumeric(FLERR,arg[5]);
thresh = force->numeric(FLERR,arg[6]);
if (nevery < 0 || nitermax <= 0 || thresh < 1.0)
error->all(FLERR,"Illegal fix balance command");

View File

@ -89,7 +89,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg],"iso") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
pcouple = XYZ;
p_target[0] = p_target[1] = p_target[2] = atof(arg[iarg+1]);
p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_target[2] = 0.0;
@ -99,7 +99,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"aniso") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
pcouple = NONE;
p_target[0] = p_target[1] = p_target[2] = atof(arg[iarg+1]);
p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_target[2] = 0.0;
@ -110,7 +110,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
pcouple = NONE;
scalexy = scalexz = scaleyz = 0;
p_target[0] = p_target[1] = p_target[2] = atof(arg[iarg+1]);
p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
p_target[3] = p_target[4] = p_target[5] = 0.0;
p_flag[3] = p_flag[4] = p_flag[5] = 1;
@ -122,19 +122,19 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"x") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
p_target[0] = atof(arg[iarg+1]);
p_target[0] = force->numeric(FLERR,arg[iarg+1]);
p_flag[0] = 1;
deviatoric_flag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
p_target[1] = atof(arg[iarg+1]);
p_target[1] = force->numeric(FLERR,arg[iarg+1]);
p_flag[1] = 1;
deviatoric_flag = 1;
iarg += 2;
} else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
p_target[2] = atof(arg[iarg+1]);
p_target[2] = force->numeric(FLERR,arg[iarg+1]);
p_flag[2] = 1;
deviatoric_flag = 1;
iarg += 2;
@ -143,7 +143,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"yz") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
p_target[3] = atof(arg[iarg+1]);
p_target[3] = force->numeric(FLERR,arg[iarg+1]);
p_flag[3] = 1;
deviatoric_flag = 1;
scaleyz = 0;
@ -152,7 +152,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
} else if (strcmp(arg[iarg],"xz") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
p_target[4] = atof(arg[iarg+1]);
p_target[4] = force->numeric(FLERR,arg[iarg+1]);
p_flag[4] = 1;
deviatoric_flag = 1;
scalexz = 0;
@ -161,7 +161,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
} else if (strcmp(arg[iarg],"xy") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
p_target[5] = atof(arg[iarg+1]);
p_target[5] = force->numeric(FLERR,arg[iarg+1]);
p_flag[5] = 1;
deviatoric_flag = 1;
scalexy = 0;
@ -185,11 +185,11 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"vmax") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
vmax = atof(arg[iarg+1]);
vmax = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"nreset") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
nreset_h0 = atoi(arg[iarg+1]);
nreset_h0 = force->inumeric(FLERR,arg[iarg+1]);
if (nreset_h0 < 0) error->all(FLERR,"Illegal fix box/relax command");
iarg += 2;
} else if (strcmp(arg[iarg],"scalexy") == 0) {
@ -212,9 +212,9 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"fixedpoint") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix box/relax command");
fixedpoint[0] = atof(arg[iarg+1]);
fixedpoint[1] = atof(arg[iarg+2]);
fixedpoint[2] = atof(arg[iarg+3]);
fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]);
fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]);
fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else error->all(FLERR,"Illegal fix box/relax command");
}

View File

@ -53,7 +53,7 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
box_change = 1;
no_change_box = 1;
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery <= 0) error->all(FLERR,"Illegal fix deform command");
// set defaults
@ -85,34 +85,34 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
if (strcmp(arg[iarg+1],"final") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = FINAL;
set[index].flo = atof(arg[iarg+2]);
set[index].fhi = atof(arg[iarg+3]);
set[index].flo = force->numeric(FLERR,arg[iarg+2]);
set[index].fhi = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg+1],"delta") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = DELTA;
set[index].dlo = atof(arg[iarg+2]);
set[index].dhi = atof(arg[iarg+3]);
set[index].dlo = force->numeric(FLERR,arg[iarg+2]);
set[index].dhi = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg+1],"scale") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = SCALE;
set[index].scale = atof(arg[iarg+2]);
set[index].scale = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"vel") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = VEL;
set[index].vel = atof(arg[iarg+2]);
set[index].vel = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"erate") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = ERATE;
set[index].rate = atof(arg[iarg+2]);
set[index].rate = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"trate") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = TRATE;
set[index].rate = atof(arg[iarg+2]);
set[index].rate = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"volume") == 0) {
set[index].style = VOLUME;
@ -120,8 +120,8 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
} else if (strcmp(arg[iarg+1],"wiggle") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = WIGGLE;
set[index].amplitude = atof(arg[iarg+2]);
set[index].tperiod = atof(arg[iarg+3]);
set[index].amplitude = force->numeric(FLERR,arg[iarg+2]);
set[index].tperiod = force->numeric(FLERR,arg[iarg+3]);
if (set[index].tperiod <= 0.0)
error->all(FLERR,"Illegal fix deform command");
iarg += 4;
@ -157,33 +157,33 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
if (strcmp(arg[iarg+1],"final") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = FINAL;
set[index].ftilt = atof(arg[iarg+2]);
set[index].ftilt = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"delta") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = DELTA;
set[index].dtilt = atof(arg[iarg+2]);
set[index].dtilt = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"vel") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = VEL;
set[index].vel = atof(arg[iarg+2]);
set[index].vel = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"erate") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = ERATE;
set[index].rate = atof(arg[iarg+2]);
set[index].rate = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"trate") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = TRATE;
set[index].rate = atof(arg[iarg+2]);
set[index].rate = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg+1],"wiggle") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
set[index].style = WIGGLE;
set[index].amplitude = atof(arg[iarg+2]);
set[index].tperiod = atof(arg[iarg+3]);
set[index].amplitude = force->numeric(FLERR,arg[iarg+2]);
set[index].tperiod = force->numeric(FLERR,arg[iarg+3]);
if (set[index].tperiod <= 0.0)
error->all(FLERR,"Illegal fix deform command");
iarg += 4;

View File

@ -44,10 +44,10 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
// required args
ninsert = atoi(arg[3]);
ntype = atoi(arg[4]);
nfreq = atoi(arg[5]);
seed = atoi(arg[6]);
ninsert = force->inumeric(FLERR,arg[3]);
ntype = force->inumeric(FLERR,arg[4]);
nfreq = force->inumeric(FLERR,arg[5]);
seed = force->inumeric(FLERR,arg[6]);
if (seed <= 0) error->all(FLERR,"Illegal fix deposit command");
@ -414,44 +414,44 @@ void FixDeposit::options(int narg, char **arg)
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
globalflag = 1;
localflag = 0;
lo = atof(arg[iarg+1]);
hi = atof(arg[iarg+2]);
lo = force->numeric(FLERR,arg[iarg+1]);
hi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"local") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command");
localflag = 1;
globalflag = 0;
lo = atof(arg[iarg+1]);
hi = atof(arg[iarg+2]);
deltasq = atof(arg[iarg+3])*atof(arg[iarg+3]);
lo = force->numeric(FLERR,arg[iarg+1]);
hi = force->numeric(FLERR,arg[iarg+2]);
deltasq = force->numeric(FLERR,arg[iarg+3])*force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"near") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
nearsq = atof(arg[iarg+1])*atof(arg[iarg+1]);
nearsq = force->numeric(FLERR,arg[iarg+1])*force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"attempt") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
maxattempt = atoi(arg[iarg+1]);
maxattempt = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"rate") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
rateflag = 1;
rate = atof(arg[iarg+1]);
rate = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"vx") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
vxlo = atof(arg[iarg+1]);
vxhi = atof(arg[iarg+2]);
vxlo = force->numeric(FLERR,arg[iarg+1]);
vxhi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"vy") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
vylo = atof(arg[iarg+1]);
vyhi = atof(arg[iarg+2]);
vylo = force->numeric(FLERR,arg[iarg+1]);
vyhi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"vz") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command");
vzlo = atof(arg[iarg+1]);
vzhi = atof(arg[iarg+2]);
vzlo = force->numeric(FLERR,arg[iarg+1]);
vzhi = force->numeric(FLERR,arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"units") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
@ -461,9 +461,9 @@ void FixDeposit::options(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"target") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command");
tx = atof(arg[iarg+1]);
ty = atof(arg[iarg+2]);
tz = atof(arg[iarg+3]);
tx = force->numeric(FLERR,arg[iarg+1]);
ty = force->numeric(FLERR,arg[iarg+2]);
tz = force->numeric(FLERR,arg[iarg+3]);
targetflag = 1;
iarg += 4;
} else error->all(FLERR,"Illegal fix deposit command");

View File

@ -20,6 +20,7 @@
#include "respa.h"
#include "domain.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -39,14 +40,14 @@ FixDrag::FixDrag(LAMMPS *lmp, int narg, char **arg) :
xflag = yflag = zflag = 1;
if (strcmp(arg[3],"NULL") == 0) xflag = 0;
else xc = atof(arg[3]);
else xc = force->numeric(FLERR,arg[3]);
if (strcmp(arg[4],"NULL") == 0) yflag = 0;
else yc = atof(arg[4]);
else yc = force->numeric(FLERR,arg[4]);
if (strcmp(arg[5],"NULL") == 0) zflag = 0;
else zc = atof(arg[5]);
else zc = force->numeric(FLERR,arg[5]);
f_mag = atof(arg[6]);
delta = atof(arg[7]);
f_mag = force->numeric(FLERR,arg[6]);
delta = force->numeric(FLERR,arg[7]);
force_flag = 0;
ftotal[0] = ftotal[1] = ftotal[2] = 0.0;

View File

@ -51,16 +51,16 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) :
extscalar = 0;
extvector = 0;
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery <= 0) error->all(FLERR,"Illegal fix dt/reset command");
minbound = maxbound = 1;
tmin = tmax = 0.0;
if (strcmp(arg[4],"NULL") == 0) minbound = 0;
else tmin = atof(arg[4]);
else tmin = force->numeric(FLERR,arg[4]);
if (strcmp(arg[5],"NULL") == 0) maxbound = 0;
else tmax = atof(arg[5]);
xmax = atof(arg[6]);
else tmax = force->numeric(FLERR,arg[5]);
xmax = force->numeric(FLERR,arg[6]);
if (minbound && tmin < 0.0) error->all(FLERR,"Illegal fix dt/reset command");
if (maxbound && tmax < 0.0) error->all(FLERR,"Illegal fix dt/reset command");

View File

@ -59,7 +59,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) :
xstr = new char[n];
strcpy(xstr,&arg[3][2]);
} else {
ex = qe2f * atof(arg[3]);
ex = qe2f * force->numeric(FLERR,arg[3]);
xstyle = CONSTANT;
}
@ -68,7 +68,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) :
ystr = new char[n];
strcpy(ystr,&arg[4][2]);
} else {
ey = qe2f * atof(arg[4]);
ey = qe2f * force->numeric(FLERR,arg[4]);
ystyle = CONSTANT;
}
@ -77,7 +77,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) :
zstr = new char[n];
strcpy(zstr,&arg[5][2]);
} else {
ez = qe2f * atof(arg[5]);
ez = qe2f * force->numeric(FLERR,arg[5]);
zstyle = CONSTANT;
}

View File

@ -42,13 +42,13 @@ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) :
global_freq = 1;
extscalar = 0;
nevery = atoi(arg[3]);
nflux = atoi(arg[4]);
nevery = force->inumeric(FLERR,arg[3]);
nflux = force->inumeric(FLERR,arg[4]);
iregion = domain->find_region(arg[5]);
int n = strlen(arg[5]) + 1;
idregion = new char[n];
strcpy(idregion,arg[5]);
int seed = atoi(arg[6]);
int seed = force->inumeric(FLERR,arg[6]);
if (nevery <= 0 || nflux <= 0)
error->all(FLERR,"Illegal fix evaporate command");

View File

@ -19,6 +19,7 @@
#include "update.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -35,14 +36,14 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[3],"pf/callback") == 0) {
if (narg != 6) error->all(FLERR,"Illegal fix external command");
mode = PF_CALLBACK;
ncall = atoi(arg[4]);
napply = atoi(arg[5]);
ncall = force->inumeric(FLERR,arg[4]);
napply = force->inumeric(FLERR,arg[5]);
if (ncall <= 0 || napply <= 0)
error->all(FLERR,"Illegal fix external command");
} else if (strcmp(arg[3],"pf/array") == 0) {
if (narg != 5) error->all(FLERR,"Illegal fix external command");
mode = PF_ARRAY;
napply = atoi(arg[4]);
napply = force->inumeric(FLERR,arg[4]);
if (napply <= 0) error->all(FLERR,"Illegal fix external command");
} else error->all(FLERR,"Illegal fix external command");

View File

@ -25,6 +25,7 @@
#include "variable.h"
#include "math_const.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -53,7 +54,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
strcpy(mstr,&arg[3][2]);
mstyle = EQUAL;
} else {
magnitude = atof(arg[3]);
magnitude = force->numeric(FLERR,arg[3]);
mstyle = CONSTANT;
}
@ -66,7 +67,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
strcpy(vstr,&arg[5][2]);
vstyle = EQUAL;
} else {
vert = atof(arg[5]);
vert = force->numeric(FLERR,arg[5]);
vstyle = CONSTANT;
}
@ -79,7 +80,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
strcpy(pstr,&arg[5][2]);
pstyle = EQUAL;
} else {
phi = atof(arg[5]);
phi = force->numeric(FLERR,arg[5]);
pstyle = CONSTANT;
}
if (strstr(arg[6],"v_") == arg[6]) {
@ -88,7 +89,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
strcpy(tstr,&arg[6][2]);
tstyle = EQUAL;
} else {
theta = atof(arg[6]);
theta = force->numeric(FLERR,arg[6]);
tstyle = CONSTANT;
}
@ -101,7 +102,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
strcpy(xstr,&arg[5][2]);
xstyle = EQUAL;
} else {
xdir = atof(arg[5]);
xdir = force->numeric(FLERR,arg[5]);
xstyle = CONSTANT;
}
if (strstr(arg[6],"v_") == arg[6]) {
@ -110,7 +111,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
strcpy(ystr,&arg[6][2]);
ystyle = EQUAL;
} else {
ydir = atof(arg[6]);
ydir = force->numeric(FLERR,arg[6]);
ystyle = CONSTANT;
}
if (strstr(arg[7],"v_") == arg[7]) {
@ -119,7 +120,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
strcpy(zstr,&arg[7][2]);
zstyle = EQUAL;
} else {
zdir = atof(arg[7]);
zdir = force->numeric(FLERR,arg[7]);
zstyle = CONSTANT;
}

View File

@ -46,7 +46,7 @@ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
global_freq = 1;
extscalar = 0;
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery <= 0) error->all(FLERR,"Illegal fix heat command");
hstr = NULL;
@ -56,7 +56,7 @@ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
hstr = new char[n];
strcpy(hstr,&arg[4][2]);
} else {
heat_input = atof(arg[4]);
heat_input = force->numeric(FLERR,arg[4]);
hstyle = CONSTANT;
}

View File

@ -29,6 +29,7 @@
#include "output.h"
#include "respa.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -50,7 +51,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
extscalar = 1;
extvector = 1;
k = atof(arg[3]);
k = force->numeric(FLERR,arg[3]);
k3 = k/3.0;
// read options from end of input line
@ -416,22 +417,22 @@ void FixIndent::options(int narg, char **arg)
int n = strlen(&arg[iarg+1][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[iarg+1][2]);
} else xvalue = atof(arg[iarg+1]);
} else xvalue = force->numeric(FLERR,arg[iarg+1]);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[iarg+2][2]);
} else yvalue = atof(arg[iarg+2]);
} else yvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = atof(arg[iarg+3]);
} else zvalue = force->numeric(FLERR,arg[iarg+3]);
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
int n = strlen(&arg[iarg+4][2]) + 1;
rstr = new char[n];
strcpy(rstr,&arg[iarg+4][2]);
} else rvalue = atof(arg[iarg+4]);
} else rvalue = force->numeric(FLERR,arg[iarg+4]);
istyle = SPHERE;
iarg += 5;
@ -445,43 +446,43 @@ void FixIndent::options(int narg, char **arg)
int n = strlen(&arg[iarg+2][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[iarg+2][2]);
} else yvalue = atof(arg[iarg+2]);
} else yvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = atof(arg[iarg+3]);
} else zvalue = force->numeric(FLERR,arg[iarg+3]);
} else if (strcmp(arg[iarg+1],"y") == 0) {
cdim = 1;
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[iarg+2][2]);
} else xvalue = atof(arg[iarg+2]);
} else xvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = atof(arg[iarg+3]);
} else zvalue = force->numeric(FLERR,arg[iarg+3]);
} else if (strcmp(arg[iarg+1],"z") == 0) {
cdim = 2;
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
int n = strlen(&arg[iarg+2][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[iarg+2][2]);
} else xvalue = atof(arg[iarg+2]);
} else xvalue = force->numeric(FLERR,arg[iarg+2]);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
int n = strlen(&arg[iarg+3][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[iarg+3][2]);
} else yvalue = atof(arg[iarg+3]);
} else yvalue = force->numeric(FLERR,arg[iarg+3]);
} else error->all(FLERR,"Illegal fix indent command");
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
int n = strlen(&arg[iarg+4][2]) + 1;
rstr = new char[n];
strcpy(rstr,&arg[iarg+4][2]);
} else rvalue = atof(arg[iarg+4]);
} else rvalue = force->numeric(FLERR,arg[iarg+4]);
istyle = CYLINDER;
iarg += 5;
@ -497,7 +498,7 @@ void FixIndent::options(int narg, char **arg)
int n = strlen(&arg[iarg+2][2]) + 1;
pstr = new char[n];
strcpy(pstr,&arg[iarg+2][2]);
} else pvalue = atof(arg[iarg+2]);
} else pvalue = force->numeric(FLERR,arg[iarg+2]);
if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1;
else if (strcmp(arg[iarg+3],"hi") == 0) planeside = 1;

View File

@ -66,14 +66,14 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
tstr = new char[n];
strcpy(tstr,&arg[3][2]);
} else {
t_start = atof(arg[3]);
t_start = force->numeric(FLERR,arg[3]);
t_target = t_start;
tstyle = CONSTANT;
}
t_stop = atof(arg[4]);
t_period = atof(arg[5]);
int seed = atoi(arg[6]);
t_stop = force->numeric(FLERR,arg[4]);
t_period = force->numeric(FLERR,arg[5]);
int seed = force->inumeric(FLERR,arg[6]);
if (t_period <= 0.0) error->all(FLERR,"Fix langevin period must be > 0.0");
if (seed <= 0) error->all(FLERR,"Illegal fix langevin command");
@ -118,8 +118,8 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"scale") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix langevin command");
int itype = atoi(arg[iarg+1]);
double scale = atof(arg[iarg+2]);
int itype = force->inumeric(FLERR,arg[iarg+1]);
double scale = force->numeric(FLERR,arg[iarg+2]);
if (itype <= 0 || itype > atom->ntypes)
error->all(FLERR,"Illegal fix langevin command");
ratio[itype] = scale;

View File

@ -19,6 +19,7 @@
#include "update.h"
#include "respa.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -29,9 +30,9 @@ FixLineForce::FixLineForce(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg != 6) error->all(FLERR,"Illegal fix lineforce command");
xdir = atof(arg[3]);
ydir = atof(arg[4]);
zdir = atof(arg[5]);
xdir = force->numeric(FLERR,arg[3]);
ydir = force->numeric(FLERR,arg[4]);
zdir = force->numeric(FLERR,arg[5]);
double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir);
if (len == 0.0) error->all(FLERR,"Illegal fix lineforce command");

View File

@ -18,6 +18,7 @@
#include "domain.h"
#include "group.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -32,7 +33,7 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal fix momentum command");
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery <= 0) error->all(FLERR,"Illegal fix momentum command");
linear = angular = 0;
@ -42,9 +43,9 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg],"linear") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix momentum command");
linear = 1;
xflag = atoi(arg[iarg+1]);
yflag = atoi(arg[iarg+2]);
zflag = atoi(arg[iarg+3]);
xflag = force->inumeric(FLERR,arg[iarg+1]);
yflag = force->inumeric(FLERR,arg[iarg+2]);
zflag = force->inumeric(FLERR,arg[iarg+3]);
iarg += 4;
} else if (strcmp(arg[iarg],"angular") == 0) {
angular = 1;

View File

@ -65,17 +65,17 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[4],"NULL") == 0) vxflag = 0;
else {
vxflag = 1;
vx = atof(arg[4]);
vx = force->numeric(FLERR,arg[4]);
}
if (strcmp(arg[5],"NULL") == 0) vyflag = 0;
else {
vyflag = 1;
vy = atof(arg[5]);
vy = force->numeric(FLERR,arg[5]);
}
if (strcmp(arg[6],"NULL") == 0) vzflag = 0;
else {
vzflag = 1;
vz = atof(arg[6]);
vz = force->numeric(FLERR,arg[6]);
}
} else if (strcmp(arg[3],"wiggle") == 0) {
@ -85,31 +85,31 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[4],"NULL") == 0) axflag = 0;
else {
axflag = 1;
ax = atof(arg[4]);
ax = force->numeric(FLERR,arg[4]);
}
if (strcmp(arg[5],"NULL") == 0) ayflag = 0;
else {
ayflag = 1;
ay = atof(arg[5]);
ay = force->numeric(FLERR,arg[5]);
}
if (strcmp(arg[6],"NULL") == 0) azflag = 0;
else {
azflag = 1;
az = atof(arg[6]);
az = force->numeric(FLERR,arg[6]);
}
period = atof(arg[7]);
period = force->numeric(FLERR,arg[7]);
} else if (strcmp(arg[3],"rotate") == 0) {
if (narg < 11) error->all(FLERR,"Illegal fix move command");
iarg = 11;
mstyle = ROTATE;
point[0] = atof(arg[4]);
point[1] = atof(arg[5]);
point[2] = atof(arg[6]);
axis[0] = atof(arg[7]);
axis[1] = atof(arg[8]);
axis[2] = atof(arg[9]);
period = atof(arg[10]);
point[0] = force->numeric(FLERR,arg[4]);
point[1] = force->numeric(FLERR,arg[5]);
point[2] = force->numeric(FLERR,arg[6]);
axis[0] = force->numeric(FLERR,arg[7]);
axis[1] = force->numeric(FLERR,arg[8]);
axis[2] = force->numeric(FLERR,arg[9]);
period = force->numeric(FLERR,arg[10]);
} else if (strcmp(arg[3],"variable") == 0) {
if (narg < 10) error->all(FLERR,"Illegal fix move command");

View File

@ -115,10 +115,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
if (strcmp(arg[iarg],"temp") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
tstat_flag = 1;
t_start = atof(arg[iarg+1]);
t_start = force->numeric(FLERR,arg[iarg+1]);
t_target = t_start;
t_stop = atof(arg[iarg+2]);
t_period = atof(arg[iarg+3]);
t_stop = force->numeric(FLERR,arg[iarg+2]);
t_period = force->numeric(FLERR,arg[iarg+3]);
if (t_start < 0.0 || t_stop <= 0.0)
error->all(FLERR,
"Target temperature for fix nvt/npt/nph cannot be 0.0");
@ -127,9 +127,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
} else if (strcmp(arg[iarg],"iso") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
pcouple = XYZ;
p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
@ -139,9 +139,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
} else if (strcmp(arg[iarg],"aniso") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
pcouple = NONE;
p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
@ -152,13 +152,13 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
pcouple = NONE;
scalexy = scalexz = scaleyz = 0;
p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
p_start[3] = p_start[4] = p_start[5] = 0.0;
p_stop[3] = p_stop[4] = p_stop[5] = 0.0;
p_period[3] = p_period[4] = p_period[5] = atof(arg[iarg+3]);
p_period[3] = p_period[4] = p_period[5] = force->numeric(FLERR,arg[iarg+3]);
p_flag[3] = p_flag[4] = p_flag[5] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
@ -171,25 +171,25 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
iarg += 4;
} else if (strcmp(arg[iarg],"x") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[0] = atof(arg[iarg+1]);
p_stop[0] = atof(arg[iarg+2]);
p_period[0] = atof(arg[iarg+3]);
p_start[0] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = 1;
deviatoric_flag = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[1] = atof(arg[iarg+1]);
p_stop[1] = atof(arg[iarg+2]);
p_period[1] = atof(arg[iarg+3]);
p_start[1] = force->numeric(FLERR,arg[iarg+1]);
p_stop[1] = force->numeric(FLERR,arg[iarg+2]);
p_period[1] = force->numeric(FLERR,arg[iarg+3]);
p_flag[1] = 1;
deviatoric_flag = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[2] = atof(arg[iarg+1]);
p_stop[2] = atof(arg[iarg+2]);
p_period[2] = atof(arg[iarg+3]);
p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[2] = 1;
deviatoric_flag = 1;
iarg += 4;
@ -198,9 +198,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
} else if (strcmp(arg[iarg],"yz") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[3] = atof(arg[iarg+1]);
p_stop[3] = atof(arg[iarg+2]);
p_period[3] = atof(arg[iarg+3]);
p_start[3] = force->numeric(FLERR,arg[iarg+1]);
p_stop[3] = force->numeric(FLERR,arg[iarg+2]);
p_period[3] = force->numeric(FLERR,arg[iarg+3]);
p_flag[3] = 1;
deviatoric_flag = 1;
scaleyz = 0;
@ -209,9 +209,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
} else if (strcmp(arg[iarg],"xz") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[4] = atof(arg[iarg+1]);
p_stop[4] = atof(arg[iarg+2]);
p_period[4] = atof(arg[iarg+3]);
p_start[4] = force->numeric(FLERR,arg[iarg+1]);
p_stop[4] = force->numeric(FLERR,arg[iarg+2]);
p_period[4] = force->numeric(FLERR,arg[iarg+3]);
p_flag[4] = 1;
deviatoric_flag = 1;
scalexz = 0;
@ -220,9 +220,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
} else if (strcmp(arg[iarg],"xy") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
p_start[5] = atof(arg[iarg+1]);
p_stop[5] = atof(arg[iarg+2]);
p_period[5] = atof(arg[iarg+3]);
p_start[5] = force->numeric(FLERR,arg[iarg+1]);
p_stop[5] = force->numeric(FLERR,arg[iarg+2]);
p_period[5] = force->numeric(FLERR,arg[iarg+3]);
p_flag[5] = 1;
deviatoric_flag = 1;
scalexy = 0;
@ -240,7 +240,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
} else if (strcmp(arg[iarg],"drag") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
drag = atof(arg[iarg+1]);
drag = force->numeric(FLERR,arg[iarg+1]);
if (drag < 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"dilate") == 0) {
@ -260,14 +260,14 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
} else if (strcmp(arg[iarg],"tchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
mtchain = atoi(arg[iarg+1]);
mtchain = force->inumeric(FLERR,arg[iarg+1]);
// used by FixNVTSllod to preserve non-default value
mtchain_default_flag = 0;
if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"pchain") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
mpchain = atoi(arg[iarg+1]);
mpchain = force->inumeric(FLERR,arg[iarg+1]);
if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"mtk") == 0) {
@ -278,17 +278,17 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
iarg += 2;
} else if (strcmp(arg[iarg],"tloop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nc_tchain = atoi(arg[iarg+1]);
nc_tchain = force->inumeric(FLERR,arg[iarg+1]);
if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"ploop") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nc_pchain = atoi(arg[iarg+1]);
nc_pchain = force->inumeric(FLERR,arg[iarg+1]);
if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"nreset") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
nreset_h0 = atoi(arg[iarg+1]);
nreset_h0 = force->inumeric(FLERR,arg[iarg+1]);
if (nreset_h0 < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command");
iarg += 2;
} else if (strcmp(arg[iarg],"scalexy") == 0) {
@ -317,9 +317,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
iarg += 2;
} else if (strcmp(arg[iarg],"fixedpoint") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
fixedpoint[0] = atof(arg[iarg+1]);
fixedpoint[1] = atof(arg[iarg+2]);
fixedpoint[2] = atof(arg[iarg+3]);
fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]);
fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]);
fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]);
iarg += 4;
} else error->all(FLERR,"Illegal fix nvt/npt/nph command");
}

View File

@ -37,7 +37,7 @@ FixNVELimit::FixNVELimit(LAMMPS *lmp, int narg, char **arg) :
global_freq = 1;
extscalar = 1;
xlimit = atof(arg[3]);
xlimit = force->numeric(FLERR,arg[3]);
ncount = 0;
}

View File

@ -31,6 +31,7 @@
#include "math_const.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -55,12 +56,12 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) :
size_peratom_cols = 2;
peratom_freq = 1;
nstats = atoi(arg[3]);
direction_of_motion = atoi(arg[4]);
a = atof(arg[5]);
Vxi = atof(arg[6]);
uxif_low = atof(arg[7]);
uxif_high = atof(arg[8]);
nstats = force->inumeric(FLERR,arg[3]);
direction_of_motion = force->inumeric(FLERR,arg[4]);
a = force->numeric(FLERR,arg[5]);
Vxi = force->numeric(FLERR,arg[6]);
uxif_low = force->numeric(FLERR,arg[7]);
uxif_high = force->numeric(FLERR,arg[8]);
if (direction_of_motion == 0) {
int n = strlen(arg[9]) + 1;

View File

@ -19,6 +19,7 @@
#include "update.h"
#include "respa.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -29,9 +30,9 @@ FixPlaneForce::FixPlaneForce(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg != 6) error->all(FLERR,"Illegal fix planeforce command");
xdir = atof(arg[3]);
ydir = atof(arg[4]);
zdir = atof(arg[5]);
xdir = force->numeric(FLERR,arg[3]);
ydir = force->numeric(FLERR,arg[4]);
zdir = force->numeric(FLERR,arg[5]);
double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir);
if (len == 0.0) error->all(FLERR,"Illegal fix planeforce command");

View File

@ -71,9 +71,9 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
if (iarg+4 > narg)
error->all(FLERR,"Illegal fix press/berendsen command");
pcouple = XYZ;
p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
@ -84,9 +84,9 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
if (iarg+4 > narg)
error->all(FLERR,"Illegal fix press/berendsen command");
pcouple = NONE;
p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = p_flag[1] = p_flag[2] = 1;
if (dimension == 2) {
p_start[2] = p_stop[2] = p_period[2] = 0.0;
@ -97,25 +97,25 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"x") == 0) {
if (iarg+4 > narg)
error->all(FLERR,"Illegal fix press/berendsen command");
p_start[0] = atof(arg[iarg+1]);
p_stop[0] = atof(arg[iarg+2]);
p_period[0] = atof(arg[iarg+3]);
p_start[0] = force->numeric(FLERR,arg[iarg+1]);
p_stop[0] = force->numeric(FLERR,arg[iarg+2]);
p_period[0] = force->numeric(FLERR,arg[iarg+3]);
p_flag[0] = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+4 > narg)
error->all(FLERR,"Illegal fix press/berendsen command");
p_start[1] = atof(arg[iarg+1]);
p_stop[1] = atof(arg[iarg+2]);
p_period[1] = atof(arg[iarg+3]);
p_start[1] = force->numeric(FLERR,arg[iarg+1]);
p_stop[1] = force->numeric(FLERR,arg[iarg+2]);
p_period[1] = force->numeric(FLERR,arg[iarg+3]);
p_flag[1] = 1;
iarg += 4;
} else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+4 > narg)
error->all(FLERR,"Illegal fix press/berendsen command");
p_start[2] = atof(arg[iarg+1]);
p_stop[2] = atof(arg[iarg+2]);
p_period[2] = atof(arg[iarg+3]);
p_start[2] = force->numeric(FLERR,arg[iarg+1]);
p_stop[2] = force->numeric(FLERR,arg[iarg+2]);
p_period[2] = force->numeric(FLERR,arg[iarg+3]);
p_flag[2] = 1;
iarg += 4;
if (dimension == 2)
@ -135,7 +135,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"modulus") == 0) {
if (iarg+2 > narg)
error->all(FLERR,"Illegal fix press/berendsen command");
bulkmodulus = atof(arg[iarg+1]);
bulkmodulus = force->numeric(FLERR,arg[iarg+1]);
if (bulkmodulus <= 0.0)
error->all(FLERR,"Illegal fix press/berendsen command");
iarg += 2;

View File

@ -20,6 +20,7 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -30,7 +31,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
if (narg < 5) error->all(FLERR,"Illegal fix print command");
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery <= 0) error->all(FLERR,"Illegal fix print command");
MPI_Comm_rank(world,&me);

View File

@ -15,6 +15,7 @@
#include "fix_read_restart.h"
#include "atom.h"
#include "memory.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -24,8 +25,8 @@ using namespace FixConst;
FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
{
nextra = atoi(arg[3]);
int nfix = atoi(arg[4]);
nextra = force->inumeric(FLERR,arg[3]);
int nfix = force->inumeric(FLERR,arg[4]);
// perform initial allocation of atom-based array
// register with Atom class

View File

@ -25,6 +25,7 @@
#include "modify.h"
#include "comm.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -44,13 +45,13 @@ FixRecenter::FixRecenter(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[3],"NULL") == 0) xflag = 0;
else if (strcmp(arg[3],"INIT") == 0) xinitflag = 1;
else xcom = atof(arg[3]);
else xcom = force->numeric(FLERR,arg[3]);
if (strcmp(arg[4],"NULL") == 0) yflag = 0;
else if (strcmp(arg[4],"INIT") == 0) yinitflag = 1;
else ycom = atof(arg[4]);
else ycom = force->numeric(FLERR,arg[4]);
if (strcmp(arg[5],"NULL") == 0) zflag = 0;
else if (strcmp(arg[5],"INIT") == 0) zinitflag = 1;
else zcom = atof(arg[5]);
else zcom = force->numeric(FLERR,arg[5]);
// optional args

View File

@ -16,6 +16,7 @@
#include "atom.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -27,7 +28,7 @@ FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) :
{
// nlevels = # of rRESPA levels
nlevels = atoi(arg[3]);
nlevels = force->inumeric(FLERR,arg[3]);
// perform initial allocation of atom-based arrays
// register with Atom class

View File

@ -76,8 +76,8 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg],"bond") == 0) {
if (iarg+6 > narg) error->all(FLERR,"Illegal fix restrain command");
rstyle[nrestrain] = BOND;
ids[nrestrain][0] = atoi(arg[iarg+1]);
ids[nrestrain][1] = atoi(arg[iarg+2]);
ids[nrestrain][0] = force->inumeric(FLERR,arg[iarg+1]);
ids[nrestrain][1] = force->inumeric(FLERR,arg[iarg+2]);
kstart[nrestrain] = force->numeric(FLERR,arg[iarg+3]);
kstop[nrestrain] = force->numeric(FLERR,arg[iarg+4]);
target[nrestrain] = force->numeric(FLERR,arg[iarg+5]);
@ -85,9 +85,9 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"angle") == 0) {
if (iarg+7 > narg) error->all(FLERR,"Illegal fix restrain command");
rstyle[nrestrain] = ANGLE;
ids[nrestrain][0] = atoi(arg[iarg+1]);
ids[nrestrain][1] = atoi(arg[iarg+2]);
ids[nrestrain][2] = atoi(arg[iarg+3]);
ids[nrestrain][0] = force->inumeric(FLERR,arg[iarg+1]);
ids[nrestrain][1] = force->inumeric(FLERR,arg[iarg+2]);
ids[nrestrain][2] = force->inumeric(FLERR,arg[iarg+3]);
kstart[nrestrain] = force->numeric(FLERR,arg[iarg+4]);
kstop[nrestrain] = force->numeric(FLERR,arg[iarg+5]);
target[nrestrain] = force->numeric(FLERR,arg[iarg+6]);
@ -96,10 +96,10 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[iarg],"dihedral") == 0) {
if (iarg+8 > narg) error->all(FLERR,"Illegal fix restrain command");
rstyle[nrestrain] = DIHEDRAL;
ids[nrestrain][0] = atoi(arg[iarg+1]);
ids[nrestrain][1] = atoi(arg[iarg+2]);
ids[nrestrain][2] = atoi(arg[iarg+3]);
ids[nrestrain][3] = atoi(arg[iarg+4]);
ids[nrestrain][0] = force->inumeric(FLERR,arg[iarg+1]);
ids[nrestrain][1] = force->inumeric(FLERR,arg[iarg+2]);
ids[nrestrain][2] = force->inumeric(FLERR,arg[iarg+3]);
ids[nrestrain][3] = force->inumeric(FLERR,arg[iarg+4]);
kstart[nrestrain] = force->numeric(FLERR,arg[iarg+5]);
kstop[nrestrain] = force->numeric(FLERR,arg[iarg+6]);
target[nrestrain] = force->numeric(FLERR,arg[iarg+7]);

View File

@ -24,6 +24,7 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -51,7 +52,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[3],"NULL") == 0) {
xstyle = NONE;
} else {
xvalue = atof(arg[3]);
xvalue = force->numeric(FLERR,arg[3]);
xstyle = CONSTANT;
}
if (strstr(arg[4],"v_") == arg[4]) {
@ -61,7 +62,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[4],"NULL") == 0) {
ystyle = NONE;
} else {
yvalue = atof(arg[4]);
yvalue = force->numeric(FLERR,arg[4]);
ystyle = CONSTANT;
}
if (strstr(arg[5],"v_") == arg[5]) {
@ -71,7 +72,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
} else if (strcmp(arg[5],"NULL") == 0) {
zstyle = NONE;
} else {
zvalue = atof(arg[5]);
zvalue = force->numeric(FLERR,arg[5]);
zstyle = CONSTANT;
}

View File

@ -79,9 +79,9 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
if (narg < 8) error->all(FLERR,"Illegal fix shake command");
tolerance = atof(arg[3]);
max_iter = atoi(arg[4]);
output_every = atoi(arg[5]);
tolerance = force->numeric(FLERR,arg[3]);
max_iter = force->inumeric(FLERR,arg[4]);
output_every = force->inumeric(FLERR,arg[5]);
// parse SHAKE args for bond and angle types
// will be used by find_clusters
@ -110,25 +110,25 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
atom->check_mass();
} else if (mode == 'b') {
int i = atoi(arg[next]);
int i = force->inumeric(FLERR,arg[next]);
if (i < 1 || i > atom->nbondtypes)
error->all(FLERR,"Invalid bond type index for fix shake");
bond_flag[i] = 1;
} else if (mode == 'a') {
int i = atoi(arg[next]);
int i = force->inumeric(FLERR,arg[next]);
if (i < 1 || i > atom->nangletypes)
error->all(FLERR,"Invalid angle type index for fix shake");
angle_flag[i] = 1;
} else if (mode == 't') {
int i = atoi(arg[next]);
int i = force->inumeric(FLERR,arg[next]);
if (i < 1 || i > atom->ntypes)
error->all(FLERR,"Invalid atom type index for fix shake");
type_flag[i] = 1;
} else if (mode == 'm') {
double massone = atof(arg[next]);
double massone = force->numeric(FLERR,arg[next]);
if (massone == 0.0) error->all(FLERR,"Invalid atom mass for fix shake");
if (nmass == atom->ntypes)
error->all(FLERR,"Too many masses for fix shake");

View File

@ -24,6 +24,7 @@
#include "respa.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "group.h"
using namespace LAMMPS_NS;
@ -52,15 +53,15 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[3],"tether") == 0) {
if (narg != 9) error->all(FLERR,"Illegal fix spring command");
styleflag = TETHER;
k_spring = atof(arg[4]);
k_spring = force->numeric(FLERR,arg[4]);
xflag = yflag = zflag = 1;
if (strcmp(arg[5],"NULL") == 0) xflag = 0;
else xc = atof(arg[5]);
else xc = force->numeric(FLERR,arg[5]);
if (strcmp(arg[6],"NULL") == 0) yflag = 0;
else yc = atof(arg[6]);
else yc = force->numeric(FLERR,arg[6]);
if (strcmp(arg[7],"NULL") == 0) zflag = 0;
else zc = atof(arg[7]);
r0 = atof(arg[8]);
else zc = force->numeric(FLERR,arg[7]);
r0 = force->numeric(FLERR,arg[8]);
if (r0 < 0) error->all(FLERR,"R0 < 0 for fix spring command");
} else if (strcmp(arg[3],"couple") == 0) {
@ -77,15 +78,15 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Two groups cannot be the same in fix spring couple");
group2bit = group->bitmask[igroup2];
k_spring = atof(arg[5]);
k_spring = force->numeric(FLERR,arg[5]);
xflag = yflag = zflag = 1;
if (strcmp(arg[6],"NULL") == 0) xflag = 0;
else xc = atof(arg[6]);
else xc = force->numeric(FLERR,arg[6]);
if (strcmp(arg[7],"NULL") == 0) yflag = 0;
else yc = atof(arg[7]);
else yc = force->numeric(FLERR,arg[7]);
if (strcmp(arg[8],"NULL") == 0) zflag = 0;
else zc = atof(arg[8]);
r0 = atof(arg[9]);
else zc = force->numeric(FLERR,arg[8]);
r0 = force->numeric(FLERR,arg[9]);
if (r0 < 0) error->all(FLERR,"R0 < 0 for fix spring command");
} else error->all(FLERR,"Illegal fix spring command");

View File

@ -26,6 +26,7 @@
#include "respa.h"
#include "domain.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -37,10 +38,10 @@ FixSpringRG::FixSpringRG(LAMMPS *lmp, int narg, char **arg) :
{
if (narg != 5) error->all(FLERR,"Illegal fix spring/rg command");
k = atof(arg[3]);
k = force->numeric(FLERR,arg[3]);
rg0_flag = 0;
if (strcmp(arg[4],"NULL") == 0) rg0_flag = 1;
else rg0 = atof(arg[4]);
else rg0 = force->numeric(FLERR,arg[4]);
}
/* ---------------------------------------------------------------------- */

View File

@ -24,6 +24,7 @@
#include "respa.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -41,7 +42,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) :
global_freq = 1;
extscalar = 1;
k = atof(arg[3]);
k = force->numeric(FLERR,arg[3]);
if (k <= 0.0) error->all(FLERR,"Illegal fix spring/self command");
xflag = yflag = zflag = 1;

View File

@ -17,6 +17,7 @@
#include "atom.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -29,8 +30,8 @@ FixStore::FixStore(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
// syntax: id group style 0/1 nvalue
restart_peratom = atoi(arg[3]);
nvalues = atoi(arg[4]);
restart_peratom = force->inumeric(FLERR,arg[3]);
nvalues = force->inumeric(FLERR,arg[4]);
vecflag = 0;
if (nvalues == 1) vecflag = 1;

View File

@ -25,6 +25,7 @@
#include "variable.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -43,7 +44,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
restart_peratom = 1;
peratom_freq = 1;
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery < 0) error->all(FLERR,"Illegal fix store/state command");
// parse values until one isn't recognized

View File

@ -53,13 +53,13 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) :
strcpy(tstr,&arg[3][2]);
tstyle = EQUAL;
} else {
t_start = atof(arg[3]);
t_start = force->numeric(FLERR,arg[3]);
t_target = t_start;
tstyle = CONSTANT;
}
t_stop = atof(arg[4]);
t_period = atof(arg[5]);
t_stop = force->numeric(FLERR,arg[4]);
t_period = force->numeric(FLERR,arg[5]);
// error checks

View File

@ -41,7 +41,7 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale command");
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale command");
scalar_flag = 1;
@ -55,14 +55,14 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) :
strcpy(tstr,&arg[4][2]);
tstyle = EQUAL;
} else {
t_start = atof(arg[4]);
t_start = force->numeric(FLERR,arg[4]);
t_target = t_start;
tstyle = CONSTANT;
}
t_stop = atof(arg[5]);
t_window = atof(arg[6]);
fraction = atof(arg[7]);
t_stop = force->numeric(FLERR,arg[5]);
t_window = force->numeric(FLERR,arg[6]);
fraction = force->numeric(FLERR,arg[7]);
// create a new compute temp
// id = fix-ID + temp, compute group = fix group

View File

@ -42,7 +42,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
MPI_Comm_rank(world,&me);
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery <= 0) error->all(FLERR,"Illegal fix thermal/conductivity command");
scalar_flag = 1;
@ -54,7 +54,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
else if (strcmp(arg[4],"z") == 0) edim = 2;
else error->all(FLERR,"Illegal fix thermal/conductivity command");
nbin = atoi(arg[5]);
nbin = force->inumeric(FLERR,arg[5]);
if (nbin % 2 || nbin <= 2)
error->all(FLERR,"Illegal fix thermal/conductivity command");
@ -67,7 +67,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
if (strcmp(arg[iarg],"swap") == 0) {
if (iarg+2 > narg)
error->all(FLERR,"Illegal fix thermal/conductivity command");
nswap = atoi(arg[iarg+1]);
nswap = force->inumeric(FLERR,arg[iarg+1]);
if (nswap <= 0)
error->all(FLERR,
"Fix thermal/conductivity swap value must be positive");

View File

@ -44,8 +44,8 @@ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
{
if (narg < 6) error->all(FLERR,"Illegal fix tmd command");
rho_stop = atof(arg[3]);
nfileevery = atoi(arg[5]);
rho_stop = force->numeric(FLERR,arg[3]);
nfileevery = force->inumeric(FLERR,arg[5]);
if (rho_stop < 0 || nfileevery < 0)
error->all(FLERR,"Illegal fix tmd command");
if (nfileevery && narg != 7) error->all(FLERR,"Illegal fix tmd command");

View File

@ -53,16 +53,16 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
restart_peratom = 1;
restart_global = 1;
seed = atoi(arg[3]);
electronic_specific_heat = atof(arg[4]);
electronic_density = atof(arg[5]);
electronic_thermal_conductivity = atof(arg[6]);
gamma_p = atof(arg[7]);
gamma_s = atof(arg[8]);
v_0 = atof(arg[9]);
nxnodes = atoi(arg[10]);
nynodes = atoi(arg[11]);
nznodes = atoi(arg[12]);
seed = force->inumeric(FLERR,arg[3]);
electronic_specific_heat = force->numeric(FLERR,arg[4]);
electronic_density = force->numeric(FLERR,arg[5]);
electronic_thermal_conductivity = force->numeric(FLERR,arg[6]);
gamma_p = force->numeric(FLERR,arg[7]);
gamma_s = force->numeric(FLERR,arg[8]);
v_0 = force->numeric(FLERR,arg[9]);
nxnodes = force->inumeric(FLERR,arg[10]);
nynodes = force->inumeric(FLERR,arg[11]);
nznodes = force->inumeric(FLERR,arg[12]);
fpr = fopen(arg[13],"r");
if (fpr == NULL) {
@ -71,7 +71,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
error->one(FLERR,str);
}
nfileevery = atoi(arg[14]);
nfileevery = force->inumeric(FLERR,arg[14]);
if (nfileevery) {
if (narg != 16) error->all(FLERR,"Illegal fix ttm command");

View File

@ -25,6 +25,7 @@
#include "domain.h"
#include "modify.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -42,7 +43,7 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) :
MPI_Comm_rank(world,&me);
nevery = atoi(arg[3]);
nevery = force->inumeric(FLERR,arg[3]);
if (nevery <= 0) error->all(FLERR,"Illegal fix viscosity command");
scalar_flag = 1;
@ -59,7 +60,7 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) :
else if (strcmp(arg[5],"z") == 0) pdim = 2;
else error->all(FLERR,"Illegal fix viscosity command");
nbin = atoi(arg[6]);
nbin = force->inumeric(FLERR,arg[6]);
if (nbin % 2 || nbin <= 2) error->all(FLERR,"Illegal fix viscosity command");
// optional keywords
@ -71,13 +72,13 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) :
while (iarg < narg) {
if (strcmp(arg[iarg],"swap") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix viscosity command");
nswap = atoi(arg[iarg+1]);
nswap = force->inumeric(FLERR,arg[iarg+1]);
if (nswap <= 0) error->all(FLERR,"Fix viscosity swap value must be positive");
iarg += 2;
} else if (strcmp(arg[iarg],"vtarget") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal fix viscosity command");
if (strcmp(arg[iarg+1],"INF") == 0) vtarget = BIG;
else vtarget = atof(arg[iarg+1]);
else vtarget = force->numeric(FLERR,arg[iarg+1]);
if (vtarget <= 0.0)
error->all(FLERR,"Fix viscosity vtarget value must be positive");
iarg += 2;

View File

@ -19,6 +19,7 @@
#include "update.h"
#include "respa.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -30,7 +31,7 @@ FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 4) error->all(FLERR,"Illegal fix viscous command");
double gamma_one = atof(arg[3]);
double gamma_one = force->numeric(FLERR,arg[3]);
gamma = new double[atom->ntypes+1];
for (int i = 1; i <= atom->ntypes; i++) gamma[i] = gamma_one;
@ -40,8 +41,8 @@ FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) :
while (iarg < narg) {
if (strcmp(arg[iarg],"scale") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal fix viscous command");
int itype = atoi(arg[iarg+1]);
double scale = atof(arg[iarg+2]);
int itype = force->inumeric(FLERR,arg[iarg+1]);
double scale = force->numeric(FLERR,arg[iarg+2]);
if (itype <= 0 || itype > atom->ntypes)
error->all(FLERR,"Illegal fix viscous command");
gamma[itype] = gamma_one * scale;

View File

@ -24,12 +24,13 @@
#include "modify.h"
#include "respa.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
enum{XLO,XHI,YLO,YHI,ZLO,ZHI};
enum{EDGE,CONSTANT,VARIABLE};
enum{XLO=0,XHI=1,YLO=2,YHI=3,ZLO=4,ZHI=5};
enum{NONE=0,EDGE,CONSTANT,VARIABLE};
/* ---------------------------------------------------------------------- */
@ -84,7 +85,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
strcpy(xstr[nwall],&arg[iarg+1][2]);
} else {
xstyle[nwall] = CONSTANT;
coord0[nwall] = atof(arg[iarg+1]);
coord0[nwall] = force->numeric(FLERR,arg[iarg+1]);
}
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
@ -93,7 +94,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
strcpy(estr[nwall],&arg[iarg+2][2]);
estyle[nwall] = VARIABLE;
} else {
epsilon[nwall] = atof(arg[iarg+2]);
epsilon[nwall] = force->numeric(FLERR,arg[iarg+2]);
estyle[nwall] = CONSTANT;
}
@ -103,11 +104,11 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
strcpy(sstr[nwall],&arg[iarg+3][2]);
sstyle[nwall] = VARIABLE;
} else {
sigma[nwall] = atof(arg[iarg+3]);
sigma[nwall] = force->numeric(FLERR,arg[iarg+3]);
sstyle[nwall] = CONSTANT;
}
cutoff[nwall] = atof(arg[iarg+4]);
cutoff[nwall] = force->numeric(FLERR,arg[iarg+4]);
nwall++;
iarg += 5;

View File

@ -23,12 +23,13 @@
#include "input.h"
#include "variable.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
enum{XLO,XHI,YLO,YHI,ZLO,ZHI};
enum{EDGE,CONSTANT,VARIABLE};
enum{XLO=0,XHI=1,YLO=2,YHI=3,ZLO=4,ZHI=5};
enum{NONE=0,EDGE,CONSTANT,VARIABLE};
/* ---------------------------------------------------------------------- */
@ -75,7 +76,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
strcpy(varstr[nwall],&arg[iarg+1][2]);
} else {
wallstyle[nwall] = CONSTANT;
coord0[nwall] = atof(arg[iarg+1]);
coord0[nwall] = force->numeric(FLERR,arg[iarg+1]);
}
nwall++;

View File

@ -24,6 +24,7 @@
#include "output.h"
#include "respa.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -59,9 +60,9 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) :
else if (strcmp(arg[4],"harmonic") == 0) style = HARMONIC;
else error->all(FLERR,"Illegal fix wall/region command");
epsilon = atof(arg[5]);
sigma = atof(arg[6]);
cutoff = atof(arg[7]);
epsilon = force->numeric(FLERR,arg[5]);
sigma = force->numeric(FLERR,arg[6]);
cutoff = force->numeric(FLERR,arg[7]);
if (cutoff <= 0.0) error->all(FLERR,"Fix wall/region cutoff <= 0.0");

View File

@ -185,12 +185,12 @@ void Group::assign(int narg, char **arg)
else if (strcmp(arg[2],"<>") == 0) condition = BETWEEN;
else error->all(FLERR,"Illegal group command");
bound1 = atoi(arg[3]);
bound1 = force->inumeric(FLERR,arg[3]);
bound2 = -1;
if (condition == BETWEEN) {
if (narg != 5) error->all(FLERR,"Illegal group command");
bound2 = atoi(arg[4]);
bound2 = force->inumeric(FLERR,arg[4]);
} else if (narg != 4) error->all(FLERR,"Illegal group command");
int *attribute;

View File

@ -25,6 +25,7 @@
#include "random_mars.h"
#include "math_const.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#ifdef LAMMPS_JPEG
@ -132,7 +133,7 @@ Image::~Image()
memory->destroy(surfacecopy);
memory->destroy(rgbcopy);
delete random;
if (random) delete random;
}
/* ----------------------------------------------------------------------
@ -1098,13 +1099,13 @@ int Image::colormap(int narg, char **arg)
{
if (!islower(arg[0][0])) {
mlo = NUMERIC;
mlovalue = atof(arg[0]);
mlovalue = force->numeric(FLERR,arg[0]);
} else if (strcmp(arg[0],"min") == 0) mlo = MINVALUE;
else return 1;
if (!islower(arg[1][0])) {
mhi = NUMERIC;
mhivalue = atof(arg[1]);
mhivalue = force->numeric(FLERR,arg[1]);
} else if (strcmp(arg[1],"max") == 0) mhi = MAXVALUE;
else return 1;
@ -1120,12 +1121,12 @@ int Image::colormap(int narg, char **arg)
else return 1;
if (mstyle == SEQUENTIAL) {
mbinsize = atof(arg[3]);
mbinsize = force->numeric(FLERR,arg[3]);
if (mbinsize <= 0.0) return 1;
mbinsizeinv = 1.0/mbinsize;
}
nentry = atoi(arg[4]);
nentry = force->inumeric(FLERR,arg[4]);
if (nentry < 1) return 1;
mentry = new MapEntry[nentry];
@ -1135,7 +1136,7 @@ int Image::colormap(int narg, char **arg)
if (n+2 > narg) return 1;
if (!islower(arg[n][0])) {
mentry[i].single = NUMERIC;
mentry[i].svalue = atof(arg[n]);
mentry[i].svalue = force->numeric(FLERR,arg[n]);
} else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE;
else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE;
else return 1;
@ -1145,13 +1146,13 @@ int Image::colormap(int narg, char **arg)
if (n+3 > narg) return 1;
if (!islower(arg[n][0])) {
mentry[i].lo = NUMERIC;
mentry[i].lvalue = atof(arg[n]);
mentry[i].lvalue = force->numeric(FLERR,arg[n]);
} else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE;
else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE;
else return 1;
if (!islower(arg[n+1][0])) {
mentry[i].hi = NUMERIC;
mentry[i].hvalue = atof(arg[n+1]);
mentry[i].hvalue = force->numeric(FLERR,arg[n+1]);
} else if (strcmp(arg[n+1],"min") == 0) mentry[i].single = MINVALUE;
else if (strcmp(arg[n+1],"max") == 0) mentry[i].single = MAXVALUE;
else return 1;

View File

@ -925,7 +925,7 @@ void Input::shell()
} else if (strcmp(arg[0],"mkdir") == 0) {
if (narg < 2) error->all(FLERR,"Illegal shell command");
#if !defined(WINDOWS) && !defined(__MINGW32_VERSION)
#if !defined(WINDOWS) && !defined(__MINGW32__)
if (me == 0)
for (int i = 1; i < narg; i++)
mkdir(arg[i], S_IRWXU | S_IRGRP | S_IXGRP);
@ -1087,7 +1087,7 @@ void Input::compute_modify()
void Input::dielectric()
{
if (narg != 1) error->all(FLERR,"Illegal dielectric command");
force->dielectric = atof(arg[0]);
force->dielectric = force->numeric(FLERR,arg[0]);
}
/* ---------------------------------------------------------------------- */
@ -1121,7 +1121,7 @@ void Input::dimension()
if (narg != 1) error->all(FLERR,"Illegal dimension command");
if (domain->box_exist)
error->all(FLERR,"Dimension command after simulation box is defined");
domain->dimension = atoi(arg[0]);
domain->dimension = force->inumeric(FLERR,arg[0]);
if (domain->dimension != 2 && domain->dimension != 3)
error->all(FLERR,"Illegal dimension command");
@ -1482,7 +1482,7 @@ void Input::thermo_style()
void Input::timestep()
{
if (narg != 1) error->all(FLERR,"Illegal timestep command");
update->dt = atof(arg[0]);
update->dt = force->numeric(FLERR,arg[0]);
}
/* ---------------------------------------------------------------------- */

View File

@ -1635,7 +1635,7 @@ void Neighbor::set(int narg, char **arg)
{
if (narg != 2) error->all(FLERR,"Illegal neighbor command");
skin = atof(arg[0]);
skin = force->numeric(FLERR,arg[0]);
if (skin < 0.0) error->all(FLERR,"Illegal neighbor command");
if (strcmp(arg[1],"nsq") == 0) style = NSQ;
@ -1654,12 +1654,12 @@ void Neighbor::modify_params(int narg, char **arg)
while (iarg < narg) {
if (strcmp(arg[iarg],"every") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
every = atoi(arg[iarg+1]);
every = force->inumeric(FLERR,arg[iarg+1]);
if (every <= 0) error->all(FLERR,"Illegal neigh_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"delay") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
delay = atoi(arg[iarg+1]);
delay = force->inumeric(FLERR,arg[iarg+1]);
if (delay < 0) error->all(FLERR,"Illegal neigh_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"check") == 0) {
@ -1676,15 +1676,15 @@ void Neighbor::modify_params(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"page") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
pgsize = atoi(arg[iarg+1]);
pgsize = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"one") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
oneatom = atoi(arg[iarg+1]);
oneatom = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"binsize") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
binsize_user = atof(arg[iarg+1]);
binsize_user = force->numeric(FLERR,arg[iarg+1]);
if (binsize_user <= 0.0) binsizeflag = 0;
else binsizeflag = 1;
iarg += 2;
@ -1716,8 +1716,8 @@ void Neighbor::modify_params(int narg, char **arg)
memory->grow(ex1_type,maxex_type,"neigh:ex1_type");
memory->grow(ex2_type,maxex_type,"neigh:ex2_type");
}
ex1_type[nex_type] = atoi(arg[iarg+2]);
ex2_type[nex_type] = atoi(arg[iarg+3]);
ex1_type[nex_type] = force->inumeric(FLERR,arg[iarg+2]);
ex2_type[nex_type] = force->inumeric(FLERR,arg[iarg+3]);
nex_type++;
iarg += 4;

View File

@ -449,6 +449,7 @@ void Output::write_restart(bigint ntimestep)
void Output::reset_timestep(bigint ntimestep)
{
next_dump_any = MAXBIGINT;
for (int idump = 0; idump < ndump; idump++) {
if (every_dump[idump]) {
next_dump[idump] = (ntimestep/every_dump[idump])*every_dump[idump];
@ -464,8 +465,7 @@ void Output::reset_timestep(bigint ntimestep)
next_dump[idump] = nextdump;
modify->addstep_compute(next_dump[idump]);
}
if (idump) next_dump_any = MIN(next_dump_any,next_dump[idump]);
else next_dump_any = next_dump[0];
next_dump_any = MIN(next_dump_any,next_dump[idump]);
}
if (restart_flag_single) {
@ -543,7 +543,7 @@ void Output::add_dump(int narg, char **arg)
error->all(FLERR,"Reuse of dump ID");
int igroup = group->find(arg[1]);
if (igroup == -1) error->all(FLERR,"Could not find dump group ID");
if (atoi(arg[3]) <= 0) error->all(FLERR,"Invalid dump frequency");
if (force->inumeric(FLERR,arg[3]) <= 0) error->all(FLERR,"Invalid dump frequency");
// extend Dump list if necessary
@ -571,7 +571,7 @@ void Output::add_dump(int narg, char **arg)
else error->all(FLERR,"Invalid dump style");
every_dump[ndump] = atoi(arg[3]);
every_dump[ndump] = force->inumeric(FLERR,arg[3]);
if (every_dump[ndump] <= 0) error->all(FLERR,"Illegal dump command");
last_dump[ndump] = -1;
var_dump[ndump] = NULL;
@ -639,7 +639,7 @@ void Output::set_thermo(int narg, char **arg)
var_thermo = new char[n];
strcpy(var_thermo,&arg[0][2]);
} else {
thermo_every = atoi(arg[0]);
thermo_every = force->inumeric(FLERR,arg[0]);
if (thermo_every < 0) error->all(FLERR,"Illegal thermo command");
}
}
@ -683,7 +683,7 @@ void Output::create_restart(int narg, char **arg)
int varflag = 0;
if (strstr(arg[0],"v_") == arg[0]) varflag = 1;
else every = atoi(arg[0]);
else every = force->inumeric(FLERR,arg[0]);
if (!varflag && every == 0) {
if (narg != 1) error->all(FLERR,"Illegal restart command");

View File

@ -174,7 +174,7 @@ void PairBeck::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(FLERR,arg[0]);
// reset cutoffs that have been explicitly set
@ -202,14 +202,14 @@ void PairBeck::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double AA_one = atof(arg[2]);
double BB_one = atof(arg[3]);
double aa_one = atof(arg[4]);
double alpha_one = atof(arg[5]);
double beta_one = atof(arg[6]);
double AA_one = force->numeric(FLERR,arg[2]);
double BB_one = force->numeric(FLERR,arg[3]);
double aa_one = force->numeric(FLERR,arg[4]);
double alpha_one = force->numeric(FLERR,arg[5]);
double beta_one = force->numeric(FLERR,arg[6]);
double cut_one = cut_global;
if (narg == 8) cut_one = atof(arg[7]);
if (narg == 8) cut_one = force->numeric(FLERR,arg[7]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -175,7 +175,7 @@ void PairBorn::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(FLERR,arg[0]);
// reset cutoffs that have been explicitly set

View File

@ -165,7 +165,7 @@ void PairGauss::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(FLERR,arg[0]);
// reset cutoffs that have been explicity set
@ -191,11 +191,11 @@ void PairGauss::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double a_one = atof(arg[2]);
double b_one = atof(arg[3]);
double a_one = force->numeric(FLERR,arg[2]);
double b_one = force->numeric(FLERR,arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = atof(arg[4]);
if (narg == 5) cut_one = force->numeric(FLERR,arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -346,7 +346,7 @@ void PairHybrid::coeff(int narg, char **arg)
if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients");
if (!isdigit(arg[3][0]))
error->all(FLERR,"Incorrect args for pair coefficients");
int index = atoi(arg[3]);
int index = force->inumeric(FLERR,arg[3]);
if (index == multiple[m]) break;
else continue;
} else break;

View File

@ -55,7 +55,7 @@ void PairHybridOverlay::coeff(int narg, char **arg)
if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients");
if (!isdigit(arg[3][0]))
error->all(FLERR,"Incorrect args for pair coefficients");
int index = atoi(arg[3]);
int index = force->inumeric(FLERR,arg[3]);
if (index == multiple[m]) break;
else continue;
} else break;

View File

@ -460,11 +460,11 @@ void PairLJ96Cut::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(FLERR,arg[2]);
double sigma_one = force->numeric(FLERR,arg[3]);
double cut_one = cut_global;
if (narg == 5) cut_one = atof(arg[4]);
if (narg == 5) cut_one = force->numeric(FLERR,arg[4]);
int count = 0;
for (int i = ilo; i <= ihi; i++) {

View File

@ -169,7 +169,7 @@ void PairLJSmoothLinear::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
cut_global = atof(arg[0]);
cut_global = force->numeric(FLERR,arg[0]);
// reset cutoffs that have been explicitly set
@ -196,12 +196,12 @@ void PairLJSmoothLinear::coeff(int narg, char **arg)
force->bounds(arg[0],atom->ntypes,ilo,ihi);
force->bounds(arg[1],atom->ntypes,jlo,jhi);
double epsilon_one = atof(arg[2]);
double sigma_one = atof(arg[3]);
double epsilon_one = force->numeric(FLERR,arg[2]);
double sigma_one = force->numeric(FLERR,arg[3]);
double cut_one = cut_global;
if (narg == 5) {
cut_one = atof(arg[4]);
cut_one = force->numeric(FLERR,arg[4]);
}
int count = 0;
@ -245,6 +245,7 @@ double PairLJSmoothLinear::init_one(int i, int j)
lj2[j][i] = lj2[i][j];
lj3[j][i] = lj3[i][j];
lj4[j][i] = lj4[i][j];
cut[j][i] = cut[i][j];
ljcut[j][i] = ljcut[i][j];
dljcut[j][i] = dljcut[i][j];

View File

@ -21,6 +21,7 @@
#include "input.h"
#include "variable.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -349,12 +350,12 @@ void Region::options(int narg, char **arg)
int n = strlen(&arg[iarg+1][2]) + 1;
tstr = new char[n];
strcpy(tstr,&arg[iarg+1][2]);
point[0] = atof(arg[iarg+2]);
point[1] = atof(arg[iarg+3]);
point[2] = atof(arg[iarg+4]);
axis[0] = atof(arg[iarg+5]);
axis[1] = atof(arg[iarg+6]);
axis[2] = atof(arg[iarg+7]);
point[0] = force->numeric(FLERR,arg[iarg+2]);
point[1] = force->numeric(FLERR,arg[iarg+3]);
point[2] = force->numeric(FLERR,arg[iarg+4]);
axis[0] = force->numeric(FLERR,arg[iarg+5]);
axis[1] = force->numeric(FLERR,arg[iarg+6]);
axis[2] = force->numeric(FLERR,arg[iarg+7]);
rotateflag = 1;
iarg += 8;
} else error->all(FLERR,"Illegal region command");

View File

@ -16,6 +16,7 @@
#include "region_block.h"
#include "domain.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -33,7 +34,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
if (strcmp(arg[2],"INF") == 0) xlo = -BIG;
else if (domain->triclinic == 0) xlo = domain->boxlo[0];
else xlo = domain->boxlo_bound[0];
} else xlo = xscale*atof(arg[2]);
} else xlo = xscale*force->numeric(FLERR,arg[2]);
if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) {
if (domain->box_exist == 0)
@ -41,7 +42,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
if (strcmp(arg[3],"INF") == 0) xhi = BIG;
else if (domain->triclinic == 0) xhi = domain->boxhi[0];
else xhi = domain->boxhi_bound[0];
} else xhi = xscale*atof(arg[3]);
} else xhi = xscale*force->numeric(FLERR,arg[3]);
if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) {
if (domain->box_exist == 0)
@ -49,7 +50,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
if (strcmp(arg[4],"INF") == 0) ylo = -BIG;
else if (domain->triclinic == 0) ylo = domain->boxlo[1];
else ylo = domain->boxlo_bound[1];
} else ylo = yscale*atof(arg[4]);
} else ylo = yscale*force->numeric(FLERR,arg[4]);
if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) {
if (domain->box_exist == 0)
@ -57,7 +58,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
if (strcmp(arg[5],"INF") == 0) yhi = BIG;
else if (domain->triclinic == 0) yhi = domain->boxhi[1];
else yhi = domain->boxhi_bound[1];
} else yhi = yscale*atof(arg[5]);
} else yhi = yscale*force->numeric(FLERR,arg[5]);
if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
if (domain->box_exist == 0)
@ -65,7 +66,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
if (strcmp(arg[6],"INF") == 0) zlo = -BIG;
else if (domain->triclinic == 0) zlo = domain->boxlo[2];
else zlo = domain->boxlo_bound[2];
} else zlo = zscale*atof(arg[6]);
} else zlo = zscale*force->numeric(FLERR,arg[6]);
if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
if (domain->box_exist == 0)
@ -73,7 +74,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
if (strcmp(arg[7],"INF") == 0) zhi = BIG;
else if (domain->triclinic == 0) zhi = domain->boxhi[2];
else zhi = domain->boxhi_bound[2];
} else zhi = zscale*atof(arg[7]);
} else zhi = zscale*force->numeric(FLERR,arg[7]);
// error check

View File

@ -21,6 +21,7 @@
#include "region_cone.h"
#include "domain.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -38,20 +39,20 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
axis = arg[2][0];
if (axis == 'x') {
c1 = yscale*atof(arg[3]);
c2 = zscale*atof(arg[4]);
radiuslo = yscale*atof(arg[5]);
radiushi = yscale*atof(arg[6]);
c1 = yscale*force->numeric(FLERR,arg[3]);
c2 = zscale*force->numeric(FLERR,arg[4]);
radiuslo = yscale*force->numeric(FLERR,arg[5]);
radiushi = yscale*force->numeric(FLERR,arg[6]);
} else if (axis == 'y') {
c1 = xscale*atof(arg[3]);
c2 = zscale*atof(arg[4]);
radiuslo = xscale*atof(arg[5]);
radiushi = xscale*atof(arg[6]);
c1 = xscale*force->numeric(FLERR,arg[3]);
c2 = zscale*force->numeric(FLERR,arg[4]);
radiuslo = xscale*force->numeric(FLERR,arg[5]);
radiushi = xscale*force->numeric(FLERR,arg[6]);
} else if (axis == 'z') {
c1 = xscale*atof(arg[3]);
c2 = yscale*atof(arg[4]);
radiuslo = xscale*atof(arg[5]);
radiushi = xscale*atof(arg[6]);
c1 = xscale*force->numeric(FLERR,arg[3]);
c2 = yscale*force->numeric(FLERR,arg[4]);
radiuslo = xscale*force->numeric(FLERR,arg[5]);
radiushi = xscale*force->numeric(FLERR,arg[6]);
}
if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
@ -73,9 +74,9 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
else lo = domain->boxlo_bound[2];
}
} else {
if (axis == 'x') lo = xscale*atof(arg[7]);
if (axis == 'y') lo = yscale*atof(arg[7]);
if (axis == 'z') lo = zscale*atof(arg[7]);
if (axis == 'x') lo = xscale*force->numeric(FLERR,arg[7]);
if (axis == 'y') lo = yscale*force->numeric(FLERR,arg[7]);
if (axis == 'z') lo = zscale*force->numeric(FLERR,arg[7]);
}
if (strcmp(arg[8],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
@ -97,9 +98,9 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
else hi = domain->boxhi_bound[2];
}
} else {
if (axis == 'x') hi = xscale*atof(arg[8]);
if (axis == 'y') hi = yscale*atof(arg[8]);
if (axis == 'z') hi = zscale*atof(arg[8]);
if (axis == 'x') hi = xscale*force->numeric(FLERR,arg[8]);
if (axis == 'y') hi = yscale*force->numeric(FLERR,arg[8]);
if (axis == 'z') hi = zscale*force->numeric(FLERR,arg[8]);
}
// error check

View File

@ -20,6 +20,7 @@
#include "input.h"
#include "variable.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -38,14 +39,14 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
axis = arg[2][0];
if (axis == 'x') {
c1 = yscale*atof(arg[3]);
c2 = zscale*atof(arg[4]);
c1 = yscale*force->numeric(FLERR,arg[3]);
c2 = zscale*force->numeric(FLERR,arg[4]);
} else if (axis == 'y') {
c1 = xscale*atof(arg[3]);
c2 = zscale*atof(arg[4]);
c1 = xscale*force->numeric(FLERR,arg[3]);
c2 = zscale*force->numeric(FLERR,arg[4]);
} else if (axis == 'z') {
c1 = xscale*atof(arg[3]);
c2 = yscale*atof(arg[4]);
c1 = xscale*force->numeric(FLERR,arg[3]);
c2 = yscale*force->numeric(FLERR,arg[4]);
}
rstr = NULL;
@ -59,7 +60,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
variable_check();
shape_update();
} else {
radius = atof(arg[5]);
radius = force->numeric(FLERR,arg[5]);
if (axis == 'x') radius *= xscale;
else radius *= xscale;
rstyle = CONSTANT;
@ -84,9 +85,9 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
else lo = domain->boxlo_bound[2];
}
} else {
if (axis == 'x') lo = xscale*atof(arg[6]);
if (axis == 'y') lo = yscale*atof(arg[6]);
if (axis == 'z') lo = zscale*atof(arg[6]);
if (axis == 'x') lo = xscale*force->numeric(FLERR,arg[6]);
if (axis == 'y') lo = yscale*force->numeric(FLERR,arg[6]);
if (axis == 'z') lo = zscale*force->numeric(FLERR,arg[6]);
}
if (strcmp(arg[7],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
@ -108,9 +109,9 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
else hi = domain->boxhi_bound[2];
}
} else {
if (axis == 'x') hi = xscale*atof(arg[7]);
if (axis == 'y') hi = yscale*atof(arg[7]);
if (axis == 'z') hi = zscale*atof(arg[7]);
if (axis == 'x') hi = xscale*force->numeric(FLERR,arg[7]);
if (axis == 'y') hi = yscale*force->numeric(FLERR,arg[7]);
if (axis == 'z') hi = zscale*force->numeric(FLERR,arg[7]);
}
// error check

View File

@ -16,6 +16,7 @@
#include "region_intersect.h"
#include "domain.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -25,7 +26,7 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) :
Region(lmp, narg, arg)
{
if (narg < 5) error->all(FLERR,"Illegal region command");
int n = atoi(arg[2]);
int n = force->inumeric(FLERR,arg[2]);
if (n < 2) error->all(FLERR,"Illegal region command");
options(narg-(n+3),&arg[n+3]);

View File

@ -16,6 +16,7 @@
#include "string.h"
#include "region_plane.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -26,12 +27,12 @@ RegPlane::RegPlane(LAMMPS *lmp, int narg, char **arg) :
{
options(narg-8,&arg[8]);
xp = xscale*atof(arg[2]);
yp = yscale*atof(arg[3]);
zp = zscale*atof(arg[4]);
normal[0] = xscale*atof(arg[5]);
normal[1] = yscale*atof(arg[6]);
normal[2] = zscale*atof(arg[7]);
xp = xscale*force->numeric(FLERR,arg[2]);
yp = yscale*force->numeric(FLERR,arg[3]);
zp = zscale*force->numeric(FLERR,arg[4]);
normal[0] = xscale*force->numeric(FLERR,arg[5]);
normal[1] = yscale*force->numeric(FLERR,arg[6]);
normal[2] = zscale*force->numeric(FLERR,arg[7]);
// enforce unit normal

View File

@ -38,46 +38,46 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
if (strcmp(arg[2],"INF") == 0) xlo = -BIG;
else xlo = domain->boxlo[0];
} else xlo = xscale*atof(arg[2]);
} else xlo = xscale*force->numeric(FLERR,arg[2]);
if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) {
if (domain->box_exist == 0)
error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
if (strcmp(arg[3],"INF") == 0) xhi = BIG;
else xhi = domain->boxhi[0];
} else xhi = xscale*atof(arg[3]);
} else xhi = xscale*force->numeric(FLERR,arg[3]);
if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) {
if (domain->box_exist == 0)
error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
if (strcmp(arg[4],"INF") == 0) ylo = -BIG;
else ylo = domain->boxlo[1];
} else ylo = yscale*atof(arg[4]);
} else ylo = yscale*force->numeric(FLERR,arg[4]);
if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) {
if (domain->box_exist == 0)
error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
if (strcmp(arg[5],"INF") == 0) yhi = BIG;
else yhi = domain->boxhi[1];
} else yhi = yscale*atof(arg[5]);
} else yhi = yscale*force->numeric(FLERR,arg[5]);
if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
if (domain->box_exist == 0)
error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
if (strcmp(arg[6],"INF") == 0) zlo = -BIG;
else zlo = domain->boxlo[2];
} else zlo = zscale*atof(arg[6]);
} else zlo = zscale*force->numeric(FLERR,arg[6]);
if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
if (domain->box_exist == 0)
error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
if (strcmp(arg[7],"INF") == 0) zhi = BIG;
else zhi = domain->boxhi[2];
} else zhi = zscale*atof(arg[7]);
} else zhi = zscale*force->numeric(FLERR,arg[7]);
xy = xscale*atof(arg[8]);
xz = xscale*atof(arg[9]);
yz = yscale*atof(arg[10]);
xy = xscale*force->numeric(FLERR,arg[8]);
xz = xscale*force->numeric(FLERR,arg[9]);
yz = yscale*force->numeric(FLERR,arg[10]);
// error check
// prism cannot be 0 thickness in any dim, else inverse blows up

View File

@ -19,6 +19,7 @@
#include "input.h"
#include "variable.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -31,9 +32,9 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
{
options(narg-6,&arg[6]);
xc = xscale*atof(arg[2]);
yc = yscale*atof(arg[3]);
zc = zscale*atof(arg[4]);
xc = xscale*force->numeric(FLERR,arg[2]);
yc = yscale*force->numeric(FLERR,arg[3]);
zc = zscale*force->numeric(FLERR,arg[4]);
rstr = NULL;
if (strstr(arg[5],"v_") == arg[5]) {
@ -46,7 +47,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) :
variable_check();
shape_update();
} else {
radius = xscale*atof(arg[5]);
radius = xscale*force->numeric(FLERR,arg[5]);
rstyle = CONSTANT;
}

View File

@ -16,6 +16,7 @@
#include "region_union.h"
#include "domain.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
@ -26,7 +27,7 @@ using namespace LAMMPS_NS;
RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
{
if (narg < 5) error->all(FLERR,"Illegal region command");
int n = atoi(arg[2]);
int n = force->inumeric(FLERR,arg[2]);
if (n < 2) error->all(FLERR,"Illegal region command");
options(narg-(n+3),&arg[n+3]);

View File

@ -50,9 +50,9 @@ void Replicate::command(int narg, char **arg)
// nrep = total # of replications
int nx = atoi(arg[0]);
int ny = atoi(arg[1]);
int nz = atoi(arg[2]);
int nx = force->inumeric(FLERR,arg[0]);
int ny = force->inumeric(FLERR,arg[1]);
int nz = force->inumeric(FLERR,arg[2]);
int nrep = nx*ny*nz;
// error and warning checks

View File

@ -82,16 +82,16 @@ void Set::command(int narg, char **arg)
if (strcmp(arg[iarg],"type") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = atoi(arg[iarg+1]);
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (ivalue <= 0 || ivalue > atom->ntypes)
error->all(FLERR,"Invalid value in set command");
set(TYPE);
iarg += 2;
} else if (strcmp(arg[iarg],"type/fraction") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
newtype = atoi(arg[iarg+1]);
fraction = atof(arg[iarg+2]);
ivalue = atoi(arg[iarg+3]);
newtype = force->inumeric(FLERR,arg[iarg+1]);
fraction = force->numeric(FLERR,arg[iarg+2]);
ivalue = force->inumeric(FLERR,arg[iarg+3]);
if (newtype <= 0 || newtype > atom->ntypes)
error->all(FLERR,"Invalid value in set command");
if (fraction < 0.0 || fraction > 1.0)
@ -102,36 +102,36 @@ void Set::command(int narg, char **arg)
iarg += 4;
} else if (strcmp(arg[iarg],"mol") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = atoi(arg[iarg+1]);
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (!atom->molecule_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(MOLECULE);
iarg += 2;
} else if (strcmp(arg[iarg],"x") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
set(X);
iarg += 2;
} else if (strcmp(arg[iarg],"y") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
set(Y);
iarg += 2;
} else if (strcmp(arg[iarg],"z") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
set(Z);
iarg += 2;
} else if (strcmp(arg[iarg],"charge") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->q_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(CHARGE);
iarg += 2;
} else if (strcmp(arg[iarg],"mass") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->rmass_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (dvalue <= 0.0) error->all(FLERR,"Invalid mass in set command");
@ -139,9 +139,9 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"shape") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
xvalue = atof(arg[iarg+1]);
yvalue = atof(arg[iarg+2]);
zvalue = atof(arg[iarg+3]);
xvalue = force->numeric(FLERR,arg[iarg+1]);
yvalue = force->numeric(FLERR,arg[iarg+2]);
zvalue = force->numeric(FLERR,arg[iarg+3]);
if (!atom->ellipsoid_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (xvalue < 0.0 || yvalue < 0.0 || zvalue < 0.0)
@ -154,7 +154,7 @@ void Set::command(int narg, char **arg)
iarg += 4;
} else if (strcmp(arg[iarg],"length") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->line_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (dvalue < 0.0) error->all(FLERR,"Invalid length in set command");
@ -162,7 +162,7 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"tri") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->tri_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (dvalue < 0.0) error->all(FLERR,"Invalid length in set command");
@ -170,17 +170,17 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"dipole") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
xvalue = atof(arg[iarg+1]);
yvalue = atof(arg[iarg+2]);
zvalue = atof(arg[iarg+3]);
xvalue = force->numeric(FLERR,arg[iarg+1]);
yvalue = force->numeric(FLERR,arg[iarg+2]);
zvalue = force->numeric(FLERR,arg[iarg+3]);
if (!atom->mu_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(DIPOLE);
iarg += 4;
} else if (strcmp(arg[iarg],"dipole/random") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal set command");
ivalue = atoi(arg[iarg+1]);
dvalue = atof(arg[iarg+2]);
ivalue = force->inumeric(FLERR,arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+2]);
if (!atom->mu_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0)
@ -191,17 +191,17 @@ void Set::command(int narg, char **arg)
iarg += 3;
} else if (strcmp(arg[iarg],"quat") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal set command");
xvalue = atof(arg[iarg+1]);
yvalue = atof(arg[iarg+2]);
zvalue = atof(arg[iarg+3]);
wvalue = atof(arg[iarg+4]);
xvalue = force->numeric(FLERR,arg[iarg+1]);
yvalue = force->numeric(FLERR,arg[iarg+2]);
zvalue = force->numeric(FLERR,arg[iarg+3]);
wvalue = force->numeric(FLERR,arg[iarg+4]);
if (!atom->ellipsoid_flag && !atom->tri_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(QUAT);
iarg += 5;
} else if (strcmp(arg[iarg],"quat/random") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = atoi(arg[iarg+1]);
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (!atom->ellipsoid_flag && !atom->tri_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0)
@ -210,7 +210,7 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"theta") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
dvalue *= MY_PI/180.0;
if (!atom->line_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
@ -218,16 +218,16 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"angmom") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
xvalue = atof(arg[iarg+1]);
yvalue = atof(arg[iarg+2]);
zvalue = atof(arg[iarg+3]);
xvalue = force->numeric(FLERR,arg[iarg+1]);
yvalue = force->numeric(FLERR,arg[iarg+2]);
zvalue = force->numeric(FLERR,arg[iarg+3]);
if (!atom->ellipsoid_flag && !atom->tri_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(ANGMOM);
iarg += 4;
} else if (strcmp(arg[iarg],"diameter") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->radius_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (dvalue < 0.0) error->all(FLERR,"Invalid diameter in set command");
@ -235,14 +235,14 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"density") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->rmass_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(DENSITY);
iarg += 2;
} else if (strcmp(arg[iarg],"volume") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->vfrac_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(VOLUME);
@ -252,15 +252,15 @@ void Set::command(int narg, char **arg)
ximageflag = yimageflag = zimageflag = 0;
if (strcmp(arg[iarg+1],"NULL") != 0) {
ximageflag = 1;
ximage = atoi(arg[iarg+1]);
ximage = force->inumeric(FLERR,arg[iarg+1]);
}
if (strcmp(arg[iarg+2],"NULL") != 0) {
yimageflag = 1;
yimage = atoi(arg[iarg+2]);
yimage = force->inumeric(FLERR,arg[iarg+2]);
}
if (strcmp(arg[iarg+3],"NULL") != 0) {
zimageflag = 1;
zimage = atoi(arg[iarg+3]);
zimage = force->inumeric(FLERR,arg[iarg+3]);
}
if (ximageflag && ximage && !domain->xperiodic)
error->all(FLERR,
@ -275,7 +275,7 @@ void Set::command(int narg, char **arg)
iarg += 4;
} else if (strcmp(arg[iarg],"bond") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = atoi(arg[iarg+1]);
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (atom->avec->bonds_allow == 0)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0 || ivalue > atom->nbondtypes)
@ -284,7 +284,7 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"angle") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = atoi(arg[iarg+1]);
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (atom->avec->angles_allow == 0)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0 || ivalue > atom->nangletypes)
@ -293,7 +293,7 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"dihedral") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = atoi(arg[iarg+1]);
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (atom->avec->dihedrals_allow == 0)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0 || ivalue > atom->ndihedraltypes)
@ -302,7 +302,7 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"improper") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
ivalue = atoi(arg[iarg+1]);
ivalue = force->inumeric(FLERR,arg[iarg+1]);
if (atom->avec->impropers_allow == 0)
error->all(FLERR,"Cannot set this attribute for this atom style");
if (ivalue <= 0 || ivalue > atom->nimpropertypes)
@ -311,21 +311,21 @@ void Set::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"meso_e") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->e_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(MESO_E);
iarg += 2;
} else if (strcmp(arg[iarg],"meso_cv") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->cv_flag)
error->all(FLERR,"Cannot set this attribute for this atom style");
set(MESO_CV);
iarg += 2;
} else if (strcmp(arg[iarg],"meso_rho") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
dvalue = atof(arg[iarg+1]);
dvalue = force->numeric(FLERR,arg[iarg+1]);
if (!atom->rho_flag)
error->all(FLERR,"Cannot set meso_rho for this atom style");
set(MESO_RHO);

View File

@ -33,6 +33,7 @@
#include "atom_masks.h"
#include "memory.h"
#include "error.h"
#include "force.h"
using namespace LAMMPS_NS;
using namespace MathConst;
@ -166,7 +167,7 @@ void Variable::set(int narg, char **arg)
int nfirst,nlast;
if (narg == 3 || (narg == 4 && strcmp(arg[3],"pad") == 0)) {
nfirst = 1;
nlast = atoi(arg[2]);
nlast = force->inumeric(FLERR,arg[2]);
if (nlast <= 0) error->all(FLERR,"Illegal variable command");
if (narg == 4 && strcmp(arg[3],"pad") == 0) {
char digits[12];
@ -174,8 +175,8 @@ void Variable::set(int narg, char **arg)
pad[nvar] = strlen(digits);
} else pad[nvar] = 0;
} else if (narg == 4 || (narg == 5 && strcmp(arg[4],"pad") == 0)) {
nfirst = atoi(arg[2]);
nlast = atoi(arg[3]);
nfirst = force->inumeric(FLERR,arg[2]);
nlast = force->inumeric(FLERR,arg[3]);
if (nfirst > nlast || nlast < 0)
error->all(FLERR,"Illegal variable command");
if (narg == 5 && strcmp(arg[4],"pad") == 0) {
@ -229,7 +230,7 @@ void Variable::set(int narg, char **arg)
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = ULOOP;
num[nvar] = atoi(arg[2]);
num[nvar] = force->inumeric(FLERR,arg[2]);
data[nvar] = new char*[1];
data[nvar][0] = NULL;
if (narg == 4) {

View File

@ -100,8 +100,8 @@ void Velocity::command(int narg, char **arg)
// create() invoked differently, so can be called externally
if (style == CREATE) {
double t_desired = atof(arg[2]);
int seed = atoi(arg[3]);
double t_desired = force->numeric(FLERR,arg[2]);
int seed = force->inumeric(FLERR,arg[3]);
create(t_desired,seed);
}
else if (style == SET) set(narg-2,&arg[2]);
@ -357,21 +357,21 @@ void Velocity::set(int narg, char **arg)
xstr = new char[n];
strcpy(xstr,&arg[0][2]);
} else if (strcmp(arg[0],"NULL") == 0) xstyle = NONE;
else vx = atof(arg[0]);
else vx = force->numeric(FLERR,arg[0]);
if (strstr(arg[1],"v_") == arg[1]) {
int n = strlen(&arg[1][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[1][2]);
} else if (strcmp(arg[1],"NULL") == 0) ystyle = NONE;
else vy = atof(arg[1]);
else vy = force->numeric(FLERR,arg[1]);
if (strstr(arg[2],"v_") == arg[2]) {
int n = strlen(&arg[2][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[2][2]);
} else if (strcmp(arg[2],"NULL") == 0) zstyle = NONE;
else vz = atof(arg[2]);
else vz = force->numeric(FLERR,arg[2]);
// set and apply scale factors
@ -505,7 +505,7 @@ void Velocity::set(int narg, char **arg)
void Velocity::scale(int narg, char **arg)
{
double t_desired = atof(arg[0]);
double t_desired = force->numeric(FLERR,arg[0]);
// if temperature = NULL, create a new ComputeTemp with the velocity group
@ -566,14 +566,14 @@ void Velocity::ramp(int narg, char **arg)
double v_lo,v_hi;
if (v_dim == 0) {
v_lo = xscale*atof(arg[1]);
v_hi = xscale*atof(arg[2]);
v_lo = xscale*force->numeric(FLERR,arg[1]);
v_hi = xscale*force->numeric(FLERR,arg[2]);
} else if (v_dim == 1) {
v_lo = yscale*atof(arg[1]);
v_hi = yscale*atof(arg[2]);
v_lo = yscale*force->numeric(FLERR,arg[1]);
v_hi = yscale*force->numeric(FLERR,arg[2]);
} else if (v_dim == 2) {
v_lo = zscale*atof(arg[1]);
v_hi = zscale*atof(arg[2]);
v_lo = zscale*force->numeric(FLERR,arg[1]);
v_hi = zscale*force->numeric(FLERR,arg[2]);
}
int coord_dim;
@ -584,14 +584,14 @@ void Velocity::ramp(int narg, char **arg)
double coord_lo,coord_hi;
if (coord_dim == 0) {
coord_lo = xscale*atof(arg[4]);
coord_hi = xscale*atof(arg[5]);
coord_lo = xscale*force->numeric(FLERR,arg[4]);
coord_hi = xscale*force->numeric(FLERR,arg[5]);
} else if (coord_dim == 1) {
coord_lo = yscale*atof(arg[4]);
coord_hi = yscale*atof(arg[5]);
coord_lo = yscale*force->numeric(FLERR,arg[4]);
coord_hi = yscale*force->numeric(FLERR,arg[5]);
} else if (coord_dim == 2) {
coord_lo = zscale*atof(arg[4]);
coord_hi = zscale*atof(arg[5]);
coord_lo = zscale*force->numeric(FLERR,arg[4]);
coord_hi = zscale*force->numeric(FLERR,arg[5]);
}
// vramp = ramped velocity component for v_dim