rename utils::gridid_parse() to utils::parse_gridid()
This commit is contained in:
@ -205,7 +205,7 @@ Argument processing
|
|||||||
.. doxygenfunction:: expand_args
|
.. doxygenfunction:: expand_args
|
||||||
:project: progguide
|
:project: progguide
|
||||||
|
|
||||||
.. doxygenfunction:: gridid_parse
|
.. doxygenfunction:: parse_gridid
|
||||||
:project: progguide
|
:project: progguide
|
||||||
|
|
||||||
Convenience functions
|
Convenience functions
|
||||||
|
|||||||
@ -510,19 +510,15 @@ int DumpGrid::count()
|
|||||||
|
|
||||||
if (dimension == 2) {
|
if (dimension == 2) {
|
||||||
if (field2source[0] == COMPUTE)
|
if (field2source[0] == COMPUTE)
|
||||||
grid2d = (Grid2d *)
|
grid2d = (Grid2d *) compute[field2index[0]]->get_grid_by_index(field2grid[0]);
|
||||||
compute[field2index[0]]->get_grid_by_index(field2grid[0]);
|
|
||||||
else if (field2source[0] == FIX)
|
else if (field2source[0] == FIX)
|
||||||
grid2d = (Grid2d *)
|
grid2d = (Grid2d *) fix[field2index[0]]->get_grid_by_index(field2grid[0]);
|
||||||
fix[field2index[0]]->get_grid_by_index(field2grid[0]);
|
|
||||||
grid2d->get_bounds(nxlo_in,nxhi_in,nylo_in,nyhi_in);
|
grid2d->get_bounds(nxlo_in,nxhi_in,nylo_in,nyhi_in);
|
||||||
} else {
|
} else {
|
||||||
if (field2source[0] == COMPUTE)
|
if (field2source[0] == COMPUTE)
|
||||||
grid3d = (Grid3d *)
|
grid3d = (Grid3d *) compute[field2index[0]]->get_grid_by_index(field2grid[0]);
|
||||||
compute[field2index[0]]->get_grid_by_index(field2grid[0]);
|
|
||||||
else if (field2source[0] == FIX)
|
else if (field2source[0] == FIX)
|
||||||
grid3d = (Grid3d *)
|
grid3d = (Grid3d *) fix[field2index[0]]->get_grid_by_index(field2grid[0]);
|
||||||
fix[field2index[0]]->get_grid_by_index(field2grid[0]);
|
|
||||||
grid3d->get_bounds(nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in);
|
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
|
// 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 &idcompute = words[0];
|
||||||
const auto &gname = words[1];
|
const auto &gname = words[1];
|
||||||
const auto &dname = words[2];
|
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
|
// 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 &idfix = words[0];
|
||||||
const auto &gname = words[1];
|
const auto &gname = words[1];
|
||||||
const auto &dname = words[2];
|
const auto &dname = words[2];
|
||||||
|
|||||||
@ -322,7 +322,7 @@ FixAveGrid::FixAveGrid(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
for (int i = 0; i < nvalues; i++) {
|
for (int i = 0; i < nvalues; i++) {
|
||||||
if (which[i] == ArgInfo::COMPUTE) {
|
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 &idcompute = words[0];
|
||||||
const auto &gname = words[1];
|
const auto &gname = words[1];
|
||||||
const auto &dname = words[2];
|
const auto &dname = words[2];
|
||||||
@ -360,7 +360,7 @@ FixAveGrid::FixAveGrid(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
} else if (which[i] == ArgInfo::FIX) {
|
} 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 &idfix = words[0];
|
||||||
const auto &gname = words[1];
|
const auto &gname = words[1];
|
||||||
const auto &dname = words[2];
|
const auto &dname = words[2];
|
||||||
|
|||||||
@ -771,7 +771,7 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, int mod
|
|||||||
return vector of 3 substrings
|
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)
|
Error *error)
|
||||||
{
|
{
|
||||||
auto words = Tokenizer(name, ":").as_vector();
|
auto words = Tokenizer(name, ":").as_vector();
|
||||||
|
|||||||
10
src/utils.h
10
src/utils.h
@ -361,15 +361,13 @@ namespace utils {
|
|||||||
|
|
||||||
/*! Parse grid reference into 3 sub-strings
|
/*! 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
|
* Return vector with the 3 sub-strings
|
||||||
*
|
*
|
||||||
* \param name = grid reference
|
* \param name = complete grid ID
|
||||||
* \param id = ptr to 1st substring
|
* \return std::vector<std::string> containing the 3 sub-strings */
|
||||||
* \param gridname = ptr to 2nd substring
|
|
||||||
* \param dataname = ptr to 3rd substring */
|
|
||||||
|
|
||||||
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);
|
Error *error);
|
||||||
|
|
||||||
/*! Make C-style copy of string in new storage
|
/*! Make C-style copy of string in new storage
|
||||||
|
|||||||
Reference in New Issue
Block a user