forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9913 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
3452583172
commit
db8eda0253
|
@ -1,6 +1,6 @@
|
|||
# Update package files in LAMMPS
|
||||
# cp package file to src if doesn't exist or is different
|
||||
# do not copy gayberne files if non-GPU version does not exist
|
||||
# do not copy dependent files if non-GPU version does not exist
|
||||
|
||||
for file in *.cpp *.h; do
|
||||
if (test $file = pair_gayberne_gpu.cpp -a ! -e ../pair_gayberne.cpp) then
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Update package files in LAMMPS
|
||||
# cp package file to src if doesn't exist or is different
|
||||
# do not copy eam and charmm files if non-OPT versions do not exist
|
||||
# do not copy dependent files if non-OPT versions do not exist
|
||||
|
||||
for file in *.cpp *.h; do
|
||||
if (test $file = pair_eam_opt.cpp -a ! -e ../pair_eam.cpp) then
|
||||
|
|
|
@ -421,12 +421,11 @@ void PairPeriLPS::init_style()
|
|||
{
|
||||
// error checks
|
||||
|
||||
if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri");
|
||||
if (!atom->peri_flag)
|
||||
error->all(FLERR,"Pair style peri requires atom style peri");
|
||||
if (atom->map_style == 0)
|
||||
error->all(FLERR,"Pair peri requires an atom map, see atom_modify");
|
||||
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Pair peri requires a lattice be defined");
|
||||
if (domain->lattice->xlattice != domain->lattice->ylattice ||
|
||||
domain->lattice->xlattice != domain->lattice->zlattice ||
|
||||
domain->lattice->ylattice != domain->lattice->zlattice)
|
||||
|
|
|
@ -359,12 +359,11 @@ void PairPeriPMB::init_style()
|
|||
{
|
||||
// error checks
|
||||
|
||||
if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri");
|
||||
if (!atom->peri_flag)
|
||||
error->all(FLERR,"Pair style peri requires atom style peri");
|
||||
if (atom->map_style == 0)
|
||||
error->all(FLERR,"Pair peri requires an atom map, see atom_modify");
|
||||
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Pair peri requires a lattice be defined");
|
||||
if (domain->lattice->xlattice != domain->lattice->ylattice ||
|
||||
domain->lattice->xlattice != domain->lattice->zlattice ||
|
||||
domain->lattice->ylattice != domain->lattice->zlattice)
|
||||
|
|
|
@ -60,7 +60,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
|
|||
randomx = NULL;
|
||||
randomt = NULL;
|
||||
|
||||
if (!domain->lattice)
|
||||
if (domain->lattice->nbasis == 0)
|
||||
error->all(FLERR,"Fix append/atoms requires a lattice be defined");
|
||||
|
||||
nbasis = domain->lattice->nbasis;
|
||||
|
@ -126,12 +126,10 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
|
|||
iarg += 3;
|
||||
} else if (strcmp(arg[iarg],"basis") == 0) {
|
||||
if (iarg+3 > narg) error->all(FLERR,"Illegal fix append/atoms command");
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Fix append/atoms requires a lattice be defined");
|
||||
int ibasis = atoi(arg[iarg+1]);
|
||||
int itype = atoi(arg[iarg+2]);
|
||||
if (ibasis <= 0 || ibasis > nbasis || itype <= 0 || itype > atom->ntypes)
|
||||
error->all(FLERR,"Illegal fix append/atoms command");
|
||||
error->all(FLERR,"Invalid basis setting in fix append/atoms command");
|
||||
basistype[ibasis-1] = itype;
|
||||
iarg += 3;
|
||||
} else if (strcmp(arg[iarg],"size") == 0) {
|
||||
|
@ -184,9 +182,6 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// setup scaling
|
||||
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix append/atoms with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -140,9 +140,6 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// setup scaling
|
||||
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix wall/piston with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -127,9 +127,6 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
|
|||
if (wallstyle[m] == CONSTANT) flag = 1;
|
||||
|
||||
if (flag) {
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix wall with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Update package files in LAMMPS
|
||||
# copy package file to src if it doesn't exists or is different
|
||||
|
||||
for file in molfile_interface.cpp molfile_interface.h molfile_plugin.h \
|
||||
dump_molfile.cpp dump_molfile.h reader_molfile.h reader_molfile.cpp \
|
||||
vmdplugin.h ; do \
|
||||
|
|
|
@ -185,9 +185,6 @@ void ChangeBox::command(int narg, char **arg)
|
|||
for (int i = 0; i < nops; i++)
|
||||
if (ops[i].style == FINAL || ops[i].style == DELTA) flag = 1;
|
||||
|
||||
if (flag && scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of change_box with undefined lattice");
|
||||
|
||||
if (flag && scaleflag) {
|
||||
scale[0] = domain->lattice->xlattice;
|
||||
scale[1] = domain->lattice->ylattice;
|
||||
|
|
|
@ -59,9 +59,6 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// setup scaling
|
||||
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of compute temp/ramp with undefined lattice");
|
||||
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
yscale = domain->lattice->ylattice;
|
||||
|
|
|
@ -91,22 +91,18 @@ void CreateAtoms::command(int narg, char **arg)
|
|||
int scaleflag = 1;
|
||||
remapflag = 0;
|
||||
|
||||
if (domain->lattice) {
|
||||
nbasis = domain->lattice->nbasis;
|
||||
basistype = new int[nbasis];
|
||||
for (int i = 0; i < nbasis; i++) basistype[i] = itype;
|
||||
}
|
||||
nbasis = domain->lattice->nbasis;
|
||||
basistype = new int[nbasis];
|
||||
for (int i = 0; i < nbasis; i++) basistype[i] = itype;
|
||||
|
||||
while (iarg < narg) {
|
||||
if (strcmp(arg[iarg],"basis") == 0) {
|
||||
if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Cannot create atoms with undefined lattice");
|
||||
int ibasis = atoi(arg[iarg+1]);
|
||||
itype = atoi(arg[iarg+2]);
|
||||
if (ibasis <= 0 || ibasis > nbasis ||
|
||||
itype <= 0 || itype > atom->ntypes)
|
||||
error->all(FLERR,"Illegal create_atoms command");
|
||||
error->all(FLERR,"Invalid basis setting in create_atoms command");
|
||||
basistype[ibasis-1] = itype;
|
||||
iarg += 3;
|
||||
} else if (strcmp(arg[iarg],"remap") == 0) {
|
||||
|
@ -131,18 +127,16 @@ void CreateAtoms::command(int narg, char **arg)
|
|||
if (seed <= 0) error->all(FLERR,"Illegal create_atoms command");
|
||||
}
|
||||
|
||||
// demand lattice be defined
|
||||
// else setup scaling for single atom
|
||||
// demand non-none lattice be defined for BOX and REGION
|
||||
// else setup scaling for SINGLE and RANDOM
|
||||
// could use domain->lattice->lattice2box() to do conversion of
|
||||
// lattice to box, but not consistent with other uses of units=lattice
|
||||
// triclinic remapping occurs in add_single()
|
||||
|
||||
if (style == BOX || style == REGION) {
|
||||
if (domain->lattice == NULL)
|
||||
if (nbasis == 0)
|
||||
error->all(FLERR,"Cannot create atoms with undefined lattice");
|
||||
} else if (scaleflag == 1) {
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Cannot create atoms with undefined lattice");
|
||||
xone[0] *= domain->lattice->xlattice;
|
||||
xone[1] *= domain->lattice->ylattice;
|
||||
xone[2] *= domain->lattice->zlattice;
|
||||
|
|
|
@ -77,9 +77,6 @@ void DisplaceAtoms::command(int narg, char **arg)
|
|||
|
||||
// setup scaling
|
||||
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of displace_atoms with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -85,6 +85,11 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp)
|
|||
boxhi_lamda[0] = boxhi_lamda[1] = boxhi_lamda[2] = 1.0;
|
||||
|
||||
lattice = NULL;
|
||||
char **args = new char*[2];
|
||||
args[0] = (char *) "none";
|
||||
args[1] = (char *) "1.0";
|
||||
set_lattice(2,args);
|
||||
|
||||
nregion = maxregion = 0;
|
||||
regions = NULL;
|
||||
}
|
||||
|
@ -1229,17 +1234,12 @@ void Domain::image_flip(int m, int n, int p)
|
|||
|
||||
/* ----------------------------------------------------------------------
|
||||
create a lattice
|
||||
delete it if style = none
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Domain::set_lattice(int narg, char **arg)
|
||||
{
|
||||
if (lattice) delete lattice;
|
||||
lattice = new Lattice(lmp,narg,arg);
|
||||
if (lattice->style == 0) {
|
||||
delete lattice;
|
||||
lattice = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
|
|
@ -340,9 +340,6 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
|
|||
error->all(FLERR,
|
||||
"Fix ave/spatial for triclinic boxes requires units reduced");
|
||||
|
||||
if (scaleflag == LATTICE && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix ave/spatial with undefined lattice");
|
||||
|
||||
if (scaleflag == LATTICE) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
yscale = domain->lattice->ylattice;
|
||||
|
|
|
@ -256,9 +256,6 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
|
|||
if (set[i].style == FINAL || set[i].style == DELTA ||
|
||||
set[i].style == VEL || set[i].style == WIGGLE) flag = 1;
|
||||
|
||||
if (flag && scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix deform with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (flag && scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -98,9 +98,6 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// setup scaling
|
||||
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix deposit with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -83,8 +83,6 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// setup scaling, based on xlattice parameter
|
||||
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix dt/reset with undefined lattice");
|
||||
if (scaleflag) xmax *= domain->lattice->xlattice;
|
||||
|
||||
// initializations
|
||||
|
|
|
@ -59,9 +59,6 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// setup scaling
|
||||
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix indent with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -192,9 +192,6 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
if ((mstyle == LINEAR || mstyle == WIGGLE || mstyle == ROTATE) &&
|
||||
scaleflag) {
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix move with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -75,9 +75,6 @@ FixRecenter::FixRecenter(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
// scale xcom,ycom,zcom
|
||||
|
||||
if (scaleflag == LATTICE && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix recenter with undefined lattice");
|
||||
|
||||
double xscale,yscale,zscale;
|
||||
if (scaleflag == LATTICE) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
|
|
|
@ -163,9 +163,6 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
|
|||
if (xstyle[m] != EDGE) flag = 1;
|
||||
|
||||
if (flag) {
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix wall with undefined lattice");
|
||||
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
yscale = domain->lattice->ylattice;
|
||||
|
|
|
@ -115,9 +115,6 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
|
|||
if (wallstyle[m] != EDGE) flag = 1;
|
||||
|
||||
if (flag) {
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of fix wall with undefined lattice");
|
||||
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
yscale = domain->lattice->ylattice;
|
||||
|
|
|
@ -51,7 +51,9 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
|
|||
else error->all(FLERR,"Illegal lattice command");
|
||||
|
||||
if (style == NONE) {
|
||||
if (narg > 1) error->all(FLERR,"Illegal lattice command");
|
||||
if (narg != 2) error->all(FLERR,"Illegal lattice command");
|
||||
xlattice = ylattice = zlattice = atof(arg[1]);
|
||||
if (xlattice <= 0.0) error->all(FLERR,"Illegal lattice command");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -368,9 +368,6 @@ void Region::options(int narg, char **arg)
|
|||
|
||||
// setup scaling
|
||||
|
||||
if (scaleflag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of region with undefined lattice");
|
||||
|
||||
if (scaleflag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
yscale = domain->lattice->ylattice;
|
||||
|
|
|
@ -741,16 +741,10 @@ void Thermo::parse_fields(char *str)
|
|||
addfield("Yz",&Thermo::compute_yz,FLOAT);
|
||||
|
||||
} else if (strcmp(word,"xlat") == 0) {
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Thermo keyword requires lattice be defined");
|
||||
addfield("Xlat",&Thermo::compute_xlat,FLOAT);
|
||||
} else if (strcmp(word,"ylat") == 0) {
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Thermo keyword requires lattice be defined");
|
||||
addfield("Ylat",&Thermo::compute_ylat,FLOAT);
|
||||
} else if (strcmp(word,"zlat") == 0) {
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Thermo keyword requires lattice be defined");
|
||||
addfield("Zlat",&Thermo::compute_zlat,FLOAT);
|
||||
|
||||
} else if (strcmp(word,"pxx") == 0) {
|
||||
|
@ -1245,16 +1239,10 @@ int Thermo::evaluate_keyword(char *word, double *answer)
|
|||
else if (strcmp(word,"yz") == 0) compute_yz();
|
||||
|
||||
else if (strcmp(word,"xlat") == 0) {
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
|
||||
compute_xlat();
|
||||
} else if (strcmp(word,"ylat") == 0) {
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
|
||||
compute_ylat();
|
||||
} else if (strcmp(word,"zlat") == 0) {
|
||||
if (domain->lattice == NULL)
|
||||
error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
|
||||
compute_zlat();
|
||||
|
||||
} else if (strcmp(word,"pxx") == 0) {
|
||||
|
|
|
@ -378,20 +378,14 @@ void Velocity::set(int narg, char **arg)
|
|||
xscale = yscale = zscale = 1.0;
|
||||
|
||||
if (xstyle && !xstr) {
|
||||
if (scale_flag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of velocity with undefined lattice");
|
||||
if (scale_flag) xscale = domain->lattice->xlattice;
|
||||
vx *= xscale;
|
||||
}
|
||||
if (ystyle && !ystr) {
|
||||
if (scale_flag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of velocity with undefined lattice");
|
||||
if (scale_flag) yscale = domain->lattice->ylattice;
|
||||
vy *= yscale;
|
||||
}
|
||||
if (zstyle && !zstr) {
|
||||
if (scale_flag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of velocity with undefined lattice");
|
||||
if (scale_flag) zscale = domain->lattice->zlattice;
|
||||
vz *= zscale;
|
||||
}
|
||||
|
@ -552,9 +546,6 @@ void Velocity::ramp(int narg, char **arg)
|
|||
{
|
||||
// set scale factors
|
||||
|
||||
if (scale_flag && domain->lattice == NULL)
|
||||
error->all(FLERR,"Use of velocity with undefined lattice");
|
||||
|
||||
if (scale_flag) {
|
||||
xscale = domain->lattice->xlattice;
|
||||
yscale = domain->lattice->ylattice;
|
||||
|
|
Loading…
Reference in New Issue