rename utils::gridid_parse() to utils::parse_gridid()

This commit is contained in:
Axel Kohlmeyer
2022-08-18 17:33:29 -04:00
parent ccf6c2d55a
commit e4e7272c22
5 changed files with 14 additions and 20 deletions

View File

@ -205,7 +205,7 @@ Argument processing
.. doxygenfunction:: expand_args
:project: progguide
.. doxygenfunction:: gridid_parse
.. doxygenfunction:: parse_gridid
:project: progguide
Convenience functions

View File

@ -510,19 +510,15 @@ int DumpGrid::count()
if (dimension == 2) {
if (field2source[0] == COMPUTE)
grid2d = (Grid2d *)
compute[field2index[0]]->get_grid_by_index(field2grid[0]);
grid2d = (Grid2d *) compute[field2index[0]]->get_grid_by_index(field2grid[0]);
else if (field2source[0] == FIX)
grid2d = (Grid2d *)
fix[field2index[0]]->get_grid_by_index(field2grid[0]);
grid2d = (Grid2d *) fix[field2index[0]]->get_grid_by_index(field2grid[0]);
grid2d->get_bounds(nxlo_in,nxhi_in,nylo_in,nyhi_in);
} else {
if (field2source[0] == COMPUTE)
grid3d = (Grid3d *)
compute[field2index[0]]->get_grid_by_index(field2grid[0]);
grid3d = (Grid3d *) compute[field2index[0]]->get_grid_by_index(field2grid[0]);
else if (field2source[0] == FIX)
grid3d = (Grid3d *)
fix[field2index[0]]->get_grid_by_index(field2grid[0]);
grid3d = (Grid3d *) fix[field2index[0]]->get_grid_by_index(field2grid[0]);
grid3d->get_bounds(nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in);
}
@ -686,7 +682,7 @@ int DumpGrid::parse_fields(int narg, char **arg)
// split name = idcompute:gname:dname into 3 strings
auto words = utils::gridid_parse(FLERR,name,error);
auto words = utils::parse_gridid(FLERR,name,error);
const auto &idcompute = words[0];
const auto &gname = words[1];
const auto &dname = words[2];
@ -730,7 +726,7 @@ int DumpGrid::parse_fields(int narg, char **arg)
// split name = idfix:gname:dname into 3 strings
auto words = utils::gridid_parse(FLERR,name,error);
auto words = utils::parse_gridid(FLERR,name,error);
const auto &idfix = words[0];
const auto &gname = words[1];
const auto &dname = words[2];

View File

@ -322,7 +322,7 @@ FixAveGrid::FixAveGrid(LAMMPS *lmp, int narg, char **arg) :
for (int i = 0; i < nvalues; i++) {
if (which[i] == ArgInfo::COMPUTE) {
auto words = utils::gridid_parse(FLERR,ids[i],error);
auto words = utils::parse_gridid(FLERR,ids[i],error);
const auto &idcompute = words[0];
const auto &gname = words[1];
const auto &dname = words[2];
@ -360,7 +360,7 @@ FixAveGrid::FixAveGrid(LAMMPS *lmp, int narg, char **arg) :
} else if (which[i] == ArgInfo::FIX) {
auto words = utils::gridid_parse(FLERR,ids[i],error);
auto words = utils::parse_gridid(FLERR,ids[i],error);
const auto &idfix = words[0];
const auto &gname = words[1];
const auto &dname = words[2];

View File

@ -771,7 +771,7 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, int mod
return vector of 3 substrings
------------------------------------------------------------------------- */
std::vector<std::string> utils::gridid_parse(const char *file, int line, const std::string &name,
std::vector<std::string> utils::parse_gridid(const char *file, int line, const std::string &name,
Error *error)
{
auto words = Tokenizer(name, ":").as_vector();

View File

@ -361,15 +361,13 @@ namespace utils {
/*! Parse grid reference into 3 sub-strings
*
* Format of grid ID reference = id:gridname:dataname
* Format of grid ID reference = id:gname:dname
* Return vector with the 3 sub-strings
*
* \param name = grid reference
* \param id = ptr to 1st substring
* \param gridname = ptr to 2nd substring
* \param dataname = ptr to 3rd substring */
* \param name = complete grid ID
* \return std::vector<std::string> containing the 3 sub-strings */
std::vector<std::string> gridid_parse(const char *file, int line, const std::string &name,
std::vector<std::string> parse_gridid(const char *file, int line, const std::string &name,
Error *error);
/*! Make C-style copy of string in new storage