git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10199 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -259,7 +259,7 @@ class LammpsInterface {
|
|||||||
/*@{*/
|
/*@{*/
|
||||||
int atomPE_create(void);
|
int atomPE_create(void);
|
||||||
void atomPE_init(void);
|
void atomPE_init(void);
|
||||||
void atomPE_addstep(int step);
|
void atomPE_addstep(LAMMPS_NS::bigint step);
|
||||||
double * atomPE_compute(void);
|
double * atomPE_compute(void);
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
|
|||||||
@ -1127,15 +1127,15 @@ void PairLubricateUPoly::settings(int narg, char **arg)
|
|||||||
|
|
||||||
if (narg < 5 || narg > 7) error->all(FLERR,"Illegal pair_style command");
|
if (narg < 5 || narg > 7) error->all(FLERR,"Illegal pair_style command");
|
||||||
|
|
||||||
mu = atof(arg[0]);
|
mu = force->numeric(FLERR,arg[0]);
|
||||||
flaglog = atoi(arg[1]);
|
flaglog = force->inumeric(FLERR,arg[1]);
|
||||||
cut_inner_global = atof(arg[2]);
|
cut_inner_global = force->numeric(FLERR,arg[2]);
|
||||||
cut_global = atof(arg[3]);
|
cut_global = force->numeric(FLERR,arg[3]);
|
||||||
gdot = atof(arg[4]);
|
gdot = force->numeric(FLERR,arg[4]);
|
||||||
|
|
||||||
flagHI = flagVF = 1;
|
flagHI = flagVF = 1;
|
||||||
if (narg >= 6) flagHI = atoi(arg[5]);
|
if (narg >= 6) flagHI = force->inumeric(FLERR,arg[5]);
|
||||||
if (narg == 7) flagVF = atoi(arg[6]);
|
if (narg == 7) flagVF = force->inumeric(FLERR,arg[6]);
|
||||||
|
|
||||||
if (flaglog == 1 && flagHI == 0) {
|
if (flaglog == 1 && flagHI == 0) {
|
||||||
error->warning(FLERR,"Cannot include log terms without 1/r terms; "
|
error->warning(FLERR,"Cannot include log terms without 1/r terms; "
|
||||||
|
|||||||
@ -68,8 +68,8 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
} else
|
} else
|
||||||
error->all(FLERR,"Illegal fix GPU command");
|
error->all(FLERR,"Illegal fix GPU command");
|
||||||
|
|
||||||
first_gpu = atoi(arg[4]);
|
first_gpu = force->inumeric(FLERR,arg[4]);
|
||||||
last_gpu = atoi(arg[5]);
|
last_gpu = force->inumeric(FLERR,arg[5]);
|
||||||
|
|
||||||
_particle_split = force->numeric(FLERR,arg[6]);
|
_particle_split = force->numeric(FLERR,arg[6]);
|
||||||
if (_particle_split==0 || _particle_split>1)
|
if (_particle_split==0 || _particle_split>1)
|
||||||
@ -84,11 +84,11 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix GPU command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix GPU command");
|
||||||
|
|
||||||
if (strcmp(arg[iarg],"threads_per_atom") == 0)
|
if (strcmp(arg[iarg],"threads_per_atom") == 0)
|
||||||
threads_per_atom = atoi(arg[iarg+1]);
|
threads_per_atom = force->inumeric(FLERR,arg[iarg+1]);
|
||||||
else if (strcmp(arg[iarg],"nthreads") == 0)
|
else if (strcmp(arg[iarg],"nthreads") == 0)
|
||||||
nthreads = atoi(arg[iarg+1]);
|
nthreads = force->inumeric(FLERR,arg[iarg+1]);
|
||||||
else if (strcmp(arg[iarg],"cellsize") == 0)
|
else if (strcmp(arg[iarg],"cellsize") == 0)
|
||||||
cell_size = atof(arg[iarg+1]);
|
cell_size = force->numeric(FLERR,arg[iarg+1]);
|
||||||
else
|
else
|
||||||
error->all(FLERR,"Illegal fix GPU command");
|
error->all(FLERR,"Illegal fix GPU command");
|
||||||
|
|
||||||
|
|||||||
@ -63,7 +63,7 @@ FixTuneKspace::FixTuneKspace(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
// parse arguments
|
// parse arguments
|
||||||
|
|
||||||
nevery = atoi(arg[3]);
|
nevery = force->inumeric(FLERR,arg[3]);
|
||||||
|
|
||||||
// set up reneighboring
|
// set up reneighboring
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ PPPMOld::PPPMOld(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
|
|||||||
pppmflag = 1;
|
pppmflag = 1;
|
||||||
group_group_enable = 1;
|
group_group_enable = 1;
|
||||||
|
|
||||||
accuracy_relative = atof(arg[0]);
|
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
|
||||||
|
|
||||||
nfactors = 3;
|
nfactors = 3;
|
||||||
factors = new int[nfactors];
|
factors = new int[nfactors];
|
||||||
|
|||||||
@ -1,113 +0,0 @@
|
|||||||
# mingw = Windows 32bit, cross-compiled on Linux, gcc-4.4.1, MinGW x-compiler
|
|
||||||
|
|
||||||
SHELL = /bin/sh
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# compiler/linker settings
|
|
||||||
# specify flags and libraries needed for your compiler
|
|
||||||
|
|
||||||
CC = i686-pc-mingw32-g++
|
|
||||||
CCFLAGS = -O3 -march=i686 -mtune=generic -mfpmath=387 -mpc64 \
|
|
||||||
-fno-exceptions -fno-rtti -ffast-math -funroll-loops -fstrict-aliasing -Wall -W -Wno-uninitialized
|
|
||||||
SHFLAGS = -fPIC
|
|
||||||
DEPFLAGS = -M
|
|
||||||
|
|
||||||
LINK = i686-pc-mingw32-g++
|
|
||||||
LINKFLAGS = -O
|
|
||||||
LIB = -lwsock32 # -lwsock32 is needed for USER-IMD which uses tcp/ip sockets.
|
|
||||||
SIZE = i686-pc-mingw32-size
|
|
||||||
|
|
||||||
ARCHIVE = ar
|
|
||||||
ARFLAGS = -rcsv
|
|
||||||
SHLIBFLAGS = -shared
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# LAMMPS-specific settings
|
|
||||||
# specify settings for LAMMPS features you will use
|
|
||||||
# if you change any -D setting, do full re-compile after "make clean"
|
|
||||||
|
|
||||||
# LAMMPS ifdef settings, OPTIONAL
|
|
||||||
# see possible settings in doc/Section_start.html#2_2 (step 4)
|
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_XDR # -DLAMMPS_GZIP -DMALLOC_MEMALIGN=64
|
|
||||||
|
|
||||||
# MPI library, REQUIRED
|
|
||||||
# see discussion in doc/Section_start.html#2_2 (step 5)
|
|
||||||
# can point to dummy MPI library in src/STUBS as in Makefile.serial
|
|
||||||
# INC = path for mpi.h, MPI compiler settings
|
|
||||||
# PATH = path for MPI library
|
|
||||||
# LIB = name of MPI library
|
|
||||||
|
|
||||||
MPI_INC = -I../STUBS
|
|
||||||
MPI_PATH =
|
|
||||||
MPI_LIB = mpi.o
|
|
||||||
|
|
||||||
# FFT library, OPTIONAL
|
|
||||||
# see discussion in doc/Section_start.html#2_2 (step 6)
|
|
||||||
# can be left blank to use provided KISS FFT library
|
|
||||||
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
|
|
||||||
# PATH = path for FFT library
|
|
||||||
# LIB = name of FFT library
|
|
||||||
|
|
||||||
FFT_INC = -DFFT_NONE #-DFFT_SINGLE
|
|
||||||
FFT_PATH =
|
|
||||||
FFT_LIB = #-lfftw
|
|
||||||
|
|
||||||
# JPEG library, OPTIONAL
|
|
||||||
# see discussion in doc/Section_start.html#2_2 (step 7)
|
|
||||||
# only needed if -DLAMMPS_JPEG listed with LMP_INC
|
|
||||||
# INC = path for jpeglib.h
|
|
||||||
# PATH = path for JPEG library
|
|
||||||
# LIB = name of JPEG library
|
|
||||||
|
|
||||||
JPG_INC =
|
|
||||||
JPG_PATH =
|
|
||||||
JPG_LIB =
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
|
||||||
# build rules and dependencies
|
|
||||||
# no need to edit this section
|
|
||||||
|
|
||||||
include Makefile.package.settings
|
|
||||||
include Makefile.package
|
|
||||||
|
|
||||||
EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
|
|
||||||
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
|
|
||||||
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
|
|
||||||
|
|
||||||
# Path to src files
|
|
||||||
|
|
||||||
vpath %.cpp ..
|
|
||||||
vpath %.h ..
|
|
||||||
|
|
||||||
# Link target
|
|
||||||
|
|
||||||
$(EXE): $(EXE).exe ../MAKE/mingw_cross.nsis
|
|
||||||
makensis ../MAKE/mingw_cross.nsis
|
|
||||||
(cd ..; zip -0 lammps-icms-win.zip lammps-icms-win.exe)
|
|
||||||
touch $(EXE)
|
|
||||||
|
|
||||||
$(EXE).exe: $(OBJ) mpi.o
|
|
||||||
$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE).exe
|
|
||||||
$(SIZE) $(EXE).exe
|
|
||||||
|
|
||||||
# Library target
|
|
||||||
|
|
||||||
lib: $(OBJ)
|
|
||||||
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
|
|
||||||
|
|
||||||
# Compilation rules
|
|
||||||
|
|
||||||
%.o:%.cpp
|
|
||||||
$(CC) $(CCFLAGS) $(EXTRA_INC) -c $<
|
|
||||||
|
|
||||||
%.d:%.cpp
|
|
||||||
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
|
|
||||||
|
|
||||||
# Individual dependencies
|
|
||||||
|
|
||||||
mpi.o: ../STUBS/mpi.c ../STUBS/mpi.h
|
|
||||||
$(CC) $(CCFLAGS) $(EXTRA_INC) -c $<
|
|
||||||
|
|
||||||
DEPENDS = $(OBJ:.o=.d)
|
|
||||||
sinclude $(DEPENDS)
|
|
||||||
@ -50,8 +50,10 @@
|
|||||||
#include "neigh_request.h"
|
#include "neigh_request.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "math_special.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
using namespace MathSpecial;
|
||||||
|
|
||||||
#define MAXLINE 1024
|
#define MAXLINE 1024
|
||||||
#define EPSILON 1.0e-6
|
#define EPSILON 1.0e-6
|
||||||
@ -7223,9 +7225,9 @@ void PairBOP::PiBo()
|
|||||||
// piB is similary formulation to (a) Eq. 36 and (b) Eq. 18
|
// piB is similary formulation to (a) Eq. 36 and (b) Eq. 18
|
||||||
|
|
||||||
piB[n]=(ABrtR1+ABrtR2)*pi_a[iij]*betaP[temp_ij];
|
piB[n]=(ABrtR1+ABrtR2)*pi_a[iij]*betaP[temp_ij];
|
||||||
dPiB1=-.5*(pow(ABrtR1,3)+pow(ABrtR2,3))*pi_c[iij]*pi_a[iij]*betaP[temp_ij];
|
dPiB1=-.5*(cube(ABrtR1)+cube(ABrtR2))*pi_c[iij]*pi_a[iij]*betaP[temp_ij];
|
||||||
dPiB2=.25*BBrtR*(pow(ABrtR2,3)-pow(ABrtR1,3))*pi_c[iij]*pi_a[iij]*betaP[temp_ij];
|
dPiB2=.25*BBrtR*(cube(ABrtR2)-cube(ABrtR1))*pi_c[iij]*pi_a[iij]*betaP[temp_ij];
|
||||||
dPiB3=((ABrtR1+ABrtR2)*pi_a[iij]-(pow(ABrtR1,3)+pow(ABrtR2,3))*pi_a[iij]
|
dPiB3=((ABrtR1+ABrtR2)*pi_a[iij]-(cube(ABrtR1)+cube(ABrtR2))*pi_a[iij]
|
||||||
*betaP[temp_ij]*betaP[temp_ij])*dBetaP[temp_ij]/rij[temp_ij];
|
*betaP[temp_ij]*betaP[temp_ij])*dBetaP[temp_ij]/rij[temp_ij];
|
||||||
n++;
|
n++;
|
||||||
pp2=2.0*betaP[temp_ij];
|
pp2=2.0*betaP[temp_ij];
|
||||||
@ -8147,9 +8149,9 @@ void PairBOP::PiBo_otf()
|
|||||||
// piB is similary formulation to (a) Eq. 36 and (b) Eq. 18
|
// piB is similary formulation to (a) Eq. 36 and (b) Eq. 18
|
||||||
|
|
||||||
piB[n]=(ABrtR1+ABrtR2)*pi_a[iij]*betaP_ij;
|
piB[n]=(ABrtR1+ABrtR2)*pi_a[iij]*betaP_ij;
|
||||||
dPiB1=-.5*(pow(ABrtR1,3)+pow(ABrtR2,3))*pi_c[iij]*pi_a[iij]*betaP_ij;
|
dPiB1=-.5*(cube(ABrtR1)+cube(ABrtR2))*pi_c[iij]*pi_a[iij]*betaP_ij;
|
||||||
dPiB2=.25*BBrtR*(pow(ABrtR2,3)-pow(ABrtR1,3))*pi_c[iij]*pi_a[iij]*betaP_ij;
|
dPiB2=.25*BBrtR*(cube(ABrtR2)-cube(ABrtR1))*pi_c[iij]*pi_a[iij]*betaP_ij;
|
||||||
dPiB3=((ABrtR1+ABrtR2)*pi_a[iij]-(pow(ABrtR1,3)+pow(ABrtR2,3))*pi_a[iij]
|
dPiB3=((ABrtR1+ABrtR2)*pi_a[iij]-(cube(ABrtR1)+cube(ABrtR2))*pi_a[iij]
|
||||||
*betaP_ij*betaP_ij)*dBetaP_ij/r_ij;
|
*betaP_ij*betaP_ij)*dBetaP_ij/r_ij;
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
@ -9017,7 +9019,7 @@ void PairBOP::setSign()
|
|||||||
cs=0.0;
|
cs=0.0;
|
||||||
if(xBO<alpha)
|
if(xBO<alpha)
|
||||||
cs=32.0*(alpha-xBO);
|
cs=32.0*(alpha-xBO);
|
||||||
bigF=(sigma_f[i]*(1.0-sigma_f[i])-fth*(1.0-fth))/pow(1.0-2.0*fth,2);
|
bigF=(sigma_f[i]*(1.0-sigma_f[i])-fth*(1.0-fth))/square(1.0-2.0*fth);
|
||||||
FsigBO[i][j]=2.0*fth+2.0*bigF*(1.0-2.0*fth)*(1.0+bigF*(1.0-cs*bigF));
|
FsigBO[i][j]=2.0*fth+2.0*bigF*(1.0-2.0*fth)*(1.0+bigF*(1.0-cs*bigF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,7 +68,7 @@ void PairTersoffZBL::read_file(char *file)
|
|||||||
|
|
||||||
memory->sfree(params);
|
memory->sfree(params);
|
||||||
params = NULL;
|
params = NULL;
|
||||||
nparams = 0;
|
nparams = maxparam = 0;
|
||||||
|
|
||||||
// open file on proc 0
|
// open file on proc 0
|
||||||
|
|
||||||
|
|||||||
@ -106,19 +106,19 @@ template < const int CTABLE, const int EVFLAG,
|
|||||||
const int EFLAG, const int VFLAG>
|
const int EFLAG, const int VFLAG>
|
||||||
void PairLJCutTIP4PLongOpt::eval()
|
void PairLJCutTIP4PLongOpt::eval()
|
||||||
{
|
{
|
||||||
|
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
|
||||||
|
double fraction,table;
|
||||||
|
double r,rsq,r2inv,r6inv,forcecoul,forcelj,cforce;
|
||||||
|
double factor_coul,factor_lj;
|
||||||
|
double grij,expm2,prefactor,t,erfc;
|
||||||
|
double v[6],xH1[3],xH2[3];
|
||||||
|
double fdx,fdy,fdz,fOx,fOy,fOz,fHx,fHy,fHz;
|
||||||
|
const double *x1,*x2;
|
||||||
|
|
||||||
|
int *ilist,*jlist,*numneigh,**firstneigh;
|
||||||
int i,j,ii,jj,inum,jnum,itype,jtype,itable,key;
|
int i,j,ii,jj,inum,jnum,itype,jtype,itable,key;
|
||||||
int n,vlist[6];
|
int n,vlist[6];
|
||||||
int iH1,iH2,jH1,jH2;
|
int iH1,iH2,jH1,jH2;
|
||||||
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul;
|
|
||||||
double fraction,table;
|
|
||||||
double delxOM,delyOM,delzOM;
|
|
||||||
double r,rsq,r2inv,r6inv,forcecoul,forcelj,cforce;
|
|
||||||
double factor_coul,factor_lj;
|
|
||||||
double grij,expm2,prefactor,t,erfc,ddotf;
|
|
||||||
double v[6],xH1[3],xH2[3];
|
|
||||||
double fdx,fdy,fdz,f1x,f1y,f1z,fOx,fOy,fOz,fHx,fHy,fHz;
|
|
||||||
const double *x1,*x2;
|
|
||||||
int *ilist,*jlist,*numneigh,**firstneigh;
|
|
||||||
|
|
||||||
evdwl = ecoul = 0.0;
|
evdwl = ecoul = 0.0;
|
||||||
|
|
||||||
@ -434,7 +434,6 @@ void PairLJCutTIP4PLongOpt::eval()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
compute position xM of fictitious charge site for O atom and 2 H atoms
|
compute position xM of fictitious charge site for O atom and 2 H atoms
|
||||||
return it as xM
|
return it as xM
|
||||||
|
|||||||
@ -31,6 +31,7 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
@ -105,11 +106,11 @@ void NEB::command(int narg, char **arg)
|
|||||||
|
|
||||||
if (narg != 6) error->universe_all(FLERR,"Illegal NEB command");
|
if (narg != 6) error->universe_all(FLERR,"Illegal NEB command");
|
||||||
|
|
||||||
etol = atof(arg[0]);
|
etol = force->numeric(FLERR,arg[0]);
|
||||||
ftol = atof(arg[1]);
|
ftol = force->numeric(FLERR,arg[1]);
|
||||||
n1steps = atoi(arg[2]);
|
n1steps = force->inumeric(FLERR,arg[2]);
|
||||||
n2steps = atoi(arg[3]);
|
n2steps = force->inumeric(FLERR,arg[3]);
|
||||||
nevery = atoi(arg[4]);
|
nevery = force->inumeric(FLERR,arg[4]);
|
||||||
infile = arg[5];
|
infile = arg[5];
|
||||||
|
|
||||||
// error checks
|
// error checks
|
||||||
|
|||||||
@ -73,15 +73,15 @@ void PRD::command(int narg, char **arg)
|
|||||||
|
|
||||||
if (narg < 7) error->universe_all(FLERR,"Illegal prd command");
|
if (narg < 7) error->universe_all(FLERR,"Illegal prd command");
|
||||||
|
|
||||||
nsteps = atoi(arg[0]);
|
nsteps = force->inumeric(FLERR,arg[0]);
|
||||||
t_event = atoi(arg[1]);
|
t_event = force->inumeric(FLERR,arg[1]);
|
||||||
n_dephase = atoi(arg[2]);
|
n_dephase = force->inumeric(FLERR,arg[2]);
|
||||||
t_dephase = atoi(arg[3]);
|
t_dephase = force->inumeric(FLERR,arg[3]);
|
||||||
t_corr = atoi(arg[4]);
|
t_corr = force->inumeric(FLERR,arg[4]);
|
||||||
|
|
||||||
char *id_compute = new char[strlen(arg[5])+1];
|
char *id_compute = new char[strlen(arg[5])+1];
|
||||||
strcpy(id_compute,arg[5]);
|
strcpy(id_compute,arg[5]);
|
||||||
int seed = atoi(arg[6]);
|
int seed = force->inumeric(FLERR,arg[6]);
|
||||||
|
|
||||||
options(narg-7,&arg[7]);
|
options(narg-7,&arg[7]);
|
||||||
|
|
||||||
|
|||||||
@ -91,12 +91,12 @@ void TAD::command(int narg, char **arg)
|
|||||||
|
|
||||||
if (narg < 7) error->universe_all(FLERR,"Illegal tad command");
|
if (narg < 7) error->universe_all(FLERR,"Illegal tad command");
|
||||||
|
|
||||||
nsteps = atoi(arg[0]);
|
nsteps = force->inumeric(FLERR,arg[0]);
|
||||||
t_event = atoi(arg[1]);
|
t_event = force->inumeric(FLERR,arg[1]);
|
||||||
templo = atof(arg[2]);
|
templo = force->numeric(FLERR,arg[2]);
|
||||||
temphi = atof(arg[3]);
|
temphi = force->numeric(FLERR,arg[3]);
|
||||||
delta_conf = atof(arg[4]);
|
delta_conf = force->numeric(FLERR,arg[4]);
|
||||||
tmax = atof(arg[5]);
|
tmax = force->numeric(FLERR,arg[5]);
|
||||||
|
|
||||||
char *id_compute = new char[strlen(arg[6])+1];
|
char *id_compute = new char[strlen(arg[6])+1];
|
||||||
strcpy(id_compute,arg[6]);
|
strcpy(id_compute,arg[6]);
|
||||||
|
|||||||
@ -70,20 +70,20 @@ void Temper::command(int narg, char **arg)
|
|||||||
if (narg != 6 && narg != 7)
|
if (narg != 6 && narg != 7)
|
||||||
error->universe_all(FLERR,"Illegal temper command");
|
error->universe_all(FLERR,"Illegal temper command");
|
||||||
|
|
||||||
int nsteps = atoi(arg[0]);
|
int nsteps = force->inumeric(FLERR,arg[0]);
|
||||||
nevery = atoi(arg[1]);
|
nevery = force->inumeric(FLERR,arg[1]);
|
||||||
double temp = atof(arg[2]);
|
double temp = force->numeric(FLERR,arg[2]);
|
||||||
|
|
||||||
for (whichfix = 0; whichfix < modify->nfix; whichfix++)
|
for (whichfix = 0; whichfix < modify->nfix; whichfix++)
|
||||||
if (strcmp(arg[3],modify->fix[whichfix]->id) == 0) break;
|
if (strcmp(arg[3],modify->fix[whichfix]->id) == 0) break;
|
||||||
if (whichfix == modify->nfix)
|
if (whichfix == modify->nfix)
|
||||||
error->universe_all(FLERR,"Tempering fix ID is not defined");
|
error->universe_all(FLERR,"Tempering fix ID is not defined");
|
||||||
|
|
||||||
seed_swap = atoi(arg[4]);
|
seed_swap = force->inumeric(FLERR,arg[4]);
|
||||||
seed_boltz = atoi(arg[5]);
|
seed_boltz = force->inumeric(FLERR,arg[5]);
|
||||||
|
|
||||||
my_set_temp = universe->iworld;
|
my_set_temp = universe->iworld;
|
||||||
if (narg == 7) my_set_temp = atoi(arg[6]);
|
if (narg == 7) my_set_temp = force->inumeric(FLERR,arg[6]);
|
||||||
|
|
||||||
// swap frequency must evenly divide total # of timesteps
|
// swap frequency must evenly divide total # of timesteps
|
||||||
|
|
||||||
|
|||||||
@ -612,7 +612,7 @@ void FixRigidNH::final_integrate()
|
|||||||
|
|
||||||
// sum over atoms to get force and torque on rigid body
|
// sum over atoms to get force and torque on rigid body
|
||||||
|
|
||||||
int *image = atom->image;
|
tagint *image = atom->image;
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double **f = atom->f;
|
double **f = atom->f;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|||||||
@ -60,7 +60,7 @@ extern "C" {
|
|||||||
|
|
||||||
typedef int bool_t;
|
typedef int bool_t;
|
||||||
|
|
||||||
#if defined(__MINGW32_VERSION)
|
#if defined(__MINGW32__)
|
||||||
typedef char * caddr_t;
|
typedef char * caddr_t;
|
||||||
typedef unsigned int u_int;
|
typedef unsigned int u_int;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -40,7 +40,7 @@ enum{DIAMETER,CHARGE};
|
|||||||
FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
|
FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
|
||||||
{
|
{
|
||||||
if (narg < 5) error->all(FLERR,"Illegal fix adapt command");
|
if (narg < 5) error->all(FLERR,"Illegal fix adapt command");
|
||||||
nevery = atoi(arg[3]);
|
nevery = force->inumeric(FLERR,arg[3]);
|
||||||
if (nevery < 0) error->all(FLERR,"Illegal fix adapt command");
|
if (nevery < 0) error->all(FLERR,"Illegal fix adapt command");
|
||||||
|
|
||||||
// count # of adaptations
|
// count # of adaptations
|
||||||
|
|||||||
@ -606,7 +606,7 @@ void Min::modify_params(int narg, char **arg)
|
|||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"dmax") == 0) {
|
if (strcmp(arg[iarg],"dmax") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
|
||||||
dmax = atof(arg[iarg+1]);
|
dmax = force->numeric(FLERR,arg[iarg+1]);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"line") == 0) {
|
} else if (strcmp(arg[iarg],"line") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
#include "finish.h"
|
#include "finish.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
@ -35,10 +36,10 @@ void Minimize::command(int narg, char **arg)
|
|||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all(FLERR,"Minimize command before simulation box is defined");
|
error->all(FLERR,"Minimize command before simulation box is defined");
|
||||||
|
|
||||||
update->etol = atof(arg[0]);
|
update->etol = force->numeric(FLERR,arg[0]);
|
||||||
update->ftol = atof(arg[1]);
|
update->ftol = force->numeric(FLERR,arg[1]);
|
||||||
update->nsteps = atoi(arg[2]);
|
update->nsteps = force->inumeric(FLERR,arg[2]);
|
||||||
update->max_eval = atoi(arg[3]);
|
update->max_eval = force->inumeric(FLERR,arg[3]);
|
||||||
|
|
||||||
if (update->etol < 0.0 || update->ftol < 0.0)
|
if (update->etol < 0.0 || update->ftol < 0.0)
|
||||||
error->all(FLERR,"Illegal minimize command");
|
error->all(FLERR,"Illegal minimize command");
|
||||||
|
|||||||
31
src/pair.cpp
31
src/pair.cpp
@ -127,23 +127,23 @@ void Pair::modify_params(int narg, char **arg)
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"table") == 0) {
|
} else if (strcmp(arg[iarg],"table") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
||||||
ncoultablebits = atoi(arg[iarg+1]);
|
ncoultablebits = force->inumeric(FLERR,arg[iarg+1]);
|
||||||
if (ncoultablebits > sizeof(float)*CHAR_BIT)
|
if (ncoultablebits > sizeof(float)*CHAR_BIT)
|
||||||
error->all(FLERR,"Too many total bits for bitmapped lookup table");
|
error->all(FLERR,"Too many total bits for bitmapped lookup table");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"table/disp") == 0) {
|
} else if (strcmp(arg[iarg],"table/disp") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
||||||
ndisptablebits = atoi(arg[iarg+1]);
|
ndisptablebits = force->inumeric(FLERR,arg[iarg+1]);
|
||||||
if (ndisptablebits > sizeof(float)*CHAR_BIT)
|
if (ndisptablebits > sizeof(float)*CHAR_BIT)
|
||||||
error->all(FLERR,"Too many total bits for bitmapped lookup table");
|
error->all(FLERR,"Too many total bits for bitmapped lookup table");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"tabinner") == 0) {
|
} else if (strcmp(arg[iarg],"tabinner") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
||||||
tabinner = atof(arg[iarg+1]);
|
tabinner = force->numeric(FLERR,arg[iarg+1]);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"tabinner/disp") == 0) {
|
} else if (strcmp(arg[iarg],"tabinner/disp") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
||||||
tabinner_disp = atof(arg[iarg+1]);
|
tabinner_disp = force->numeric(FLERR,arg[iarg+1]);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"tail") == 0) {
|
} else if (strcmp(arg[iarg],"tail") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
|
||||||
@ -1449,12 +1449,12 @@ void Pair::write_file(int narg, char **arg)
|
|||||||
|
|
||||||
// parse arguments
|
// parse arguments
|
||||||
|
|
||||||
int itype = atoi(arg[0]);
|
int itype = force->inumeric(FLERR,arg[0]);
|
||||||
int jtype = atoi(arg[1]);
|
int jtype = force->inumeric(FLERR,arg[1]);
|
||||||
if (itype < 1 || itype > atom->ntypes || jtype < 1 || jtype > atom->ntypes)
|
if (itype < 1 || itype > atom->ntypes || jtype < 1 || jtype > atom->ntypes)
|
||||||
error->all(FLERR,"Invalid atom types in pair_write command");
|
error->all(FLERR,"Invalid atom types in pair_write command");
|
||||||
|
|
||||||
int n = atoi(arg[2]);
|
int n = force->inumeric(FLERR,arg[2]);
|
||||||
|
|
||||||
int style;
|
int style;
|
||||||
if (strcmp(arg[3],"r") == 0) style = RLINEAR;
|
if (strcmp(arg[3],"r") == 0) style = RLINEAR;
|
||||||
@ -1462,8 +1462,8 @@ void Pair::write_file(int narg, char **arg)
|
|||||||
else if (strcmp(arg[3],"bitmap") == 0) style = BMP;
|
else if (strcmp(arg[3],"bitmap") == 0) style = BMP;
|
||||||
else error->all(FLERR,"Invalid style in pair_write command");
|
else error->all(FLERR,"Invalid style in pair_write command");
|
||||||
|
|
||||||
double inner = atof(arg[4]);
|
double inner = force->numeric(FLERR,arg[4]);
|
||||||
double outer = atof(arg[5]);
|
double outer = force->numeric(FLERR,arg[5]);
|
||||||
if (inner <= 0.0 || inner >= outer)
|
if (inner <= 0.0 || inner >= outer)
|
||||||
error->all(FLERR,"Invalid cutoffs in pair_write command");
|
error->all(FLERR,"Invalid cutoffs in pair_write command");
|
||||||
|
|
||||||
@ -1503,8 +1503,8 @@ void Pair::write_file(int narg, char **arg)
|
|||||||
double q[2];
|
double q[2];
|
||||||
q[0] = q[1] = 1.0;
|
q[0] = q[1] = 1.0;
|
||||||
if (narg == 10) {
|
if (narg == 10) {
|
||||||
q[0] = atof(arg[8]);
|
q[0] = force->numeric(FLERR,arg[8]);
|
||||||
q[1] = atof(arg[9]);
|
q[1] = force->numeric(FLERR,arg[9]);
|
||||||
}
|
}
|
||||||
double *q_hold;
|
double *q_hold;
|
||||||
|
|
||||||
@ -1623,6 +1623,8 @@ FILE *Pair::open_potential(const char *name)
|
|||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
|
if (name == NULL) return NULL;
|
||||||
|
|
||||||
// attempt to open file directly
|
// attempt to open file directly
|
||||||
// if successful, return ptr
|
// if successful, return ptr
|
||||||
|
|
||||||
@ -1635,10 +1637,12 @@ FILE *Pair::open_potential(const char *name)
|
|||||||
if (path == NULL) return NULL;
|
if (path == NULL) return NULL;
|
||||||
|
|
||||||
const char *pot = potname(name);
|
const char *pot = potname(name);
|
||||||
|
if (pot == NULL) return NULL;
|
||||||
|
|
||||||
size_t len1 = strlen(path);
|
size_t len1 = strlen(path);
|
||||||
size_t len2 = strlen(pot);
|
size_t len2 = strlen(pot);
|
||||||
|
char *newpath = new char[len1+len2+2];
|
||||||
|
|
||||||
char *newpath = new char[len1+len2];
|
|
||||||
strcpy(newpath,path);
|
strcpy(newpath,path);
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
newpath[len1] = '\\';
|
newpath[len1] = '\\';
|
||||||
@ -1662,6 +1666,8 @@ const char *Pair::potname(const char *path)
|
|||||||
{
|
{
|
||||||
const char *pot;
|
const char *pot;
|
||||||
|
|
||||||
|
if (path == NULL) return NULL;
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
// skip over the disk drive part of windows pathnames
|
// skip over the disk drive part of windows pathnames
|
||||||
if (isalpha(path[0]) && path[1] == ':')
|
if (isalpha(path[0]) && path[1] == ':')
|
||||||
@ -1687,3 +1693,4 @@ double Pair::memory_usage()
|
|||||||
bytes += comm->nthreads*maxvatom*6 * sizeof(double);
|
bytes += comm->nthreads*maxvatom*6 * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
#include "finish.h"
|
#include "finish.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
@ -80,12 +81,12 @@ void Rerun::command(int narg, char **arg)
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"every") == 0) {
|
} else if (strcmp(arg[iarg],"every") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command");
|
||||||
nevery = atoi(arg[iarg+1]);
|
nevery = force->inumeric(FLERR,arg[iarg+1]);
|
||||||
if (nevery < 0) error->all(FLERR,"Illegal rerun command");
|
if (nevery < 0) error->all(FLERR,"Illegal rerun command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"skip") == 0) {
|
} else if (strcmp(arg[iarg],"skip") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command");
|
||||||
nskip = atoi(arg[iarg+1]);
|
nskip = force->inumeric(FLERR,arg[iarg+1]);
|
||||||
if (nskip <= 0) error->all(FLERR,"Illegal rerun command");
|
if (nskip <= 0) error->all(FLERR,"Illegal rerun command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"start") == 0) {
|
} else if (strcmp(arg[iarg],"start") == 0) {
|
||||||
|
|||||||
@ -46,13 +46,13 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
|
|||||||
{
|
{
|
||||||
if (narg < 1) error->all(FLERR,"Illegal run_style respa command");
|
if (narg < 1) error->all(FLERR,"Illegal run_style respa command");
|
||||||
|
|
||||||
nlevels = atoi(arg[0]);
|
nlevels = force->inumeric(FLERR,arg[0]);
|
||||||
if (nlevels < 1) error->all(FLERR,"Respa levels must be >= 1");
|
if (nlevels < 1) error->all(FLERR,"Respa levels must be >= 1");
|
||||||
|
|
||||||
if (narg < nlevels) error->all(FLERR,"Illegal run_style respa command");
|
if (narg < nlevels) error->all(FLERR,"Illegal run_style respa command");
|
||||||
loop = new int[nlevels];
|
loop = new int[nlevels];
|
||||||
for (int iarg = 1; iarg < nlevels; iarg++) {
|
for (int iarg = 1; iarg < nlevels; iarg++) {
|
||||||
loop[iarg-1] = atoi(arg[iarg]);
|
loop[iarg-1] = force->inumeric(FLERR,arg[iarg]);
|
||||||
if (loop[iarg-1] <= 0) error->all(FLERR,"Illegal run_style respa command");
|
if (loop[iarg-1] <= 0) error->all(FLERR,"Illegal run_style respa command");
|
||||||
}
|
}
|
||||||
loop[nlevels-1] = 1;
|
loop[nlevels-1] = 1;
|
||||||
@ -68,43 +68,43 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
|
|||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"bond") == 0) {
|
if (strcmp(arg[iarg],"bond") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_bond = atoi(arg[iarg+1]) - 1;
|
level_bond = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"angle") == 0) {
|
} else if (strcmp(arg[iarg],"angle") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_angle = atoi(arg[iarg+1]) - 1;
|
level_angle = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"dihedral") == 0) {
|
} else if (strcmp(arg[iarg],"dihedral") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_dihedral = atoi(arg[iarg+1]) - 1;
|
level_dihedral = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"improper") == 0) {
|
} else if (strcmp(arg[iarg],"improper") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_improper = atoi(arg[iarg+1]) - 1;
|
level_improper = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"pair") == 0) {
|
} else if (strcmp(arg[iarg],"pair") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_pair = atoi(arg[iarg+1]) - 1;
|
level_pair = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"inner") == 0) {
|
} else if (strcmp(arg[iarg],"inner") == 0) {
|
||||||
if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_inner = atoi(arg[iarg+1]) - 1;
|
level_inner = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
cutoff[0] = atof(arg[iarg+2]);
|
cutoff[0] = force->numeric(FLERR,arg[iarg+2]);
|
||||||
cutoff[1] = atof(arg[iarg+3]);
|
cutoff[1] = force->numeric(FLERR,arg[iarg+3]);
|
||||||
iarg += 4;
|
iarg += 4;
|
||||||
} else if (strcmp(arg[iarg],"middle") == 0) {
|
} else if (strcmp(arg[iarg],"middle") == 0) {
|
||||||
if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_middle = atoi(arg[iarg+1]) - 1;
|
level_middle = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
cutoff[2] = atof(arg[iarg+2]);
|
cutoff[2] = force->numeric(FLERR,arg[iarg+2]);
|
||||||
cutoff[3] = atof(arg[iarg+3]);
|
cutoff[3] = force->numeric(FLERR,arg[iarg+3]);
|
||||||
iarg += 4;
|
iarg += 4;
|
||||||
} else if (strcmp(arg[iarg],"outer") == 0) {
|
} else if (strcmp(arg[iarg],"outer") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_outer = atoi(arg[iarg+1]) - 1;
|
level_outer = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"kspace") == 0) {
|
} else if (strcmp(arg[iarg],"kspace") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command");
|
||||||
level_kspace = atoi(arg[iarg+1]) - 1;
|
level_kspace = force->inumeric(FLERR,arg[iarg+1]) - 1;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal run_style respa command");
|
} else error->all(FLERR,"Illegal run_style respa command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
@ -90,7 +91,7 @@ void Run::command(int narg, char **arg)
|
|||||||
|
|
||||||
} else if (strcmp(arg[iarg],"every") == 0) {
|
} else if (strcmp(arg[iarg],"every") == 0) {
|
||||||
if (iarg+3 > narg) error->all(FLERR,"Illegal run command");
|
if (iarg+3 > narg) error->all(FLERR,"Illegal run command");
|
||||||
nevery = atoi(arg[iarg+1]);
|
nevery = force->inumeric(FLERR,arg[iarg+1]);
|
||||||
if (nevery <= 0) error->all(FLERR,"Illegal run command");
|
if (nevery <= 0) error->all(FLERR,"Illegal run command");
|
||||||
first = iarg+2;
|
first = iarg+2;
|
||||||
last = narg-1;
|
last = narg-1;
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
#include "universe.h"
|
#include "universe.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
@ -77,7 +78,7 @@ void Universe::reorder(char *style, char *arg)
|
|||||||
if (uworld != uorig) MPI_Comm_free(&uworld);
|
if (uworld != uorig) MPI_Comm_free(&uworld);
|
||||||
|
|
||||||
if (strcmp(style,"nth") == 0) {
|
if (strcmp(style,"nth") == 0) {
|
||||||
int n = atoi(arg);
|
int n = force->inumeric(FLERR,arg);
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
error->universe_all(FLERR,"Invalid -reorder N value");
|
error->universe_all(FLERR,"Invalid -reorder N value");
|
||||||
if (nprocs % n)
|
if (nprocs % n)
|
||||||
|
|||||||
Reference in New Issue
Block a user