update formatting style to be more consistent
This commit is contained in:
@ -98,7 +98,7 @@ void DumpAtomZstd::openfile()
|
||||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ int DumpAtomZstd::modify_param(int narg, char **arg)
|
||||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ void DumpCFGZstd::openfile()
|
||||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -187,7 +187,7 @@ int DumpCFGZstd::modify_param(int narg, char **arg)
|
||||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ void DumpCustomZstd::openfile()
|
||||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ int DumpCustomZstd::modify_param(int narg, char **arg)
|
||||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ void DumpLocalZstd::openfile()
|
||||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ int DumpLocalZstd::modify_param(int narg, char **arg)
|
||||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ void DumpXYZZstd::openfile()
|
||||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -159,7 +159,7 @@ int DumpXYZZstd::modify_param(int narg, char **arg)
|
||||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ ZstdFileWriter::~ZstdFileWriter()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ZstdFileWriter::open(const std::string & path)
|
||||
void ZstdFileWriter::open(const std::string &path)
|
||||
{
|
||||
if(isopen()) return;
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ class ZstdFileWriter : public FileWriter {
|
||||
public:
|
||||
ZstdFileWriter();
|
||||
virtual ~ZstdFileWriter();
|
||||
virtual void open(const std::string & path) override;
|
||||
virtual void open(const std::string &path) override;
|
||||
virtual void close() override;
|
||||
virtual void flush() override;
|
||||
virtual size_t write(const void * buffer, size_t length) override;
|
||||
|
||||
@ -438,7 +438,7 @@ void PairEAMAlloyGPU::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ void PairEAMFSGPU::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,8 +338,8 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg,
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void KimQuery::echo_var_assign(const std::string & name,
|
||||
const std::string & value) const
|
||||
void KimQuery::echo_var_assign(const std::string &name,
|
||||
const std::string &value) const
|
||||
{
|
||||
input->write_echo(fmt::format("variable {} string {}\n",name,value));
|
||||
}
|
||||
|
||||
@ -1052,7 +1052,7 @@ void PairEAMAlloyKokkos<DeviceType>::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1055,7 +1055,7 @@ void PairEAMFSKokkos<DeviceType>::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -610,7 +610,7 @@ void PairADP::read_file(char *filename)
|
||||
reader.next_dvector(&file->w2r[i][j][1], file->nr);
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -3634,12 +3634,12 @@ void PairAIREBO::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
std::string msg = fmt::format("ERROR reading {} section in {} file\n"
|
||||
"REASON: {}\n",
|
||||
current_section, potential_name, e.what());
|
||||
error->one(FLERR, msg);
|
||||
} catch (FileReaderException & fre) {
|
||||
} catch (FileReaderException &fre) {
|
||||
error->one(FLERR, fre.what());
|
||||
std::string msg = fmt::format("ERROR reading {} section in {} file\n"
|
||||
"REASON: {}\n",
|
||||
|
||||
@ -5223,9 +5223,9 @@ void _noopt PairBOP::read_table(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
} catch (FileReaderException & fre) {
|
||||
} catch (FileReaderException &fre) {
|
||||
error->one(FLERR, fre.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -679,7 +679,7 @@ void PairComb::read_file(char *file)
|
||||
params[nparams].cml2 = values.next_double();
|
||||
params[nparams].coulcut = values.next_double();
|
||||
params[nparams].hfocor = values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -450,9 +450,9 @@ void PairComb3::read_lib()
|
||||
}
|
||||
}
|
||||
|
||||
} catch (FileReaderException & fre) {
|
||||
} catch (FileReaderException &fre) {
|
||||
error->one(FLERR, fre.what());
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -640,7 +640,7 @@ void PairComb3::read_file(char *file)
|
||||
params[nparams].addrep = values.next_double();
|
||||
params[nparams].pcross = values.next_double();
|
||||
params[nparams].powermint = int(params[nparams].powerm);
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -506,7 +506,7 @@ void PairEAM::read_file(char *filename)
|
||||
for (int j = 1; j <= file->nr; ++j)
|
||||
file->zr[j] *= sqrt_conv;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,7 +184,7 @@ void PairEAMAlloy::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,7 +189,7 @@ void PairEAMFS::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1071,7 +1071,7 @@ EIMPotentialFileReader::EIMPotentialFileReader(LAMMPS *lmp,
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
std::pair<std::string, std::string> EIMPotentialFileReader::get_pair(const std::string & a, const std::string & b) {
|
||||
std::pair<std::string, std::string> EIMPotentialFileReader::get_pair(const std::string &a, const std::string &b) {
|
||||
if (a < b) {
|
||||
return std::make_pair(a, b);
|
||||
}
|
||||
|
||||
@ -443,7 +443,7 @@ void PairGW::read_file(char *file)
|
||||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ void PairGWZBL::read_file(char *file)
|
||||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -344,7 +344,7 @@ void PairNb3bHarmonic::read_file(char *file)
|
||||
params[nparams].cutoff = values.next_double();
|
||||
|
||||
if (unit_convert) params[nparams].k_theta *= conversion_factor;
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -612,7 +612,7 @@ void PairPolymorphic::read_file(char *file)
|
||||
|
||||
if ((ng == 0) || (nr == 0) || (nx == 0))
|
||||
error->one(FLERR,"Error reading potential file header");
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR,"Potential file incompatible with this pair style version");
|
||||
}
|
||||
|
||||
@ -631,7 +631,7 @@ void PairPolymorphic::read_file(char *file)
|
||||
p.cutsq = p.cut*p.cut;
|
||||
p.xi = values.next_double();
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -414,7 +414,7 @@ void PairSW::read_file(char *file)
|
||||
params[nparams].powerp = values.next_double();
|
||||
params[nparams].powerq = values.next_double();
|
||||
params[nparams].tol = values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -466,7 +466,7 @@ void PairTersoff::read_file(char *file)
|
||||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@ void PairTersoffMOD::read_file(char *file)
|
||||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@ void PairTersoffMODC::read_file(char *file)
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
params[nparams].c0 *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@ void PairTersoffZBL::read_file(char *file)
|
||||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -432,7 +432,7 @@ void PairVashishta::read_file(char *file)
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -411,7 +411,7 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword)
|
||||
tb->afile[i] = values.next_double();
|
||||
tb->efile[i] = values.next_double();
|
||||
tb->ffile[i] = values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
++cerror;
|
||||
}
|
||||
}
|
||||
@ -526,7 +526,7 @@ void AngleTable::param_extract(Table *tb, char *line)
|
||||
error->one(FLERR,"Invalid keyword in angle table parameters");
|
||||
}
|
||||
}
|
||||
} catch(TokenizerException & e) {
|
||||
} catch(TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -341,7 +341,7 @@ void BondTable::read_table(Table *tb, char *file, char *keyword)
|
||||
tb->rfile[i] = values.next_double();
|
||||
tb->efile[i] = values.next_double();
|
||||
tb->ffile[i] = values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
++cerror;
|
||||
}
|
||||
|
||||
@ -491,7 +491,7 @@ void BondTable::param_extract(Table *tb, char *line)
|
||||
error->one(FLERR,"Invalid keyword in bond table parameters");
|
||||
}
|
||||
}
|
||||
} catch(TokenizerException & e) {
|
||||
} catch(TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ void PairEAMAlloyIntel::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ void PairEAMFSIntel::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1091,7 +1091,7 @@ void DihedralTable::read_table(Table *tb, char *file, char *keyword)
|
||||
tb->efile[i] = values.next_double();
|
||||
tb->ffile[i] = values.next_double();
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
} //for (int i = 0; (i < tb->ninput) && fp; i++) {
|
||||
@ -1316,7 +1316,7 @@ void DihedralTable::param_extract(Table *tb, char *line)
|
||||
else error->one(FLERR,fmt::format("Invalid keyword in dihedral angle "
|
||||
"table parameters ({})", word));
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -923,7 +923,7 @@ void PairTersoffTable::read_file(char *file)
|
||||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ void PairEAMAlloyOMP::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ void PairEAMFSOMP::read_file(char *filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
@ -157,7 +157,7 @@ void PairTersoffZBLOMP::read_file(char *file)
|
||||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ class FileWriter {
|
||||
public:
|
||||
FileWriter() = default;
|
||||
virtual ~FileWriter() = default;
|
||||
virtual void open(const std::string & path) = 0;
|
||||
virtual void open(const std::string &path) = 0;
|
||||
virtual void close() = 0;
|
||||
virtual void flush() = 0;
|
||||
virtual size_t write(const void * buffer, size_t length) = 0;
|
||||
@ -37,7 +37,7 @@ public:
|
||||
class FileWriterException : public std::exception {
|
||||
std::string message;
|
||||
public:
|
||||
FileWriterException(const std::string & msg) : message(msg) {
|
||||
FileWriterException(const std::string &msg) : message(msg) {
|
||||
}
|
||||
|
||||
~FileWriterException() throw() {
|
||||
|
||||
@ -35,8 +35,8 @@ class Info : protected Pointers {
|
||||
bool is_defined(const char *, const char *);
|
||||
bool is_available(const char *, const char *);
|
||||
|
||||
bool has_style(const std::string & category, const std::string & name);
|
||||
std::vector<std::string> get_available_styles(const std::string & category);
|
||||
bool has_style(const std::string &category, const std::string &name);
|
||||
std::vector<std::string> get_available_styles(const std::string &category);
|
||||
|
||||
static bool has_gzip_support();
|
||||
static bool has_png_support();
|
||||
|
||||
@ -84,7 +84,7 @@ static void ptr_argument_warning()
|
||||
try
|
||||
|
||||
#define END_CAPTURE \
|
||||
catch(LAMMPSAbortException & ae) { \
|
||||
catch(LAMMPSAbortException &ae) { \
|
||||
int nprocs = 0; \
|
||||
MPI_Comm_size(ae.universe, &nprocs ); \
|
||||
\
|
||||
@ -93,7 +93,7 @@ static void ptr_argument_warning()
|
||||
} else { \
|
||||
error->set_last_error(ae.message, ERROR_NORMAL); \
|
||||
} \
|
||||
} catch(LAMMPSException & e) { \
|
||||
} catch(LAMMPSException &e) { \
|
||||
error->set_last_error(e.message, ERROR_NORMAL); \
|
||||
}
|
||||
#else
|
||||
@ -166,7 +166,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr)
|
||||
lmp = new LAMMPS(argc, argv, comm);
|
||||
if (ptr) *ptr = (void *) lmp;
|
||||
}
|
||||
catch(LAMMPSException & e) {
|
||||
catch(LAMMPSException &e) {
|
||||
fmt::print(stderr, "LAMMPS Exception: {}", e.message);
|
||||
*ptr = nullptr;
|
||||
}
|
||||
|
||||
@ -492,7 +492,7 @@ void Molecule::read(int flag)
|
||||
|
||||
if (nmatch != nwant)
|
||||
error->one(FLERR,"Invalid header in molecule file");
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid header in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -688,7 +688,7 @@ void Molecule::coords(char *line)
|
||||
x[i][1] *= sizescale;
|
||||
x[i][2] *= sizescale;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Coords section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -718,7 +718,7 @@ void Molecule::types(char *line)
|
||||
type[i] = values.next_int();
|
||||
type[i] += toffset;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Types section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -748,7 +748,7 @@ void Molecule::molecules(char *line)
|
||||
molecule[i] = values.next_int();
|
||||
// molecule[i] += moffset; // placeholder for possible molecule offset
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Molecules section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -785,7 +785,7 @@ void Molecule::fragments(char *line)
|
||||
fragmentmask[i][atomID-1] = 1;
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid atom ID in Fragments section of molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -807,7 +807,7 @@ void Molecule::charges(char *line)
|
||||
values.next_int();
|
||||
q[i] = values.next_double();
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Charges section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -833,7 +833,7 @@ void Molecule::diameters(char *line)
|
||||
radius[i] *= 0.5;
|
||||
maxradius = MAX(maxradius,radius[i]);
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Diameters section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -860,7 +860,7 @@ void Molecule::masses(char *line)
|
||||
rmass[i] = values.next_double();
|
||||
rmass[i] *= sizescale*sizescale*sizescale;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Masses section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -898,7 +898,7 @@ void Molecule::bonds(int flag, char *line)
|
||||
itype = values.next_int();
|
||||
atom1 = values.next_tagint();
|
||||
atom2 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Bonds section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -967,7 +967,7 @@ void Molecule::angles(int flag, char *line)
|
||||
atom1 = values.next_tagint();
|
||||
atom2 = values.next_tagint();
|
||||
atom3 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Angles section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -1052,7 +1052,7 @@ void Molecule::dihedrals(int flag, char *line)
|
||||
atom2 = values.next_tagint();
|
||||
atom3 = values.next_tagint();
|
||||
atom4 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Dihedrals section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -1152,7 +1152,7 @@ void Molecule::impropers(int flag, char *line)
|
||||
atom2 = values.next_tagint();
|
||||
atom3 = values.next_tagint();
|
||||
atom4 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Impropers section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -1244,7 +1244,7 @@ void Molecule::nspecial_read(int flag, char *line)
|
||||
c1 = values.next_tagint();
|
||||
c2 = values.next_tagint();
|
||||
c3 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Special Bond Counts section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -1283,7 +1283,7 @@ void Molecule::special_read(char *line)
|
||||
error->one(FLERR,"Invalid special atom index in molecule file");
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Molecule file special list\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -1415,7 +1415,7 @@ void Molecule::shakeflag_read(char *line)
|
||||
values.next_int();
|
||||
shake_flag[i] = values.next_int();
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Shake Flags section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -1480,7 +1480,7 @@ void Molecule::shakeatom_read(char *line)
|
||||
error->one(FLERR,"Invalid shake atom in molecule file");
|
||||
}
|
||||
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR,fmt::format("Invalid shake atom in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -1545,7 +1545,7 @@ void Molecule::shaketype_read(char *line)
|
||||
if (nmatch != nwant)
|
||||
error->one(FLERR,"Invalid shake type data in molecule file");
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid shake type data in molecule file\n",
|
||||
"{}", e.what()));
|
||||
}
|
||||
@ -1598,7 +1598,7 @@ void Molecule::body(int flag, int pflag, char *line)
|
||||
}
|
||||
} else nword += ncount;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid body params in molecule file\n",
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ void PairCoulStreitz::read_file(char *file)
|
||||
params[nparams].zeta = values.next_double();
|
||||
params[nparams].zcore = values.next_double();
|
||||
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -402,7 +402,7 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
|
||||
rfile = values.next_double();
|
||||
tb->efile[i] = conversion_factor * values.next_double();
|
||||
tb->ffile[i] = conversion_factor * values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
++cerror;
|
||||
}
|
||||
|
||||
@ -571,7 +571,7 @@ void PairTable::param_extract(Table *tb, char *line)
|
||||
error->one(FLERR,fmt::format("Invalid keyword {} in pair table parameters", word).c_str());
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ PotentialFileReader::PotentialFileReader(LAMMPS *lmp,
|
||||
if(!reader) {
|
||||
error->one(FLERR, fmt::format("cannot open {} potential file {}", potential_name, filename));
|
||||
}
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ void PotentialFileReader::ignore_comments(bool value) {
|
||||
void PotentialFileReader::skip_line() {
|
||||
try {
|
||||
reader->skip_line();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -103,7 +103,7 @@ void PotentialFileReader::skip_line() {
|
||||
char *PotentialFileReader::next_line(int nparams) {
|
||||
try {
|
||||
return reader->next_line(nparams);
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return nullptr;
|
||||
@ -121,7 +121,7 @@ char *PotentialFileReader::next_line(int nparams) {
|
||||
void PotentialFileReader::next_dvector(double * list, int n) {
|
||||
try {
|
||||
return reader->next_dvector(list, n);
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
@ -136,10 +136,10 @@ void PotentialFileReader::next_dvector(double * list, int n) {
|
||||
* \param separators String with list of separators.
|
||||
* \return ValueTokenizer object for read in text */
|
||||
|
||||
ValueTokenizer PotentialFileReader::next_values(int nparams, const std::string & separators) {
|
||||
ValueTokenizer PotentialFileReader::next_values(int nparams, const std::string &separators) {
|
||||
try {
|
||||
return reader->next_values(nparams, separators);
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return ValueTokenizer("");
|
||||
@ -153,7 +153,7 @@ double PotentialFileReader::next_double() {
|
||||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_double();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return 0.0;
|
||||
@ -167,7 +167,7 @@ int PotentialFileReader::next_int() {
|
||||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_int();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return 0;
|
||||
@ -181,7 +181,7 @@ tagint PotentialFileReader::next_tagint() {
|
||||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_tagint();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return 0;
|
||||
@ -195,7 +195,7 @@ bigint PotentialFileReader::next_bigint() {
|
||||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_bigint();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return 0;
|
||||
@ -209,7 +209,7 @@ std::string PotentialFileReader::next_string() {
|
||||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_string();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return "";
|
||||
|
||||
@ -334,7 +334,7 @@ void ReaderNative::read_atoms(int n, int nfield, double **fields)
|
||||
return index of match or -1 if no match
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int ReaderNative::find_label(const std::string & label, const std::map<std::string, int> & labels)
|
||||
int ReaderNative::find_label(const std::string &label, const std::map<std::string, int> & labels)
|
||||
{
|
||||
auto it = labels.find(label);
|
||||
if (it != labels.end()) {
|
||||
|
||||
@ -45,7 +45,7 @@ private:
|
||||
int nwords; // # of per-atom columns in dump file
|
||||
int *fieldindex; //
|
||||
|
||||
int find_label(const std::string & label, const std::map<std::string, int> & labels);
|
||||
int find_label(const std::string &label, const std::map<std::string, int> & labels);
|
||||
void read_lines(int);
|
||||
};
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ TableFileReader::TableFileReader(LAMMPS *lmp,
|
||||
TableFileReader::~TableFileReader() {
|
||||
}
|
||||
|
||||
char *TableFileReader::find_section_start(const std::string & keyword) {
|
||||
char *TableFileReader::find_section_start(const std::string &keyword) {
|
||||
char *line = nullptr;
|
||||
while ((line = reader->next_line())) {
|
||||
ValueTokenizer values(line);
|
||||
|
||||
@ -164,6 +164,6 @@ void TextFileReader::next_dvector(double * list, int n) {
|
||||
* \param separators String with list of separators.
|
||||
* \return ValueTokenizer object for read in text */
|
||||
|
||||
ValueTokenizer TextFileReader::next_values(int nparams, const std::string & separators) {
|
||||
ValueTokenizer TextFileReader::next_values(int nparams, const std::string &separators) {
|
||||
return ValueTokenizer(next_line(nparams), separators);
|
||||
}
|
||||
|
||||
@ -41,13 +41,13 @@ namespace LAMMPS_NS
|
||||
char * next_line(int nparams = 0);
|
||||
|
||||
void next_dvector(double * list, int n);
|
||||
ValueTokenizer next_values(int nparams, const std::string & separators = TOKENIZER_DEFAULT_SEPARATORS);
|
||||
ValueTokenizer next_values(int nparams, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS);
|
||||
};
|
||||
|
||||
class FileReaderException : public std::exception {
|
||||
std::string message;
|
||||
public:
|
||||
FileReaderException(const std::string & msg) : message(msg) {
|
||||
FileReaderException(const std::string &msg) : message(msg) {
|
||||
}
|
||||
|
||||
~FileReaderException() throw() {
|
||||
@ -60,7 +60,7 @@ namespace LAMMPS_NS
|
||||
|
||||
class EOFException : public FileReaderException {
|
||||
public:
|
||||
EOFException(const std::string & msg) : FileReaderException(msg) {
|
||||
EOFException(const std::string &msg) : FileReaderException(msg) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
TokenizerException::TokenizerException(const std::string & msg, const std::string & token){
|
||||
TokenizerException::TokenizerException(const std::string &msg, const std::string &token){
|
||||
if(token.empty()) {
|
||||
message = msg;
|
||||
} else {
|
||||
@ -47,13 +47,13 @@ TokenizerException::TokenizerException(const std::string & msg, const std::strin
|
||||
* \param str string to be processed
|
||||
* \param separators string with separator characters (default: " \t\r\n\f") */
|
||||
|
||||
Tokenizer::Tokenizer(const std::string & str, const std::string & separators) :
|
||||
Tokenizer::Tokenizer(const std::string &str, const std::string &separators) :
|
||||
text(str), separators(separators), start(0), ntokens(std::string::npos)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
Tokenizer::Tokenizer(const Tokenizer & rhs) :
|
||||
Tokenizer::Tokenizer(const Tokenizer &rhs) :
|
||||
text(rhs.text), separators(rhs.separators), ntokens(rhs.ntokens)
|
||||
{
|
||||
reset();
|
||||
@ -75,7 +75,7 @@ void Tokenizer::reset() {
|
||||
*
|
||||
* \param str string to be searched for
|
||||
* \return true if string was found, false if not */
|
||||
bool Tokenizer::contains(const std::string & str) const {
|
||||
bool Tokenizer::contains(const std::string &str) const {
|
||||
return text.find(str) != std::string::npos;
|
||||
}
|
||||
|
||||
@ -169,13 +169,13 @@ std::vector<std::string> Tokenizer::as_vector() {
|
||||
*
|
||||
* \see Tokenizer InvalidIntegerException InvalidFloatException */
|
||||
|
||||
ValueTokenizer::ValueTokenizer(const std::string & str, const std::string & separators) : tokens(str, separators) {
|
||||
ValueTokenizer::ValueTokenizer(const std::string &str, const std::string &separators) : tokens(str, separators) {
|
||||
}
|
||||
|
||||
ValueTokenizer::ValueTokenizer(const ValueTokenizer & rhs) : tokens(rhs.tokens) {
|
||||
ValueTokenizer::ValueTokenizer(const ValueTokenizer &rhs) : tokens(rhs.tokens) {
|
||||
}
|
||||
|
||||
ValueTokenizer::ValueTokenizer(ValueTokenizer && rhs) : tokens(std::move(rhs.tokens)) {
|
||||
ValueTokenizer::ValueTokenizer(ValueTokenizer &&rhs) : tokens(std::move(rhs.tokens)) {
|
||||
}
|
||||
|
||||
/*! Indicate whether more tokens are available
|
||||
@ -189,7 +189,7 @@ bool ValueTokenizer::has_next() const {
|
||||
*
|
||||
* \param value string with value to be searched for
|
||||
* \return true if string was found, false if not */
|
||||
bool ValueTokenizer::contains(const std::string & value) const {
|
||||
bool ValueTokenizer::contains(const std::string &value) const {
|
||||
return tokens.contains(value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user