apply utils::logical() in more places
This commit is contained in:
@ -312,32 +312,26 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
tmp_name = nullptr;
|
tmp_name = nullptr;
|
||||||
|
|
||||||
/* parse optional arguments */
|
/* parse optional arguments */
|
||||||
int argsdone = 4;
|
int iarg = 4;
|
||||||
while (argsdone < narg) {
|
while (iarg < narg) {
|
||||||
// we have keyword/value pairs. check if value is missing
|
// we have keyword/value pairs. check if value is missing
|
||||||
if (argsdone+1 == narg)
|
if (iarg+1 == narg)
|
||||||
error->all(FLERR,"Missing argument to keyword");
|
error->all(FLERR,"Missing argument to keyword");
|
||||||
|
|
||||||
if (0 == strcmp(arg[argsdone], "input")) {
|
if (0 == strcmp(arg[iarg], "input")) {
|
||||||
inp_name = strdup(arg[argsdone+1]);
|
inp_name = strdup(arg[iarg+1]);
|
||||||
} else if (0 == strcmp(arg[argsdone], "output")) {
|
} else if (0 == strcmp(arg[iarg], "output")) {
|
||||||
out_name = strdup(arg[argsdone+1]);
|
out_name = strdup(arg[iarg+1]);
|
||||||
} else if (0 == strcmp(arg[argsdone], "seed")) {
|
} else if (0 == strcmp(arg[iarg], "seed")) {
|
||||||
rng_seed = utils::inumeric(FLERR,arg[argsdone+1],false,lmp);
|
rng_seed = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
|
||||||
} else if (0 == strcmp(arg[argsdone], "unwrap")) {
|
} else if (0 == strcmp(arg[iarg], "unwrap")) {
|
||||||
if (0 == strcmp(arg[argsdone+1], "yes")) {
|
unwrap_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
unwrap_flag = 1;
|
} else if (0 == strcmp(arg[iarg], "tstat")) {
|
||||||
} else if (0 == strcmp(arg[argsdone+1], "no")) {
|
tmp_name = strdup(arg[iarg+1]);
|
||||||
unwrap_flag = 0;
|
|
||||||
} else {
|
|
||||||
error->all(FLERR,"Incorrect fix colvars unwrap flag");
|
|
||||||
}
|
|
||||||
} else if (0 == strcmp(arg[argsdone], "tstat")) {
|
|
||||||
tmp_name = strdup(arg[argsdone+1]);
|
|
||||||
} else {
|
} else {
|
||||||
error->all(FLERR,"Unknown fix colvars parameter");
|
error->all(FLERR,"Unknown fix colvars parameter");
|
||||||
}
|
}
|
||||||
++argsdone; ++argsdone;
|
++iarg; ++iarg;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!out_name) out_name = strdup("out");
|
if (!out_name) out_name = strdup("out");
|
||||||
|
|||||||
@ -188,17 +188,11 @@ int DumpAtomZstd::modify_param(int narg, char **arg)
|
|||||||
try {
|
try {
|
||||||
if (strcmp(arg[0], "checksum") == 0) {
|
if (strcmp(arg[0], "checksum") == 0) {
|
||||||
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
if (strcmp(arg[1], "yes") == 0)
|
writer.setChecksum(utils::logical(FLERR, arg[1], false, lmp) == 1);
|
||||||
writer.setChecksum(true);
|
|
||||||
else if (strcmp(arg[1], "no") == 0)
|
|
||||||
writer.setChecksum(false);
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal dump_modify command");
|
|
||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[0], "compression_level") == 0) {
|
} else if (strcmp(arg[0], "compression_level") == 0) {
|
||||||
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
|
writer.setCompressionLevel(utils::inumeric(FLERR, arg[1], false, lmp));
|
||||||
writer.setCompressionLevel(compression_level);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
} catch (FileWriterException &e) {
|
} catch (FileWriterException &e) {
|
||||||
|
|||||||
@ -233,17 +233,11 @@ int DumpCFGZstd::modify_param(int narg, char **arg)
|
|||||||
try {
|
try {
|
||||||
if (strcmp(arg[0], "checksum") == 0) {
|
if (strcmp(arg[0], "checksum") == 0) {
|
||||||
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
if (strcmp(arg[1], "yes") == 0)
|
writer.setChecksum(utils::logical(FLERR, arg[1], false, lmp) == 1);
|
||||||
writer.setChecksum(true);
|
|
||||||
else if (strcmp(arg[1], "no") == 0)
|
|
||||||
writer.setChecksum(false);
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal dump_modify command");
|
|
||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[0], "compression_level") == 0) {
|
} else if (strcmp(arg[0], "compression_level") == 0) {
|
||||||
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
|
writer.setCompressionLevel(utils::inumeric(FLERR, arg[1], false, lmp));
|
||||||
writer.setCompressionLevel(compression_level);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
} catch (FileWriterException &e) {
|
} catch (FileWriterException &e) {
|
||||||
|
|||||||
@ -203,16 +203,13 @@ int DumpCustomZstd::modify_param(int narg, char **arg)
|
|||||||
int consumed = DumpCustom::modify_param(narg, arg);
|
int consumed = DumpCustom::modify_param(narg, arg);
|
||||||
if (consumed == 0) {
|
if (consumed == 0) {
|
||||||
try {
|
try {
|
||||||
if (strcmp(arg[0],"checksum") == 0) {
|
if (strcmp(arg[0], "checksum") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
if (strcmp(arg[1],"yes") == 0) writer.setChecksum(true);
|
writer.setChecksum(utils::logical(FLERR, arg[1], false, lmp) == 1);
|
||||||
else if (strcmp(arg[1],"no") == 0) writer.setChecksum(false);
|
|
||||||
else error->all(FLERR,"Illegal dump_modify command");
|
|
||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[0],"compression_level") == 0) {
|
} else if (strcmp(arg[0], "compression_level") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
|
writer.setCompressionLevel(utils::inumeric(FLERR, arg[1], false, lmp));
|
||||||
writer.setCompressionLevel(compression_level);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
} catch (FileWriterException &e) {
|
} catch (FileWriterException &e) {
|
||||||
|
|||||||
@ -190,17 +190,11 @@ int DumpLocalZstd::modify_param(int narg, char **arg)
|
|||||||
try {
|
try {
|
||||||
if (strcmp(arg[0], "checksum") == 0) {
|
if (strcmp(arg[0], "checksum") == 0) {
|
||||||
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
if (strcmp(arg[1], "yes") == 0)
|
writer.setChecksum(utils::logical(FLERR, arg[1], false, lmp) == 1);
|
||||||
writer.setChecksum(true);
|
|
||||||
else if (strcmp(arg[1], "no") == 0)
|
|
||||||
writer.setChecksum(false);
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal dump_modify command");
|
|
||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[0], "compression_level") == 0) {
|
} else if (strcmp(arg[0], "compression_level") == 0) {
|
||||||
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
|
writer.setCompressionLevel(utils::inumeric(FLERR, arg[1], false, lmp));
|
||||||
writer.setCompressionLevel(compression_level);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
} catch (FileWriterException &e) {
|
} catch (FileWriterException &e) {
|
||||||
|
|||||||
@ -156,17 +156,11 @@ int DumpXYZZstd::modify_param(int narg, char **arg)
|
|||||||
try {
|
try {
|
||||||
if (strcmp(arg[0], "checksum") == 0) {
|
if (strcmp(arg[0], "checksum") == 0) {
|
||||||
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
if (strcmp(arg[1], "yes") == 0)
|
writer.setChecksum(utils::logical(FLERR, arg[1], false, lmp) == 1);
|
||||||
writer.setChecksum(true);
|
|
||||||
else if (strcmp(arg[1], "no") == 0)
|
|
||||||
writer.setChecksum(false);
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal dump_modify command");
|
|
||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[0], "compression_level") == 0) {
|
} else if (strcmp(arg[0], "compression_level") == 0) {
|
||||||
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR, "Illegal dump_modify command");
|
||||||
int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
|
writer.setCompressionLevel(utils::inumeric(FLERR, arg[1], false, lmp));
|
||||||
writer.setCompressionLevel(compression_level);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
} catch (FileWriterException &e) {
|
} catch (FileWriterException &e) {
|
||||||
|
|||||||
@ -796,12 +796,7 @@ int FixPolarizeBEMGMRES::modify_param(int narg, char **arg)
|
|||||||
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 fix_modify command");
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
|
||||||
if (strcmp(arg[iarg + 1], "yes") == 0)
|
kspaceflag = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
kspaceflag = 1;
|
|
||||||
else if (strcmp(arg[iarg + 1], "no") == 0)
|
|
||||||
kspaceflag = 0;
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal fix_modify command for fix polarize");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "dielectrics") == 0) {
|
} else if (strcmp(arg[iarg], "dielectrics") == 0) {
|
||||||
if (iarg + 6 > narg) error->all(FLERR, "Illegal fix_modify command");
|
if (iarg + 6 > narg) error->all(FLERR, "Illegal fix_modify command");
|
||||||
|
|||||||
@ -355,12 +355,7 @@ int FixPolarizeBEMICC::modify_param(int narg, char **arg)
|
|||||||
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 fix_modify command");
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
|
||||||
if (strcmp(arg[iarg + 1], "yes") == 0)
|
kspaceflag = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
kspaceflag = 1;
|
|
||||||
else if (strcmp(arg[iarg + 1], "no") == 0)
|
|
||||||
kspaceflag = 0;
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal fix_modify command for fix polarize");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "dielectrics") == 0) {
|
} else if (strcmp(arg[iarg], "dielectrics") == 0) {
|
||||||
if (iarg + 6 > narg) error->all(FLERR, "Illegal fix_modify command");
|
if (iarg + 6 > narg) error->all(FLERR, "Illegal fix_modify command");
|
||||||
|
|||||||
@ -478,12 +478,7 @@ int FixPolarizeFunctional::modify_param(int narg, char **arg)
|
|||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg], "kspace") == 0) {
|
if (strcmp(arg[iarg], "kspace") == 0) {
|
||||||
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
|
||||||
if (strcmp(arg[iarg + 1], "yes") == 0)
|
kspaceflag = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
kspaceflag = 1;
|
|
||||||
else if (strcmp(arg[iarg + 1], "no") == 0)
|
|
||||||
kspaceflag = 0;
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal fix_modify command for fix polarize/functional");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "dielectrics") == 0) {
|
} else if (strcmp(arg[iarg], "dielectrics") == 0) {
|
||||||
if (iarg + 6 > narg) error->all(FLERR, "Illegal fix_modify command");
|
if (iarg + 6 > narg) error->all(FLERR, "Illegal fix_modify command");
|
||||||
|
|||||||
@ -91,9 +91,7 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"zero") == 0) {
|
if (strcmp(arg[iarg],"zero") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin/drude command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin/drude command");
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) zero = 0;
|
zero = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) zero = 1;
|
|
||||||
else error->all(FLERR,"Illegal fix langevin/drude command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix langevin/drude command");
|
} else error->all(FLERR,"Illegal fix langevin/drude command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -256,9 +256,7 @@ FixTGNHDrude::FixTGNHDrude(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"mtk") == 0) {
|
} else if (strcmp(arg[iarg],"mtk") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1;
|
mtk_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"tloop") == 0) {
|
} else if (strcmp(arg[iarg],"tloop") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
||||||
@ -277,27 +275,19 @@ FixTGNHDrude::FixTGNHDrude(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"scalexy") == 0) {
|
} else if (strcmp(arg[iarg],"scalexy") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) scalexy = 1;
|
scalexy = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) scalexy = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"scalexz") == 0) {
|
} else if (strcmp(arg[iarg],"scalexz") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) scalexz = 1;
|
scalexz = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) scalexz = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"scaleyz") == 0) {
|
} else if (strcmp(arg[iarg],"scaleyz") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) scaleyz = 1;
|
scaleyz = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) scaleyz = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"flip") == 0) {
|
} else if (strcmp(arg[iarg],"flip") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) flipflag = 1;
|
flipflag = utils::logical(FLERR, arg[iarg + 1], false, lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) flipflag = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"fixedpoint") == 0) {
|
} else if (strcmp(arg[iarg],"fixedpoint") == 0) {
|
||||||
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
|
||||||
|
|||||||
@ -17,21 +17,23 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "compute_entropy_atom.h"
|
#include "compute_entropy_atom.h"
|
||||||
#include <cmath>
|
|
||||||
#include <cstring>
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "update.h"
|
|
||||||
#include "modify.h"
|
|
||||||
#include "neighbor.h"
|
|
||||||
#include "neigh_list.h"
|
|
||||||
#include "neigh_request.h"
|
|
||||||
#include "force.h"
|
|
||||||
#include "pair.h"
|
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
|
#include "domain.h"
|
||||||
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
#include "math_const.h"
|
#include "math_const.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "modify.h"
|
||||||
#include "domain.h"
|
#include "neigh_list.h"
|
||||||
|
#include "neigh_request.h"
|
||||||
|
#include "neighbor.h"
|
||||||
|
#include "pair.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace MathConst;
|
using namespace MathConst;
|
||||||
@ -44,8 +46,7 @@ ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
pair_entropy(nullptr), pair_entropy_avg(nullptr)
|
pair_entropy(nullptr), pair_entropy_avg(nullptr)
|
||||||
{
|
{
|
||||||
if (narg < 5 || narg > 10)
|
if (narg < 5 || narg > 10)
|
||||||
error->all(FLERR,"Illegal compute entropy/atom command; wrong number"
|
error->all(FLERR,"Illegal compute entropy/atom command; wrong number of arguments");
|
||||||
" of arguments");
|
|
||||||
|
|
||||||
// Arguments are: sigma cutoff avg yes/no cutoff2 local yes/no
|
// Arguments are: sigma cutoff avg yes/no cutoff2 local yes/no
|
||||||
// sigma is the gaussian width
|
// sigma is the gaussian width
|
||||||
@ -57,11 +58,9 @@ ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
// the g(r)
|
// the g(r)
|
||||||
|
|
||||||
sigma = utils::numeric(FLERR,arg[3],false,lmp);
|
sigma = utils::numeric(FLERR,arg[3],false,lmp);
|
||||||
if (sigma <= 0.0) error->all(FLERR,"Illegal compute entropy/atom"
|
if (sigma <= 0.0) error->all(FLERR,"Illegal compute entropy/atom command; sigma must be positive");
|
||||||
" command; sigma must be positive");
|
|
||||||
cutoff = utils::numeric(FLERR,arg[4],false,lmp);
|
cutoff = utils::numeric(FLERR,arg[4],false,lmp);
|
||||||
if (cutoff <= 0.0) error->all(FLERR,"Illegal compute entropy/atom"
|
if (cutoff <= 0.0) error->all(FLERR,"Illegal compute entropy/atom command; cutoff must be positive");
|
||||||
" command; cutoff must be positive");
|
|
||||||
|
|
||||||
cutoff2 = 0.;
|
cutoff2 = 0.;
|
||||||
avg_flag = 0;
|
avg_flag = 0;
|
||||||
@ -71,26 +70,17 @@ ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
int iarg = 5;
|
int iarg = 5;
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"avg") == 0) {
|
if (strcmp(arg[iarg],"avg") == 0) {
|
||||||
if (iarg+2 > narg)
|
if (iarg+3 > narg) error->all(FLERR,"Illegal compute entropy/atom command");
|
||||||
error->all(FLERR,"Illegal compute entropy/atom;"
|
avg_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
" missing arguments after avg");
|
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) avg_flag = 1;
|
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) avg_flag = 0;
|
|
||||||
else error->all(FLERR,"Illegal compute entropy/atom;"
|
|
||||||
" argument after avg should be yes or no");
|
|
||||||
cutoff2 = utils::numeric(FLERR,arg[iarg+2],false,lmp);
|
cutoff2 = utils::numeric(FLERR,arg[iarg+2],false,lmp);
|
||||||
if (cutoff2 < 0.0) error->all(FLERR,"Illegal compute entropy/atom"
|
if (cutoff2 < 0.0) error->all(FLERR,"Illegal compute entropy/atom command; negative cutoff2");
|
||||||
" command; negative cutoff2");
|
|
||||||
cutsq2 = cutoff2*cutoff2;
|
cutsq2 = cutoff2*cutoff2;
|
||||||
iarg += 3;
|
iarg += 3;
|
||||||
} else if (strcmp(arg[iarg],"local") == 0) {
|
} else if (strcmp(arg[iarg],"local") == 0) {
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) local_flag = 1;
|
if (iarg+2 > narg) error->all(FLERR,"Illegal compute entropy/atom command");
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) local_flag = 0;
|
local_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else error->all(FLERR,"Illegal compute entropy/atom;"
|
|
||||||
" argument after local should be yes or no");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal compute entropy/atom; argument after"
|
} else error->all(FLERR,"Illegal compute entropy/atom command");
|
||||||
" sigma and cutoff should be avg or local");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -258,9 +258,7 @@ int DumpDCD::modify_param(int narg, char **arg)
|
|||||||
{
|
{
|
||||||
if (strcmp(arg[0],"unwrap") == 0) {
|
if (strcmp(arg[0],"unwrap") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
||||||
if (strcmp(arg[1],"yes") == 0) unwrap_flag = 1;
|
unwrap_flag = utils::logical(FLERR,arg[1],false,lmp);
|
||||||
else if (strcmp(arg[1],"no") == 0) unwrap_flag = 0;
|
|
||||||
else error->all(FLERR,"Illegal dump_modify command");
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -24,19 +24,20 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "dump_xtc.h"
|
#include "dump_xtc.h"
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
#include <climits>
|
|
||||||
#include "domain.h"
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "update.h"
|
|
||||||
#include "group.h"
|
|
||||||
#include "output.h"
|
|
||||||
#include "force.h"
|
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "memory.h"
|
#include "domain.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
|
#include "group.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "output.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
|
#include <climits>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
@ -278,9 +279,7 @@ int DumpXTC::modify_param(int narg, char **arg)
|
|||||||
{
|
{
|
||||||
if (strcmp(arg[0],"unwrap") == 0) {
|
if (strcmp(arg[0],"unwrap") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
||||||
if (strcmp(arg[1],"yes") == 0) unwrap_flag = 1;
|
unwrap_flag = utils::logical(FLERR,arg[1],false,lmp);
|
||||||
else if (strcmp(arg[1],"no") == 0) unwrap_flag = 0;
|
|
||||||
else error->all(FLERR,"Illegal dump_modify command");
|
|
||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[0],"precision") == 0) {
|
} else if (strcmp(arg[0],"precision") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
||||||
|
|||||||
@ -91,9 +91,7 @@ FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"energy") == 0) {
|
if (strcmp(arg[iarg],"energy") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal energy keyword");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal energy keyword");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) workflag = true;
|
workflag = utils::logical(FLERR,arg[iarg+1],false,lmp) == 1;
|
||||||
else if (strcmp(arg[iarg+1],"no") != 0)
|
|
||||||
error->all(FLERR,"Illegal energy keyword");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix flow/gauss command");
|
} else error->all(FLERR,"Illegal fix flow/gauss command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,17 +19,18 @@
|
|||||||
|
|
||||||
#include "fix_gld.h"
|
#include "fix_gld.h"
|
||||||
|
|
||||||
|
#include "atom.h"
|
||||||
|
#include "comm.h"
|
||||||
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
|
#include "group.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "random_mars.h"
|
||||||
|
#include "respa.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "atom.h"
|
|
||||||
#include "force.h"
|
|
||||||
#include "update.h"
|
|
||||||
#include "respa.h"
|
|
||||||
#include "comm.h"
|
|
||||||
#include "random_mars.h"
|
|
||||||
#include "memory.h"
|
|
||||||
#include "error.h"
|
|
||||||
#include "group.h"
|
|
||||||
|
|
||||||
#define GLD_UNIFORM_DISTRO
|
#define GLD_UNIFORM_DISTRO
|
||||||
|
|
||||||
@ -128,26 +129,14 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"zero") == 0) {
|
if (strcmp(arg[iarg],"zero") == 0) {
|
||||||
if (iarg+2 > narg) {
|
if (iarg+2 > narg) error->all(FLERR, "Illegal fix gld command");
|
||||||
error->all(FLERR, "Illegal fix gld command");
|
zeroflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
}
|
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) {
|
|
||||||
zeroflag = 0;
|
|
||||||
} else if (strcmp(arg[iarg+1],"yes") == 0) {
|
|
||||||
zeroflag = 1;
|
|
||||||
} else {
|
|
||||||
error->all(FLERR,"Illegal fix gld command");
|
|
||||||
}
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
}
|
}
|
||||||
else if (strcmp(arg[iarg],"frozen") == 0) {
|
else if (strcmp(arg[iarg],"frozen") == 0) {
|
||||||
if (iarg+2 > narg) {
|
if (iarg+2 > narg) error->all(FLERR, "Illegal fix gld command");
|
||||||
error->all(FLERR, "Illegal fix gld command");
|
freezeflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
}
|
if (freezeflag) {
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) {
|
|
||||||
freezeflag = 0;
|
|
||||||
} else if (strcmp(arg[iarg+1],"yes") == 0) {
|
|
||||||
freezeflag = 1;
|
|
||||||
for (int i = 0; i < atom->nlocal; i++) {
|
for (int i = 0; i < atom->nlocal; i++) {
|
||||||
if (atom->mask[i] & groupbit) {
|
if (atom->mask[i] & groupbit) {
|
||||||
for (int k = 0; k < 3*prony_terms; k=k+3)
|
for (int k = 0; k < 3*prony_terms; k=k+3)
|
||||||
@ -158,8 +147,6 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
error->all(FLERR, "Illegal fix gld command");
|
|
||||||
}
|
}
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -297,9 +297,7 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"mtk") == 0) {
|
} else if (strcmp(arg[iarg],"mtk") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) mtk_flag = 1;
|
mtk_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) mtk_flag = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix npt/cauchy command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"tloop") == 0) {
|
} else if (strcmp(arg[iarg],"tloop") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
@ -318,27 +316,19 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"scalexy") == 0) {
|
} else if (strcmp(arg[iarg],"scalexy") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) scalexy = 1;
|
scalexy = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) scalexy = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix npt/cauchy command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"scalexz") == 0) {
|
} else if (strcmp(arg[iarg],"scalexz") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) scalexz = 1;
|
scalexz = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) scalexz = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix npt/cauchy command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"scaleyz") == 0) {
|
} else if (strcmp(arg[iarg],"scaleyz") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) scaleyz = 1;
|
scaleyz = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) scaleyz = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix npt/cauchy command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"flip") == 0) {
|
} else if (strcmp(arg[iarg],"flip") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) flipflag = 1;
|
flipflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) flipflag = 0;
|
|
||||||
else error->all(FLERR,"Illegal fix npt/cauchy command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"update") == 0) {
|
} else if (strcmp(arg[iarg],"update") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
@ -352,10 +342,8 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
alpha = utils::numeric(FLERR,arg[iarg+1],false,lmp);
|
alpha = utils::numeric(FLERR,arg[iarg+1],false,lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"continue") == 0) {
|
} else if (strcmp(arg[iarg],"continue") == 0) {
|
||||||
if (strcmp(arg[iarg+1],"yes") != 0 && strcmp(arg[iarg+1],"no") != 0)
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
error->all(FLERR,"Illegal cauchystat continue value. "
|
restartPK = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
"Must be 'yes' or 'no'");
|
|
||||||
restartPK = !strcmp(arg[iarg+1],"yes");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"fixedpoint") == 0) {
|
} else if (strcmp(arg[iarg],"fixedpoint") == 0) {
|
||||||
if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command");
|
||||||
|
|||||||
@ -103,16 +103,12 @@ FixPAFI::FixPAFI(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
int iarg = 7;
|
int iarg = 7;
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"overdamped") == 0) {
|
if (strcmp(arg[iarg],"overdamped") == 0) {
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) od_flag = 0;
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pafi command");
|
||||||
else if (strcmp(arg[iarg+1],"0") == 0) od_flag = 0;
|
od_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) od_flag = 1;
|
|
||||||
else if (strcmp(arg[iarg+1],"1") == 0) od_flag = 1;
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"com") == 0) {
|
} else if (strcmp(arg[iarg],"com") == 0) {
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) com_flag = 0;
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix pafi command");
|
||||||
else if (strcmp(arg[iarg+1],"0") == 0) com_flag = 0;
|
com_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) com_flag = 1;
|
|
||||||
else if (strcmp(arg[iarg+1],"1") == 0) com_flag = 1;
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix pafi command");
|
} else error->all(FLERR,"Illegal fix pafi command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -124,18 +124,12 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"tail") == 0) {
|
if (strcmp(arg[iarg],"tail") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword "
|
if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep");
|
||||||
"in compute fep");
|
tailflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) tailflag = 0;
|
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) tailflag = 1;
|
|
||||||
else error->all(FLERR,"Illegal optional keyword in compute fep");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"volume") == 0) {
|
} else if (strcmp(arg[iarg],"volume") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword "
|
if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep");
|
||||||
"in compute fep");
|
volumeflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) volumeflag = 0;
|
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) volumeflag = 1;
|
|
||||||
else error->all(FLERR,"Illegal optional keyword in compute fep");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else
|
} else
|
||||||
error->all(FLERR,"Illegal optional keyword in compute fep");
|
error->all(FLERR,"Illegal optional keyword in compute fep");
|
||||||
|
|||||||
@ -138,21 +138,15 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"reset") == 0) {
|
if (strcmp(arg[iarg],"reset") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) resetflag = 0;
|
resetflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) resetflag = 1;
|
|
||||||
else error->all(FLERR,"Illegal fix adapt/fep command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"scale") == 0) {
|
} else if (strcmp(arg[iarg],"scale") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) scaleflag = 0;
|
scaleflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) scaleflag = 1;
|
|
||||||
else error->all(FLERR,"Illegal fix adapt/fep command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"after") == 0) {
|
} else if (strcmp(arg[iarg],"after") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt/fep command");
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) afterflag = 0;
|
afterflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) afterflag = 1;
|
|
||||||
else error->all(FLERR,"Illegal fix adapt/fep command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal fix adapt/fep command");
|
} else error->all(FLERR,"Illegal fix adapt/fep command");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,23 +16,24 @@
|
|||||||
Contributing author: Pierre de Buyl (KU Leuven)
|
Contributing author: Pierre de Buyl (KU Leuven)
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
#include <climits>
|
|
||||||
#include "ch5md.h"
|
|
||||||
#include "dump_h5md.h"
|
#include "dump_h5md.h"
|
||||||
#include "domain.h"
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "update.h"
|
#include "domain.h"
|
||||||
#include "group.h"
|
|
||||||
#include "output.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
|
#include "group.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "output.h"
|
||||||
|
#include "update.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
#include <climits>
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "ch5md.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
#define MYMIN(a,b) ((a) < (b) ? (a) : (b))
|
#define MYMIN(a,b) ((a) < (b) ? (a) : (b))
|
||||||
@ -152,25 +153,14 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
|
|||||||
error->all(FLERR, "Invalid number of arguments in dump h5md");
|
error->all(FLERR, "Invalid number of arguments in dump h5md");
|
||||||
}
|
}
|
||||||
box_is_set = true;
|
box_is_set = true;
|
||||||
if (strcmp(arg[iarg+1], "yes")==0)
|
do_box = utils::logical(FLERR,arg[iarg+1],false,lmp) == 1;
|
||||||
do_box=true;
|
|
||||||
else if (strcmp(arg[iarg+1], "no")==0)
|
|
||||||
do_box=false;
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal dump h5md command");
|
|
||||||
iarg+=2;
|
iarg+=2;
|
||||||
} else if (strcmp(arg[iarg], "create_group")==0) {
|
} else if (strcmp(arg[iarg], "create_group")==0) {
|
||||||
if (iarg+1>=narg) {
|
if (iarg+1>=narg) {
|
||||||
error->all(FLERR, "Invalid number of arguments in dump h5md");
|
error->all(FLERR, "Invalid number of arguments in dump h5md");
|
||||||
}
|
}
|
||||||
create_group_is_set = true;
|
create_group_is_set = true;
|
||||||
if (strcmp(arg[iarg+1], "yes")==0)
|
create_group = utils::logical(FLERR,arg[iarg+1],false,lmp) == 1;
|
||||||
create_group=true;
|
|
||||||
else if (strcmp(arg[iarg+1], "no")==0) {
|
|
||||||
create_group=false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
error->all(FLERR, "Illegal dump h5md command");
|
|
||||||
iarg+=2;
|
iarg+=2;
|
||||||
} else if (strcmp(arg[iarg], "author")==0) {
|
} else if (strcmp(arg[iarg], "author")==0) {
|
||||||
if (iarg+1>=narg) {
|
if (iarg+1>=narg) {
|
||||||
|
|||||||
@ -381,9 +381,7 @@ void KokkosLMP::accelerator(int narg, char **arg)
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"newton") == 0) {
|
} else if (strcmp(arg[iarg],"newton") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
||||||
if (strcmp(arg[iarg+1],"off") == 0) newtonflag = 0;
|
newtonflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"on") == 0) newtonflag = 1;
|
|
||||||
else error->all(FLERR,"Illegal package kokkos command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"comm") == 0) {
|
} else if (strcmp(arg[iarg],"comm") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
||||||
@ -459,21 +457,15 @@ void KokkosLMP::accelerator(int narg, char **arg)
|
|||||||
} else if ((strcmp(arg[iarg],"gpu/aware") == 0)
|
} else if ((strcmp(arg[iarg],"gpu/aware") == 0)
|
||||||
|| (strcmp(arg[iarg],"cuda/aware") == 0)) {
|
|| (strcmp(arg[iarg],"cuda/aware") == 0)) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
||||||
if (strcmp(arg[iarg+1],"off") == 0) gpu_aware_flag = 0;
|
gpu_aware_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"on") == 0) gpu_aware_flag = 1;
|
|
||||||
else error->all(FLERR,"Illegal package kokkos command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"pair/only") == 0) {
|
} else if (strcmp(arg[iarg],"pair/only") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
||||||
if (strcmp(arg[iarg+1],"off") == 0) pair_only_flag = 0;
|
pair_only_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"on") == 0) pair_only_flag = 1;
|
|
||||||
else error->all(FLERR,"Illegal package kokkos command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"neigh/thread") == 0) {
|
} else if (strcmp(arg[iarg],"neigh/thread") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command");
|
||||||
if (strcmp(arg[iarg+1],"off") == 0) neigh_thread = 0;
|
neigh_thread = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"on") == 0) neigh_thread = 1;
|
|
||||||
else error->all(FLERR,"Illegal package kokkos command");
|
|
||||||
neigh_thread_set = 1;
|
neigh_thread_set = 1;
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR,"Illegal package kokkos command");
|
} else error->all(FLERR,"Illegal package kokkos command");
|
||||||
|
|||||||
@ -160,15 +160,11 @@ void FixAtomSwap::options(int narg, char **arg)
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"ke") == 0) {
|
} else if (strcmp(arg[iarg],"ke") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix atom/swap command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix atom/swap command");
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) conserve_ke_flag = 0;
|
conserve_ke_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) conserve_ke_flag = 1;
|
|
||||||
else error->all(FLERR,"Illegal fix atom/swap command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"semi-grand") == 0) {
|
} else if (strcmp(arg[iarg],"semi-grand") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix atom/swap command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix atom/swap command");
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) semi_grand_flag = 0;
|
semi_grand_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) semi_grand_flag = 1;
|
|
||||||
else error->all(FLERR,"Illegal fix atom/swap command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"types") == 0) {
|
} else if (strcmp(arg[iarg],"types") == 0) {
|
||||||
if (iarg+3 > narg) error->all(FLERR,"Illegal fix atom/swap command");
|
if (iarg+3 > narg) error->all(FLERR,"Illegal fix atom/swap command");
|
||||||
|
|||||||
@ -1180,8 +1180,8 @@ void FixChargeRegulation::setThermoTemperaturePointer() {
|
|||||||
int ifix = -1;
|
int ifix = -1;
|
||||||
ifix = modify->find_fix(idftemp);
|
ifix = modify->find_fix(idftemp);
|
||||||
if (ifix == -1) {
|
if (ifix == -1) {
|
||||||
error->all(FLERR,
|
error->all(FLERR, "fix charge/regulation regulation could not find "
|
||||||
"fix charge/regulation regulation could not find a temperature fix id provided by tempfixid\n");
|
"a temperature fix id provided by tempfixid\n");
|
||||||
}
|
}
|
||||||
Fix *temperature_fix = modify->fix[ifix];
|
Fix *temperature_fix = modify->fix[ifix];
|
||||||
int dim;
|
int dim;
|
||||||
@ -1198,8 +1198,7 @@ void FixChargeRegulation::assign_tags() {
|
|||||||
for (int i = 0; i < atom->nlocal; i++) maxtag = MAX(maxtag, tag[i]);
|
for (int i = 0; i < atom->nlocal; i++) maxtag = MAX(maxtag, tag[i]);
|
||||||
maxtag_all = maxtag;
|
maxtag_all = maxtag;
|
||||||
MPI_Allreduce(&maxtag, &maxtag_all, 1, MPI_LMP_TAGINT, MPI_MAX, world);
|
MPI_Allreduce(&maxtag, &maxtag_all, 1, MPI_LMP_TAGINT, MPI_MAX, world);
|
||||||
if (maxtag_all >= MAXTAGINT)
|
if (maxtag_all >= MAXTAGINT) error->all(FLERR, "New atom IDs exceed maximum allowed ID");
|
||||||
error->all(FLERR, "New atom IDs exceed maximum allowed ID");
|
|
||||||
|
|
||||||
tagint notag = 0;
|
tagint notag = 0;
|
||||||
tagint notag_all;
|
tagint notag_all;
|
||||||
@ -1267,23 +1266,19 @@ void FixChargeRegulation::options(int narg, char **arg) {
|
|||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
|
|
||||||
if (strcmp(arg[iarg], "lunit_nm") == 0) {
|
if (strcmp(arg[iarg], "lunit_nm") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
llength_unit_in_nm = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
llength_unit_in_nm = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "acid_type") == 0) {
|
} else if (strcmp(arg[iarg], "acid_type") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
acid_type = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
acid_type = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "base_type") == 0) {
|
} else if (strcmp(arg[iarg], "base_type") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
base_type = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
base_type = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "pH") == 0) {
|
} else if (strcmp(arg[iarg], "pH") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
if (strstr(arg[iarg + 1],"v_") == arg[iarg + 1]) {
|
if (strstr(arg[iarg + 1],"v_") == arg[iarg + 1]) {
|
||||||
pHstr = utils::strdup(&arg[iarg + 1][2]);
|
pHstr = utils::strdup(&arg[iarg + 1][2]);
|
||||||
} else {
|
} else {
|
||||||
@ -1292,45 +1287,37 @@ void FixChargeRegulation::options(int narg, char **arg) {
|
|||||||
}
|
}
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "pIp") == 0) {
|
} else if (strcmp(arg[iarg], "pIp") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
pI_plus = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
pI_plus = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "pIm") == 0) {
|
} else if (strcmp(arg[iarg], "pIm") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
pI_minus = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
pI_minus = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "pKa") == 0) {
|
} else if (strcmp(arg[iarg], "pKa") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
pKa = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
pKa = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "pKb") == 0) {
|
} else if (strcmp(arg[iarg], "pKb") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
pKb = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
pKb = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg], "temp") == 0) {
|
} else if (strcmp(arg[iarg], "temp") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
reservoir_temperature = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
reservoir_temperature = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "pKs") == 0) {
|
} else if (strcmp(arg[iarg], "pKs") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
pKs = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
pKs = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "tempfixid") == 0) {
|
} else if (strcmp(arg[iarg], "tempfixid") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
idftemp = utils::strdup(arg[iarg+1]);
|
idftemp = utils::strdup(arg[iarg+1]);
|
||||||
setThermoTemperaturePointer();
|
setThermoTemperaturePointer();
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "rxd") == 0) {
|
} else if (strcmp(arg[iarg], "rxd") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
reaction_distance = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
reaction_distance = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
if ((reaction_distance > domain->prd_half[0]) ||
|
if ((reaction_distance > domain->prd_half[0]) ||
|
||||||
(reaction_distance > domain->prd_half[1]) ||
|
(reaction_distance > domain->prd_half[1]) ||
|
||||||
@ -1342,61 +1329,44 @@ void FixChargeRegulation::options(int narg, char **arg) {
|
|||||||
}
|
}
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "nevery") == 0) {
|
} else if (strcmp(arg[iarg], "nevery") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
nevery = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
nevery = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "nmc") == 0) {
|
} else if (strcmp(arg[iarg], "nmc") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
nmc = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
nmc = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "pmcmoves") == 0) {
|
} else if (strcmp(arg[iarg], "pmcmoves") == 0) {
|
||||||
if (iarg + 4 > narg)
|
if (iarg + 4 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
pmcmoves[0] = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
pmcmoves[0] = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
pmcmoves[1] = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
|
pmcmoves[1] = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
|
||||||
pmcmoves[2] = utils::numeric(FLERR, arg[iarg + 3], false, lmp);
|
pmcmoves[2] = utils::numeric(FLERR, arg[iarg + 3], false, lmp);
|
||||||
iarg += 4;
|
iarg += 4;
|
||||||
} else if (strcmp(arg[iarg], "seed") == 0) {
|
} else if (strcmp(arg[iarg], "seed") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
seed = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
seed = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "tag") == 0) {
|
} else if (strcmp(arg[iarg], "tag") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
add_tags_flag = utils::logical(FLERR,arg[iarg+1],false,lmp) == 1;
|
||||||
if (strcmp(arg[iarg + 1], "yes") == 0) {
|
|
||||||
add_tags_flag = true;
|
|
||||||
} else if (strcmp(arg[iarg + 1], "no") == 0) {
|
|
||||||
add_tags_flag = false;
|
|
||||||
} else error->all(FLERR, "Illegal fix charge/regulation command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "onlysalt") == 0) {
|
} else if (strcmp(arg[iarg], "onlysalt") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
only_salt_flag = utils::logical(FLERR,arg[iarg+1],false,lmp) == 1;
|
||||||
if (strcmp(arg[iarg + 1], "yes") == 0) {
|
iarg += 2;
|
||||||
only_salt_flag = true;
|
if (only_salt_flag) {
|
||||||
// need to specify salt charge
|
// need to specify salt charge
|
||||||
if (iarg + 4 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix charge/regulation command");
|
salt_charge[0] = utils::inumeric(FLERR, arg[iarg], false, lmp);
|
||||||
salt_charge[0] = utils::inumeric(FLERR, arg[iarg + 2], false, lmp);
|
salt_charge[1] = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
|
||||||
salt_charge[1] = utils::inumeric(FLERR, arg[iarg + 3], false, lmp);
|
|
||||||
iarg += 4;
|
|
||||||
} else if (strcmp(arg[iarg + 1], "no") == 0) {
|
|
||||||
only_salt_flag = false;
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else error->all(FLERR, "Illegal fix charge/regulation command");
|
}
|
||||||
|
|
||||||
} else if (strcmp(arg[iarg], "group") == 0) {
|
} else if (strcmp(arg[iarg], "group") == 0) {
|
||||||
if (iarg + 2 > narg)
|
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix fix charge/regulation command");
|
||||||
error->all(FLERR, "Illegal fix fix charge/regulation command");
|
|
||||||
if (ngroups >= ngroupsmax) {
|
if (ngroups >= ngroupsmax) {
|
||||||
ngroupsmax = ngroups + 1;
|
ngroupsmax = ngroups + 1;
|
||||||
groupstrings = (char **)
|
groupstrings = (char **)
|
||||||
memory->srealloc(groupstrings,
|
memory->srealloc(groupstrings, ngroupsmax * sizeof(char *), "fix_charge_regulation:groupstrings");
|
||||||
ngroupsmax * sizeof(char *),
|
|
||||||
"fix_charge_regulation:groupstrings");
|
|
||||||
}
|
}
|
||||||
groupstrings[ngroups] = utils::strdup(arg[iarg+1]);
|
groupstrings[ngroups] = utils::strdup(arg[iarg+1]);
|
||||||
ngroups++;
|
ngroups++;
|
||||||
|
|||||||
@ -421,9 +421,7 @@ int DumpMolfile::modify_param(int narg, char **arg)
|
|||||||
{
|
{
|
||||||
if (strcmp(arg[0],"unwrap") == 0) {
|
if (strcmp(arg[0],"unwrap") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
|
||||||
if (strcmp(arg[1],"yes") == 0) unwrap_flag = 1;
|
unwrap_flag = utils::logical(FLERR,arg[1],false,lmp);
|
||||||
else if (strcmp(arg[1],"no") == 0) unwrap_flag = 0;
|
|
||||||
else error->all(FLERR,"Illegal dump_modify command");
|
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
} else if (strcmp(arg[0],"element") == 0) {
|
} else if (strcmp(arg[0],"element") == 0) {
|
||||||
|
|||||||
@ -871,19 +871,13 @@ int DumpNetCDF::modify_param(int narg, char **arg)
|
|||||||
int iarg = 0;
|
int iarg = 0;
|
||||||
if (strcmp(arg[iarg],"double") == 0) {
|
if (strcmp(arg[iarg],"double") == 0) {
|
||||||
iarg++;
|
iarg++;
|
||||||
if (iarg >= narg)
|
if (iarg >= narg) error->all(FLERR,"expected 'yes' or 'no' after 'double' keyword.");
|
||||||
error->all(FLERR,"expected 'yes' or 'no' after 'double' keyword.");
|
double_precision = utils::logical(FLERR,arg[iarg],false,lmp) == 1;
|
||||||
if (strcmp(arg[iarg],"yes") == 0) {
|
|
||||||
double_precision = true;
|
|
||||||
} else if (strcmp(arg[iarg],"no") == 0) {
|
|
||||||
double_precision = false;
|
|
||||||
} else error->all(FLERR,"expected 'yes' or 'no' after 'double' keyword.");
|
|
||||||
iarg++;
|
iarg++;
|
||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[iarg],"at") == 0) {
|
} else if (strcmp(arg[iarg],"at") == 0) {
|
||||||
iarg++;
|
iarg++;
|
||||||
if (iarg >= narg)
|
if (iarg >= narg) error->all(FLERR,"expected additional arg after 'at' keyword.");
|
||||||
error->all(FLERR,"expected additional arg after 'at' keyword.");
|
|
||||||
framei = utils::inumeric(FLERR,arg[iarg],false,lmp);
|
framei = utils::inumeric(FLERR,arg[iarg],false,lmp);
|
||||||
if (framei == 0) error->all(FLERR,"frame 0 not allowed for 'at' keyword.");
|
if (framei == 0) error->all(FLERR,"frame 0 not allowed for 'at' keyword.");
|
||||||
else if (framei < 0) framei--;
|
else if (framei < 0) framei--;
|
||||||
@ -891,13 +885,8 @@ int DumpNetCDF::modify_param(int narg, char **arg)
|
|||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[iarg],"thermo") == 0) {
|
} else if (strcmp(arg[iarg],"thermo") == 0) {
|
||||||
iarg++;
|
iarg++;
|
||||||
if (iarg >= narg)
|
if (iarg >= narg) error->all(FLERR,"expected 'yes' or 'no' after 'thermo' keyword.");
|
||||||
error->all(FLERR,"expected 'yes' or 'no' after 'thermo' keyword.");
|
thermo = utils::logical(FLERR,arg[iarg],false,lmp) == 1;
|
||||||
if (strcmp(arg[iarg],"yes") == 0) {
|
|
||||||
thermo = true;
|
|
||||||
} else if (strcmp(arg[iarg],"no") == 0) {
|
|
||||||
thermo = false;
|
|
||||||
} else error->all(FLERR,"expected 'yes' or 'no' after 'thermo' keyword.");
|
|
||||||
iarg++;
|
iarg++;
|
||||||
return 2;
|
return 2;
|
||||||
} else return 0;
|
} else return 0;
|
||||||
|
|||||||
@ -866,19 +866,13 @@ int DumpNetCDFMPIIO::modify_param(int narg, char **arg)
|
|||||||
int iarg = 0;
|
int iarg = 0;
|
||||||
if (strcmp(arg[iarg],"double") == 0) {
|
if (strcmp(arg[iarg],"double") == 0) {
|
||||||
iarg++;
|
iarg++;
|
||||||
if (iarg >= narg)
|
if (iarg >= narg) error->all(FLERR,"expected 'yes' or 'no' after 'double' keyword.");
|
||||||
error->all(FLERR,"expected 'yes' or 'no' after 'double' keyword.");
|
double_precision = utils::logical(FLERR,arg[iarg],false,lmp) == 1;
|
||||||
if (strcmp(arg[iarg],"yes") == 0) {
|
|
||||||
double_precision = true;
|
|
||||||
} else if (strcmp(arg[iarg],"no") == 0) {
|
|
||||||
double_precision = false;
|
|
||||||
} else error->all(FLERR,"expected 'yes' or 'no' after 'double' keyword.");
|
|
||||||
iarg++;
|
iarg++;
|
||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[iarg],"at") == 0) {
|
} else if (strcmp(arg[iarg],"at") == 0) {
|
||||||
iarg++;
|
iarg++;
|
||||||
if (iarg >= narg)
|
if (iarg >= narg) error->all(FLERR,"expected additional arg after 'at' keyword.");
|
||||||
error->all(FLERR,"expected additional arg after 'at' keyword.");
|
|
||||||
framei = utils::inumeric(FLERR,arg[iarg],false,lmp);
|
framei = utils::inumeric(FLERR,arg[iarg],false,lmp);
|
||||||
if (framei == 0) error->all(FLERR,"frame 0 not allowed for 'at' keyword.");
|
if (framei == 0) error->all(FLERR,"frame 0 not allowed for 'at' keyword.");
|
||||||
else if (framei < 0) framei--;
|
else if (framei < 0) framei--;
|
||||||
@ -886,13 +880,8 @@ int DumpNetCDFMPIIO::modify_param(int narg, char **arg)
|
|||||||
return 2;
|
return 2;
|
||||||
} else if (strcmp(arg[iarg],"thermo") == 0) {
|
} else if (strcmp(arg[iarg],"thermo") == 0) {
|
||||||
iarg++;
|
iarg++;
|
||||||
if (iarg >= narg)
|
if (iarg >= narg) error->all(FLERR,"expected 'yes' or 'no' after 'thermo' keyword.");
|
||||||
error->all(FLERR,"expected 'yes' or 'no' after 'thermo' keyword.");
|
thermo = utils::logical(FLERR,arg[iarg],false,lmp) == 1;
|
||||||
if (strcmp(arg[iarg],"yes") == 0) {
|
|
||||||
thermo = true;
|
|
||||||
} else if (strcmp(arg[iarg],"no") == 0) {
|
|
||||||
thermo = false;
|
|
||||||
} else error->all(FLERR,"expected 'yes' or 'no' after 'thermo' keyword.");
|
|
||||||
iarg++;
|
iarg++;
|
||||||
return 2;
|
return 2;
|
||||||
} else return 0;
|
} else return 0;
|
||||||
|
|||||||
@ -109,15 +109,11 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "neighbors") == 0) {
|
} else if (strcmp(arg[iarg], "neighbors") == 0) {
|
||||||
if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
|
if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) faces_flag = 1;
|
faces_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) faces_flag = 0;
|
|
||||||
else error->all(FLERR,"Illegal compute voronoi/atom command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg], "peratom") == 0) {
|
} else if (strcmp(arg[iarg], "peratom") == 0) {
|
||||||
if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
|
if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command");
|
||||||
if (strcmp(arg[iarg+1],"yes") == 0) peratom_flag = 1;
|
peratom_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||||
else if (strcmp(arg[iarg+1],"no") == 0) peratom_flag = 0;
|
|
||||||
else error->all(FLERR,"Illegal compute voronoi/atom command");
|
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
}
|
}
|
||||||
else error->all(FLERR,"Illegal compute voronoi/atom command");
|
else error->all(FLERR,"Illegal compute voronoi/atom command");
|
||||||
|
|||||||
@ -2070,9 +2070,7 @@ int DumpVTK::modify_param(int narg, char **arg)
|
|||||||
|
|
||||||
if (strcmp(arg[0],"binary") == 0) {
|
if (strcmp(arg[0],"binary") == 0) {
|
||||||
if (narg < 2) error->all(FLERR,"Illegal dump_modify command [binary]");
|
if (narg < 2) error->all(FLERR,"Illegal dump_modify command [binary]");
|
||||||
if (strcmp(arg[1],"yes") == 0) binary = 1;
|
binary = utils::logical(FLERR,arg[1],false,lmp);
|
||||||
else if (strcmp(arg[1],"no") == 0) binary = 0;
|
|
||||||
else error->all(FLERR,"Illegal dump_modify command [binary]");
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1622,16 +1622,10 @@ void Input::newton()
|
|||||||
int newton_pair=1,newton_bond=1;
|
int newton_pair=1,newton_bond=1;
|
||||||
|
|
||||||
if (narg == 1) {
|
if (narg == 1) {
|
||||||
if (strcmp(arg[0],"off") == 0) newton_pair = newton_bond = 0;
|
newton_pair = newton_bond = utils::logical(FLERR,arg[0],false,lmp);
|
||||||
else if (strcmp(arg[0],"on") == 0) newton_pair = newton_bond = 1;
|
|
||||||
else error->all(FLERR,"Illegal newton command");
|
|
||||||
} else if (narg == 2) {
|
} else if (narg == 2) {
|
||||||
if (strcmp(arg[0],"off") == 0) newton_pair = 0;
|
newton_pair = utils::logical(FLERR,arg[0],false,lmp);
|
||||||
else if (strcmp(arg[0],"on") == 0) newton_pair= 1;
|
newton_bond = utils::logical(FLERR,arg[1],false,lmp);
|
||||||
else error->all(FLERR,"Illegal newton command");
|
|
||||||
if (strcmp(arg[1],"off") == 0) newton_bond = 0;
|
|
||||||
else if (strcmp(arg[1],"on") == 0) newton_bond = 1;
|
|
||||||
else error->all(FLERR,"Illegal newton command");
|
|
||||||
} else error->all(FLERR,"Illegal newton command");
|
} else error->all(FLERR,"Illegal newton command");
|
||||||
|
|
||||||
force->newton_pair = newton_pair;
|
force->newton_pair = newton_pair;
|
||||||
|
|||||||
Reference in New Issue
Block a user