19 std::vector<ProcessLib::ProcessVariable>
const& variables,
20 std::string
const&
name, std::string
const& tag)
23 auto variable = std::find_if(variables.cbegin(), variables.cend(),
25 { return v.getName() == name; });
27 if (variable == variables.end())
30 "There is no entry of the defined process variable '{:s}' in the "
31 "provided variables list (see tag <process_variables>). A "
32 "definition is required for config tag <{:s}>.",
35 DBUG(
"Found process variable '{:s}' for config tag <{:s}>.",
36 variable->getName(), tag);
46 std::vector<ProcessVariable>
const& variables,
56 std::vector<ProcessVariable>
const& variables,
58 std::initializer_list<std::string>
61 std::vector<std::reference_wrapper<ProcessVariable>> vars;
62 vars.reserve(variables.size());
64 if (variables.size() > tags.size())
65 DBUG(
"Found multiple process variables with a same tag.");
67 for (
auto& tag : tags)
70 vars.insert(vars.end(), vars_per_tag.begin(), vars_per_tag.end());
77 std::vector<ProcessVariable>
const& variables,
79 std::string
const& tag)
81 std::vector<std::reference_wrapper<ProcessVariable>> vars;
86 if (var_names.empty())
88 OGS_FATAL(
"No entity is found with config tag <{:s}>.", tag);
91 std::vector<std::string> cached_var_names;
93 for (std::string
const& var_name : var_names)
96 cached_var_names.push_back(var_name);
102 if (cached_var_names.size() != var_names.size())
104 OGS_FATAL(
"Found duplicates with config tag <{:s}>.", tag);
void DBUG(char const *fmt, Args const &... args)
T getConfigParameter(std::string const ¶m) const
Range< ValueIterator< T > > getConfigParameterList(std::string const ¶m) const
void makeVectorUnique(std::vector< T > &v)
ProcessVariable & findProcessVariable(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::string const &tag)
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
ProcessLib::ProcessVariable & findVariableByName(std::vector< ProcessLib::ProcessVariable > const &variables, std::string const &name, std::string const &tag)