Merge pull request #1544 from akohlmey/collected-small-fixes
Collected small changes and bugfixes for the next patch release
This commit is contained in:
@ -57,8 +57,7 @@ Boolean expression is FALSE, then no commands are executed.
|
||||
The syntax for Boolean expressions is described below.
|
||||
|
||||
Each command (t1, f1, e1, etc) can be any valid LAMMPS input script
|
||||
command, except an "include"_include.html command, which is not
|
||||
allowed. If the command is more than one word, it must enclosed in
|
||||
command. If the command is more than one word, it must enclosed in
|
||||
quotes, so it will be treated as a single argument, as in the examples
|
||||
above.
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
if (mode == ROTATE) extra_dof = 0;
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ ComputeTempBody::ComputeTempBody(LAMMPS *lmp, int narg, char **arg) :
|
||||
} else error->all(FLERR,"Illegal compute temp/body command");
|
||||
}
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// allocate memory
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
maxatom = 0;
|
||||
vint = NULL;
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ void FixQEqShielded::init()
|
||||
|
||||
void FixQEqShielded::extract_reax()
|
||||
{
|
||||
Pair *pair = force->pair_match("reax/c",1);
|
||||
Pair *pair = force->pair_match("^reax/c",0);
|
||||
if (pair == NULL) error->all(FLERR,"No pair reax/c for fix qeq/shielded");
|
||||
int tmp;
|
||||
chi = (double *) pair->extract("chi",tmp);
|
||||
|
||||
@ -149,6 +149,6 @@ void ComputeSpin::compute_vector()
|
||||
|
||||
void ComputeSpin::allocate()
|
||||
{
|
||||
memory->create(vector,6,"compute/spin:vector");
|
||||
memory->create(vector,size_vector,"compute/spin:vector");
|
||||
}
|
||||
|
||||
|
||||
@ -106,9 +106,9 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
if (keflag && id_temp == NULL)
|
||||
error->all(FLERR,"Compute pressure/bocs requires temperature ID "
|
||||
"to include kinetic energy");
|
||||
"to include kinetic energy");
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
nvirial = 0;
|
||||
vptr = NULL;
|
||||
}
|
||||
@ -365,7 +365,7 @@ void ComputePressureBocs::compute_vector()
|
||||
|
||||
if (force->kspace && kspace_virial && force->kspace->scalar_pressure_flag)
|
||||
error->all(FLERR,"Must use 'kspace_modify pressure/scalar no' for "
|
||||
"tensor components with kspace_style msm");
|
||||
"tensor components with kspace_style msm");
|
||||
|
||||
// invoke temperature if it hasn't been already
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ ComputeTempDrude::ComputeTempDrude(LAMMPS *lmp, int narg, char **arg) :
|
||||
extlist[2] = extlist[3] = extlist[4] = extlist[5] = 1;
|
||||
tempflag = 0; // because does not compute a single temperature (scalar and vector)
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
fix_drude = NULL;
|
||||
id_temp = NULL;
|
||||
temperature = NULL;
|
||||
|
||||
@ -54,7 +54,7 @@ ComputeTempDeformEff::ComputeTempDeformEff(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
maxbias = 0;
|
||||
vbiasall = NULL;
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -58,7 +58,7 @@ ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
maxbias = 0;
|
||||
vbiasall = NULL;
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -53,7 +53,7 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) :
|
||||
size_vector = 3;
|
||||
extvector = 0;
|
||||
|
||||
vector = new double[3];
|
||||
vector = new double[size_vector];
|
||||
|
||||
fepinitflag = 0; // avoid init to run entirely when called by write_data
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ ComputeTempRotate::ComputeTempRotate(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
maxbias = 0;
|
||||
vbiasall = NULL;
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -124,7 +124,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) :
|
||||
// register with Atom class
|
||||
|
||||
reaxc = NULL;
|
||||
reaxc = (PairReaxC *) force->pair_match("reax/c",0);
|
||||
reaxc = (PairReaxC *) force->pair_match("^reax/c",0);
|
||||
|
||||
s_hist = t_hist = NULL;
|
||||
grow_arrays(atom->nmax);
|
||||
|
||||
@ -29,7 +29,7 @@ ComputeCOM::ComputeCOM(LAMMPS *lmp, int narg, char **arg) :
|
||||
size_vector = 3;
|
||||
extvector = 0;
|
||||
|
||||
vector = new double[3];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -105,7 +105,7 @@ ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) :
|
||||
} else error->all(FLERR,"Illegal compute group/group command");
|
||||
}
|
||||
|
||||
vector = new double[3];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -33,7 +33,7 @@ ComputeGyration::ComputeGyration(LAMMPS *lmp, int narg, char **arg) :
|
||||
extscalar = 0;
|
||||
extvector = 0;
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -70,7 +70,7 @@ ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) :
|
||||
error->all(FLERR,
|
||||
"Compute heat/flux compute ID does not compute stress/atom");
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -115,7 +115,7 @@ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// displacement vector
|
||||
|
||||
vector = new double[4];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -101,7 +101,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
|
||||
error->all(FLERR,"Compute pressure requires temperature ID "
|
||||
"to include kinetic energy");
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
nvirial = 0;
|
||||
vptr = NULL;
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ ComputeTemp::ComputeTemp(LAMMPS *lmp, int narg, char **arg) :
|
||||
extvector = 1;
|
||||
tempflag = 1;
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -125,7 +125,7 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// vector data
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
|
||||
// chunk-based data
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ ComputeTempCOM::ComputeTempCOM(LAMMPS *lmp, int narg, char **arg) :
|
||||
tempflag = 1;
|
||||
tempbias = 1;
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -48,7 +48,7 @@ ComputeTempDeform::ComputeTempDeform(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
maxbias = 0;
|
||||
vbiasall = NULL;
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -49,7 +49,7 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
maxbias = 0;
|
||||
vbiasall = NULL;
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -101,7 +101,7 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
maxbias = 0;
|
||||
vbiasall = NULL;
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -49,7 +49,7 @@ ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
maxbias = 0;
|
||||
vbiasall = NULL;
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -72,7 +72,7 @@ ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
if (mode == ROTATE) extra_dof = 0;
|
||||
|
||||
vector = new double[6];
|
||||
vector = new double[size_vector];
|
||||
|
||||
// error checks
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// displacement vector
|
||||
|
||||
vector = new double[4];
|
||||
vector = new double[size_vector];
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -82,7 +82,6 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp)
|
||||
label_active = 0;
|
||||
labelstr = NULL;
|
||||
jump_skip = 0;
|
||||
ifthenelse_flag = 0;
|
||||
|
||||
if (me == 0) {
|
||||
nfile = 1;
|
||||
@ -959,11 +958,10 @@ void Input::ifthenelse()
|
||||
ncommands++;
|
||||
}
|
||||
|
||||
ifthenelse_flag = 1;
|
||||
for (int i = 0; i < ncommands; i++) one(commands[i]);
|
||||
ifthenelse_flag = 0;
|
||||
|
||||
for (int i = 0; i < ncommands; i++) delete [] commands[i];
|
||||
for (int i = 0; i < ncommands; i++) {
|
||||
one(commands[i]);
|
||||
delete [] commands[i];
|
||||
}
|
||||
delete [] commands;
|
||||
|
||||
return;
|
||||
@ -1015,13 +1013,10 @@ void Input::ifthenelse()
|
||||
|
||||
// execute the list of commands
|
||||
|
||||
ifthenelse_flag = 1;
|
||||
for (int i = 0; i < ncommands; i++) one(commands[i]);
|
||||
ifthenelse_flag = 0;
|
||||
|
||||
// clean up
|
||||
|
||||
for (int i = 0; i < ncommands; i++) delete [] commands[i];
|
||||
for (int i = 0; i < ncommands; i++) {
|
||||
one(commands[i]);
|
||||
delete [] commands[i];
|
||||
}
|
||||
delete [] commands;
|
||||
|
||||
return;
|
||||
@ -1034,13 +1029,6 @@ void Input::include()
|
||||
{
|
||||
if (narg != 1) error->all(FLERR,"Illegal include command");
|
||||
|
||||
// do not allow include inside an if command
|
||||
// NOTE: this check will fail if a 2nd if command was inside the if command
|
||||
// and came before the include
|
||||
|
||||
if (ifthenelse_flag)
|
||||
error->all(FLERR,"Cannot use include command within an if command");
|
||||
|
||||
if (me == 0) {
|
||||
if (nfile == maxfile)
|
||||
error->one(FLERR,"Too many nested levels of input scripts");
|
||||
|
||||
@ -54,7 +54,6 @@ class Input : protected Pointers {
|
||||
int label_active; // 0 = no label, 1 = looking for label
|
||||
char *labelstr; // label string being looked for
|
||||
int jump_skip; // 1 if skipping next jump, 0 otherwise
|
||||
int ifthenelse_flag; // 1 if executing commands inside an if-then-else
|
||||
|
||||
FILE **infiles; // list of open input files
|
||||
|
||||
|
||||
@ -406,8 +406,9 @@ void Thermo::compute(int flag)
|
||||
call function to compute property
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::call_vfunc(int ifield)
|
||||
void Thermo::call_vfunc(int ifield_in)
|
||||
{
|
||||
ifield = ifield_in;
|
||||
(this->*vfunc[ifield])();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user