Merge pull request #2644 from akohlmey/collected-small-changes
Small bug fix for fixes to fix deposit and fix pour
This commit is contained in:
5
LICENSE
5
LICENSE
@ -301,9 +301,8 @@ one line to give the program's name and an idea of what it does.
|
||||
Copyright (C) yyyy name of author
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or (at
|
||||
your option) any later version.
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
|
||||
@ -375,7 +375,8 @@ void FixPour::init()
|
||||
|
||||
void FixPour::setup_pre_exchange()
|
||||
{
|
||||
next_reneighbor = update->ntimestep + 1;
|
||||
if (ninserted < ninsert) next_reneighbor = update->ntimestep + 1;
|
||||
else next_reneighbor = 0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -296,7 +296,8 @@ void FixDeposit::init()
|
||||
|
||||
void FixDeposit::setup_pre_exchange()
|
||||
{
|
||||
next_reneighbor = update->ntimestep+1;
|
||||
if (ninserted < ninsert) next_reneighbor = update->ntimestep+1;
|
||||
else next_reneighbor = 0;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -49,14 +49,19 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) {
|
||||
python->init();
|
||||
|
||||
// add current directory to PYTHONPATH
|
||||
PyObject * py_path = PySys_GetObject((char *)"path");
|
||||
|
||||
PyGILState_STATE gstate = PyGILState_Ensure();
|
||||
PyObject *py_path = PySys_GetObject((char *)"path");
|
||||
PyList_Append(py_path, PY_STRING_FROM_STRING("."));
|
||||
|
||||
// if LAMMPS_POTENTIALS environment variable is set, add it to PYTHONPATH as well
|
||||
const char * potentials_path = getenv("LAMMPS_POTENTIALS");
|
||||
// if LAMMPS_POTENTIALS environment variable is set,
|
||||
// add it to PYTHONPATH as well
|
||||
|
||||
const char *potentials_path = getenv("LAMMPS_POTENTIALS");
|
||||
if (potentials_path != nullptr) {
|
||||
PyList_Append(py_path, PY_STRING_FROM_STRING(potentials_path));
|
||||
}
|
||||
PyGILState_Release(gstate);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -64,9 +64,15 @@ int main(int argc, char **argv)
|
||||
exit(1);
|
||||
}
|
||||
#else
|
||||
try {
|
||||
LAMMPS *lammps = new LAMMPS(argc,argv,MPI_COMM_WORLD);
|
||||
lammps->input->file();
|
||||
delete lammps;
|
||||
} catch(fmt::format_error &fe) {
|
||||
fprintf(stderr,"fmt::format_error: %s\n", fe.what());
|
||||
MPI_Abort(MPI_COMM_WORLD, 1);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
MPI_Finalize();
|
||||
|
||||
@ -691,7 +691,7 @@ std::string utils::utf8_subst(const std::string &line)
|
||||
out += ' ', i += 2;
|
||||
}
|
||||
// UTF-8 4-byte character
|
||||
} else if ((in[i] & 0xe8U) == 0xf0U) {
|
||||
} else if ((in[i] & 0xf8U) == 0xf0U) {
|
||||
if ((i+3) < len) {
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user