LCOV - code coverage report
Current view: top level - src/utils - InputParameters.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 768 927 82.8 %
Date: 2026-05-29 20:35:17 Functions: 123 143 86.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "InputParameters.h"
      11             : 
      12             : // MOOSE includes
      13             : #include "MooseEnum.h"
      14             : #include "MooseTypes.h"
      15             : #include "MooseUtils.h"
      16             : #include "MultiMooseEnum.h"
      17             : #include "ExecFlagEnum.h"
      18             : #include "MooseObject.h"
      19             : #include "MooseApp.h"
      20             : 
      21             : #include "libmesh/utility.h"
      22             : #include "libmesh/simple_range.h"
      23             : 
      24             : #include "pcrecpp.h"
      25             : #include "hit/parse.h"
      26             : 
      27             : #include <cmath>
      28             : #include <filesystem>
      29             : 
      30             : InputParameters
      31    67030200 : emptyInputParameters()
      32             : {
      33    67030200 :   InputParameters params;
      34    67030200 :   return params;
      35             : }
      36             : 
      37    67030200 : InputParameters::InputParameters()
      38             :   : Parameters(),
      39    67030200 :     _collapse_nesting(false),
      40    67030200 :     _moose_object_syntax_visibility(true),
      41    67030200 :     _show_deprecated_message(true),
      42    67030200 :     _allow_copy(true),
      43    67030200 :     _hit_node(nullptr),
      44    67030200 :     _finalized(false)
      45             : {
      46    67030200 : }
      47             : 
      48     8541971 : InputParameters::InputParameters(const InputParameters & rhs)
      49     8541971 :   : Parameters(), _show_deprecated_message(true), _allow_copy(true)
      50             : {
      51     8541971 :   *this = rhs;
      52     8541968 : }
      53             : 
      54           0 : InputParameters::InputParameters(const Parameters & rhs)
      55           0 :   : _show_deprecated_message(true), _allow_copy(true)
      56             : {
      57           0 :   _params.clear();
      58           0 :   Parameters::operator=(rhs);
      59           0 :   _collapse_nesting = false;
      60           0 :   _moose_object_syntax_visibility = true;
      61           0 : }
      62             : 
      63             : void
      64           0 : InputParameters::clear()
      65             : {
      66           0 :   Parameters::clear();
      67           0 :   _params.clear();
      68           0 :   _coupled_vars.clear();
      69           0 :   _new_to_deprecated_coupled_vars.clear();
      70           0 :   _collapse_nesting = false;
      71           0 :   _moose_object_syntax_visibility = true;
      72           0 :   _show_deprecated_message = true;
      73           0 :   _allow_copy = true;
      74           0 :   _old_to_new_name_and_dep.clear();
      75           0 :   _new_to_old_names.clear();
      76           0 :   _hit_node = nullptr;
      77           0 :   _finalized = false;
      78           0 : }
      79             : 
      80             : void
      81    20363077 : InputParameters::addClassDescription(const std::string & doc_string)
      82             : {
      83    20363077 :   _class_description = doc_string;
      84    20363077 : }
      85             : 
      86             : void
      87   562250424 : InputParameters::set_attributes(const std::string & name_in, bool inserted_only)
      88             : {
      89   562250424 :   const auto name = checkForRename(name_in);
      90             : 
      91   562250424 :   if (!inserted_only)
      92             :   {
      93   374408824 :     auto & metadata = _params[name];
      94             :     /**
      95             :      * "._set_by_add_param" and ".deprecated_params" are not populated until after
      96             :      * the default value has already been set in libMesh (first callback to this
      97             :      * method). Therefore if a variable is in/not in one of these sets, you can
      98             :      * be assured it was put there outside of the "addParam*()" calls.
      99             :      */
     100   374408824 :     metadata._set_by_add_param = false;
     101             : 
     102             :     // valid_params don't make sense for MooseEnums
     103   374408824 :     if (!have_parameter<MooseEnum>(name) && !have_parameter<MultiMooseEnum>(name))
     104   353467818 :       metadata._valid = true;
     105             :   }
     106   562250424 : }
     107             : 
     108             : std::optional<std::string>
     109     2577158 : InputParameters::queryDeprecatedParamMessage(const std::string & name_in) const
     110             : {
     111     2577158 :   const auto name = checkForRename(name_in);
     112     2577158 :   if (_show_deprecated_message)
     113             :   {
     114        1024 :     auto deprecation_message = [this](const auto & name, const auto & message) -> std::string
     115        1024 :     { return paramMessagePrefix(name) + message; };
     116             : 
     117     2577158 :     if (_params.count(name) && !libmesh_map_find(_params, name)._deprecation_message.empty())
     118        1462 :       return deprecation_message(name,
     119        1462 :                                  "The parameter '" + name + "' is deprecated.\n" +
     120        1462 :                                      libmesh_map_find(_params, name)._deprecation_message);
     121     2576427 :     else if (auto it = _old_to_new_name_and_dep.find(name_in);
     122     2576427 :              it != _old_to_new_name_and_dep.end() && !it->second.second.empty())
     123         293 :       return deprecation_message(name_in, it->second.second);
     124             :   }
     125     2576134 :   return {};
     126     2577158 : }
     127             : 
     128             : std::string
     129      760452 : InputParameters::getClassDescription() const
     130             : {
     131      760452 :   return _class_description;
     132             : }
     133             : 
     134             : InputParameters &
     135    10045965 : InputParameters::operator=(const InputParameters & rhs)
     136             : {
     137             :   // An error to help minimize the segmentation faults that occure when MooseObjects do not have the
     138             :   // correct constructor
     139    10045965 :   if (!rhs._allow_copy)
     140             :   {
     141             :     // If _allow_parameter_copy is set, these should be too (see
     142             :     // InputParameterWarehouse::addInputParameters)
     143           3 :     const std::string & name = rhs.getObjectName();
     144           3 :     const std::string & type = rhs.getObjectType(); // could be empty
     145           3 :     const std::string name_example = type.size() ? type : "the " + name + " object";
     146           3 :     const std::string type_example = type.size() ? type : "MyObject";
     147           3 :     ::mooseError(
     148             :         "Copying of the InputParameters object for ",
     149             :         name_example,
     150             :         " is not allowed.\n\nThe likely cause for this error ",
     151             :         "is having a constructor that does not use a const reference, all constructors\nfor "
     152             :         "MooseObject based classes should be as follows:\n\n",
     153             :         "    ",
     154             :         type_example,
     155             :         "::",
     156             :         type_example,
     157             :         "(const InputParameters & parameters);");
     158           0 :   }
     159             : 
     160    10045962 :   Parameters::operator=(rhs);
     161             : 
     162    10045962 :   _params = rhs._params;
     163             : 
     164    10045962 :   _buildable_types = rhs._buildable_types;
     165    10045962 :   _buildable_rm_types = rhs._buildable_rm_types;
     166    10045962 :   _collapse_nesting = rhs._collapse_nesting;
     167    10045962 :   _moose_object_syntax_visibility = rhs._moose_object_syntax_visibility;
     168    10045962 :   _coupled_vars = rhs._coupled_vars;
     169    10045962 :   _new_to_deprecated_coupled_vars = rhs._new_to_deprecated_coupled_vars;
     170    10045962 :   _allow_copy = rhs._allow_copy;
     171    10045962 :   _old_to_new_name_and_dep = rhs._old_to_new_name_and_dep;
     172    10045962 :   _new_to_old_names = rhs._new_to_old_names;
     173    10045962 :   _hit_node = rhs._hit_node;
     174    10045962 :   _finalized = false;
     175             : 
     176    10045962 :   return *this;
     177             : }
     178             : 
     179             : InputParameters &
     180    47678540 : InputParameters::operator+=(const InputParameters & rhs)
     181             : {
     182    47678540 :   Parameters::operator+=(rhs);
     183             : 
     184             :   // TODO: this is not a proper merge - if a particular parameter exists in both this and rhs,
     185             :   // then we should actually smartly merge both metadata structs before storing in this.
     186   148715648 :   for (auto it = rhs._params.begin(); it != rhs._params.end(); ++it)
     187   101037108 :     _params[it->first] = it->second;
     188             : 
     189    95357080 :   _buildable_types.insert(
     190    47678540 :       _buildable_types.end(), rhs._buildable_types.begin(), rhs._buildable_types.end());
     191    95357080 :   _buildable_rm_types.insert(
     192    47678540 :       _buildable_rm_types.end(), rhs._buildable_rm_types.begin(), rhs._buildable_rm_types.end());
     193             : 
     194             :   // Collapse nesting and moose object syntax hiding are not modified with +=
     195    47678540 :   _coupled_vars.insert(rhs._coupled_vars.begin(), rhs._coupled_vars.end());
     196    47678540 :   _new_to_deprecated_coupled_vars.insert(rhs._new_to_deprecated_coupled_vars.begin(),
     197             :                                          rhs._new_to_deprecated_coupled_vars.end());
     198             : 
     199    47678540 :   _old_to_new_name_and_dep.insert(rhs._old_to_new_name_and_dep.begin(),
     200             :                                   rhs._old_to_new_name_and_dep.end());
     201    47678540 :   _new_to_old_names.insert(rhs._new_to_old_names.begin(), rhs._new_to_old_names.end());
     202    47678540 :   return *this;
     203             : }
     204             : 
     205             : void
     206     1825940 : InputParameters::setDeprecatedVarDocString(const std::string & new_name,
     207             :                                            const std::string & doc_string)
     208             : {
     209     1825940 :   auto coupled_vars_it = _new_to_deprecated_coupled_vars.find(new_name);
     210     1825940 :   if (coupled_vars_it != _new_to_deprecated_coupled_vars.end())
     211             :   {
     212           0 :     auto params_it = _params.find(coupled_vars_it->second);
     213           0 :     if (params_it == _params.end())
     214           0 :       mooseError("There must have been a mistake in the construction of the new to deprecated "
     215             :                  "coupled vars map because the old name ",
     216           0 :                  coupled_vars_it->second,
     217             :                  " doesn't exist in the parameters data.");
     218             : 
     219           0 :     params_it->second._doc_string = doc_string;
     220             :   }
     221     1825940 : }
     222             : 
     223             : void
     224       82821 : InputParameters::addCoupledVar(const std::string & name, Real value, const std::string & doc_string)
     225             : {
     226       82821 :   addParam<std::vector<VariableName>>(name, doc_string);
     227       82821 :   _coupled_vars.insert(name);
     228       82821 :   auto & metadata = _params[name];
     229       82821 :   metadata._coupled_default.assign(1, value);
     230       82821 :   metadata._have_coupled_default = true;
     231             : 
     232             :   // Set the doc string for any associated deprecated coupled var
     233       82821 :   setDeprecatedVarDocString(name, doc_string);
     234       82821 : }
     235             : 
     236             : void
     237       25721 : InputParameters::addCoupledVar(const std::string & name,
     238             :                                const std::vector<Real> & value,
     239             :                                const std::string & doc_string)
     240             : {
     241             :   // std::vector<VariableName>(1, Moose::stringify(value)),
     242       25721 :   addParam<std::vector<VariableName>>(name, doc_string);
     243       25721 :   _coupled_vars.insert(name);
     244       25721 :   auto & metadata = _params[name];
     245       25721 :   metadata._coupled_default = value;
     246       25721 :   metadata._have_coupled_default = true;
     247             : 
     248             :   // Set the doc string for any associated deprecated coupled var
     249       25721 :   setDeprecatedVarDocString(name, doc_string);
     250       25721 : }
     251             : 
     252             : void
     253     1717398 : InputParameters::addCoupledVar(const std::string & name, const std::string & doc_string)
     254             : {
     255     1717398 :   addParam<std::vector<VariableName>>(name, doc_string);
     256     1717398 :   _coupled_vars.insert(name);
     257             : 
     258             :   // Set the doc string for any associated deprecated coupled var
     259     1717398 :   setDeprecatedVarDocString(name, doc_string);
     260     1717398 : }
     261             : 
     262             : void
     263           0 : InputParameters::addDeprecatedCoupledVar(const std::string & old_name,
     264             :                                          const std::string & new_name,
     265             :                                          const std::string & removal_date /*=""*/)
     266             : {
     267           0 :   mooseDeprecated("Please use 'deprecateCoupledVar'");
     268             : 
     269           0 :   _show_deprecated_message = false;
     270             : 
     271             :   // Set the doc string if we are adding the deprecated var after the new var has already been added
     272           0 :   auto params_it = _params.find(new_name);
     273           0 :   std::string doc_string;
     274           0 :   if (params_it != _params.end())
     275           0 :     doc_string = params_it->second._doc_string;
     276             : 
     277           0 :   addParam<std::vector<VariableName>>(old_name, doc_string);
     278           0 :   _coupled_vars.insert(old_name);
     279           0 :   _new_to_deprecated_coupled_vars.emplace(new_name, old_name);
     280             : 
     281             :   std::string deprecation_message =
     282           0 :       "The coupled variable parameter '" + old_name + "' has been deprecated";
     283           0 :   if (!removal_date.empty())
     284           0 :     deprecation_message += " and will be removed " + removal_date;
     285           0 :   deprecation_message += ". Please use the '" + new_name + "' coupled variable parameter instead.";
     286           0 :   _params[old_name]._deprecation_message = deprecation_message;
     287           0 :   _show_deprecated_message = true;
     288           0 : }
     289             : 
     290             : void
     291           4 : InputParameters::addCoupledVarWithAutoBuild(const std::string & name,
     292             :                                             const std::string & base_name,
     293             :                                             const std::string & num_name,
     294             :                                             const std::string & doc_string)
     295             : {
     296           4 :   addParam<std::vector<VariableName>>(name, doc_string);
     297           4 :   _coupled_vars.insert(name);
     298           4 :   _params[name]._autobuild_vecs = std::make_pair(base_name, num_name);
     299             : 
     300             :   // Additionally there are two more parameters that need to be added:
     301           4 :   addParam<std::string>(base_name, doc_string + " (base_name)");
     302           4 :   addParam<unsigned int>(num_name, doc_string + " (num_name)");
     303           4 : }
     304             : 
     305             : void
     306           4 : InputParameters::addRequiredCoupledVarWithAutoBuild(const std::string & name,
     307             :                                                     const std::string & base_name,
     308             :                                                     const std::string & num_name,
     309             :                                                     const std::string & doc_string)
     310             : {
     311           4 :   addRequiredParam<std::vector<VariableName>>(name, doc_string);
     312             : 
     313           4 :   addCoupledVarWithAutoBuild(name, base_name, num_name, doc_string);
     314           4 : }
     315             : 
     316             : void
     317     1136707 : InputParameters::addRequiredCoupledVar(const std::string & name, const std::string & doc_string)
     318             : {
     319     1136707 :   addRequiredParam<std::vector<VariableName>>(name, doc_string);
     320     1136707 :   _coupled_vars.insert(name);
     321     1136707 : }
     322             : 
     323             : std::string
     324     6169902 : InputParameters::getDocString(const std::string & name_in) const
     325             : {
     326     6169902 :   const auto name = checkForRename(name_in);
     327             : 
     328     6169902 :   std::string doc_string;
     329     6169902 :   auto it = _params.find(name);
     330     6169902 :   if (it != _params.end())
     331   434995036 :     for (const auto & ch : it->second._doc_string)
     332             :     {
     333   428825134 :       if (ch == '\n')
     334           0 :         doc_string += " ... ";
     335             :       else
     336   428825134 :         doc_string += ch;
     337             :     }
     338             : 
     339    12339804 :   return doc_string;
     340     6169902 : }
     341             : 
     342             : void
     343     1988882 : InputParameters::setDocString(const std::string & name_in, const std::string & doc)
     344             : {
     345     1988882 :   const auto name = checkForRename(name_in);
     346             : 
     347     1988882 :   auto it = _params.find(name);
     348     1988882 :   if (it == _params.end())
     349           2 :     mooseError("Unable to set the documentation string (using setDocString) for the \"",
     350             :                name,
     351             :                "\" parameter, the parameter does not exist.");
     352     1988880 :   it->second._doc_string = doc;
     353     1988882 : }
     354             : 
     355             : std::string
     356     1171057 : InputParameters::getDocUnit(const std::string & name_in) const
     357             : {
     358     1171057 :   const auto name = checkForRename(name_in);
     359     2342114 :   return _params.at(name)._doc_unit;
     360     1171057 : }
     361             : 
     362             : void
     363      675100 : InputParameters::setDocUnit(const std::string & name_in, const std::string & doc_unit)
     364             : {
     365      675100 :   const auto name = checkForRename(name_in);
     366      675100 :   _params[name]._doc_unit = doc_unit;
     367      675100 : }
     368             : 
     369             : bool
     370    59805727 : InputParameters::isParamRequired(const std::string & name_in) const
     371             : {
     372    59805727 :   const auto name = checkForRename(name_in);
     373   119611454 :   return _params.count(name) > 0 && _params.at(name)._required;
     374    59805727 : }
     375             : 
     376             : void
     377        6498 : InputParameters::makeParamNotRequired(const std::string & name_in)
     378             : {
     379        6498 :   const auto name = checkForRename(name_in);
     380             : 
     381        6498 :   if (_params.count(name))
     382        6494 :     _params[name]._required = false;
     383        6498 : }
     384             : 
     385             : bool
     386   341919794 : InputParameters::isParamValid(const std::string & name_in) const
     387             : {
     388   341919794 :   const auto name = checkForRename(name_in);
     389   341919794 :   if (have_parameter<MooseEnum>(name))
     390     6770817 :     return get<MooseEnum>(name).isValid();
     391   335148977 :   else if (have_parameter<std::vector<MooseEnum>>(name))
     392             :   {
     393       10723 :     for (auto it = get<std::vector<MooseEnum>>(name).begin();
     394       22075 :          it != get<std::vector<MooseEnum>>(name).end();
     395       11352 :          ++it)
     396       11356 :       if (!it->isValid())
     397           4 :         return false;
     398       10719 :     return true;
     399             :   }
     400   335138254 :   else if (have_parameter<MultiMooseEnum>(name))
     401     1663424 :     return get<MultiMooseEnum>(name).isValid();
     402   333474830 :   else if (have_parameter<std::vector<MultiMooseEnum>>(name))
     403             :   {
     404          84 :     for (auto it = get<std::vector<MultiMooseEnum>>(name).begin();
     405         324 :          it != get<std::vector<MultiMooseEnum>>(name).end();
     406         240 :          ++it)
     407         264 :       if (!it->isValid())
     408          24 :         return false;
     409          60 :     return true;
     410             :   }
     411   333474746 :   else if (have_parameter<ExecFlagEnum>(name))
     412     6420249 :     return get<ExecFlagEnum>(name).isValid();
     413             :   else
     414   327054497 :     return _params.count(name) > 0 && _params.at(name)._valid;
     415   341919794 : }
     416             : 
     417             : bool
     418     3759518 : InputParameters::isParamSetByAddParam(const std::string & name_in) const
     419             : {
     420     3759518 :   const auto name = checkForRename(name_in);
     421     7519036 :   return _params.count(name) > 0 && _params.at(name)._set_by_add_param;
     422     3759518 : }
     423             : 
     424             : bool
     425      758067 : InputParameters::isParamDeprecated(const std::string & name_in) const
     426             : {
     427      758067 :   const auto name = checkForRename(name_in);
     428     1516134 :   return _params.count(name) > 0 && !_params.at(name)._deprecation_message.empty();
     429      758067 : }
     430             : 
     431             : #ifdef MOOSE_KOKKOS_ENABLED
     432             : bool
     433     1582175 : InputParameters::isKokkosObject() const
     434             : {
     435     1582175 :   return isParamValid(MooseBase::kokkos_object_param);
     436             : }
     437             : #endif
     438             : 
     439             : bool
     440     2260996 : InputParameters::areAllRequiredParamsValid() const
     441             : {
     442    37995940 :   for (const auto & it : *this)
     443    35849255 :     if (isParamRequired(it.first) && !isParamValid(it.first))
     444      114311 :       return false;
     445     2146685 :   return true;
     446             : }
     447             : 
     448             : bool
     449   169172570 : InputParameters::isPrivate(const std::string & name_in) const
     450             : {
     451   169172570 :   const auto name = checkForRename(name_in);
     452   338345140 :   return _params.count(name) > 0 && _params.at(name)._is_private;
     453   169172570 : }
     454             : 
     455             : void
     456     6030435 : InputParameters::declareControllable(const std::string & input_names,
     457             :                                      std::set<ExecFlagType> execute_flags)
     458             : {
     459     6030435 :   std::vector<std::string> names;
     460     6030435 :   MooseUtils::tokenize<std::string>(input_names, names, 1, " ");
     461    12090973 :   for (auto & name_in : names)
     462             :   {
     463     6060540 :     const auto name = checkForRename(name_in);
     464     6060540 :     auto map_iter = _params.find(name);
     465     6060540 :     if (map_iter != _params.end()) // error is handled by checkParams method
     466             :     {
     467     6060538 :       map_iter->second._controllable = true;
     468     6060538 :       map_iter->second._controllable_flags = execute_flags;
     469             :     }
     470             :     else
     471           2 :       mooseError("The input parameter '",
     472             :                  name,
     473             :                  "' does not exist, thus cannot be marked as controllable.");
     474     6060540 :   }
     475     6030435 : }
     476             : 
     477             : bool
     478   131735989 : InputParameters::isControllable(const std::string & name_in) const
     479             : {
     480   131735989 :   const auto name = checkForRename(name_in);
     481   263471978 :   return _params.count(name) > 0 && _params.at(name)._controllable;
     482   131735989 : }
     483             : 
     484             : const std::set<ExecFlagType> &
     485     1380240 : InputParameters::getControllableExecuteOnTypes(const std::string & name_in) const
     486             : {
     487     1380240 :   const auto name = checkForRename(name_in);
     488     2760480 :   return at(name)._controllable_flags;
     489     1380240 : }
     490             : 
     491             : void
     492    20924561 : InputParameters::registerBase(const std::string & value)
     493             : {
     494    20924561 :   InputParameters::set<std::string>(MooseBase::moose_base_param) = value;
     495    20924561 :   _params[MooseBase::moose_base_param]._is_private = true;
     496    20924561 : }
     497             : 
     498             : bool
     499     6491438 : InputParameters::hasBase() const
     500             : {
     501     6491438 :   return have_parameter<std::string>(MooseBase::moose_base_param);
     502             : }
     503             : 
     504             : const std::string &
     505    13199971 : InputParameters::getBase() const
     506             : {
     507    13199971 :   if (!have_parameter<std::string>(MooseBase::moose_base_param))
     508           0 :     mooseError("InputParameters::getBase(): Parameters do not have base; one needs to be set with "
     509             :                "registerBase()");
     510    13199971 :   return get<std::string>(MooseBase::moose_base_param);
     511             : }
     512             : 
     513             : void
     514     4024557 : InputParameters::registerSystemAttributeName(const std::string & value)
     515             : {
     516     4024557 :   InputParameters::set<std::string>("_moose_warehouse_system_name") = value;
     517     8049114 :   _params["_moose_warehouse_system_name"]._is_private = true;
     518     4024557 : }
     519             : 
     520             : const std::string &
     521      302704 : InputParameters::getSystemAttributeName() const
     522             : {
     523             :   mooseAssert(have_parameter<std::string>("_moose_warehouse_system_name"),
     524             :               "SystemAttributeName is not available! Call 'registerSystemAttributeName' (usually "
     525             :               "in the validParams function) before you try accessing it!");
     526      302704 :   return Parameters::get<std::string>("_moose_warehouse_system_name");
     527             : }
     528             : 
     529             : void
     530           0 : InputParameters::registerBuildableTypes(const std::string & names)
     531             : {
     532           0 :   _buildable_types.clear();
     533           0 :   MooseUtils::tokenize(names, _buildable_types, 1, " \t\n\v\f\r"); // tokenize on whitespace
     534           0 : }
     535             : 
     536             : void
     537     2247801 : InputParameters::addRelationshipManager(
     538             :     const std::string & name,
     539             :     Moose::RelationshipManagerType rm_type,
     540             :     Moose::RelationshipManagerInputParameterCallback input_parameter_callback)
     541             : {
     542     2247801 :   _buildable_rm_types.emplace_back(name, rm_type, input_parameter_callback);
     543     2247801 : }
     544             : 
     545             : const std::vector<std::string> &
     546     5094879 : InputParameters::getBuildableTypes() const
     547             : {
     548     5094879 :   return _buildable_types;
     549             : }
     550             : 
     551             : const std::vector<std::tuple<std::string,
     552             :                              Moose::RelationshipManagerType,
     553             :                              Moose::RelationshipManagerInputParameterCallback>> &
     554     2885065 : InputParameters::getBuildableRelationshipManagerTypes() const
     555             : {
     556     2885065 :   return _buildable_rm_types;
     557             : }
     558             : 
     559             : void
     560           0 : InputParameters::collapseSyntaxNesting(bool collapse)
     561             : {
     562           0 :   _collapse_nesting = collapse;
     563           0 : }
     564             : 
     565             : bool
     566       98527 : InputParameters::collapseSyntaxNesting() const
     567             : {
     568       98527 :   return _collapse_nesting;
     569             : }
     570             : 
     571             : void
     572           0 : InputParameters::mooseObjectSyntaxVisibility(bool visibility)
     573             : {
     574           0 :   _moose_object_syntax_visibility = visibility;
     575           0 : }
     576             : 
     577             : bool
     578      111731 : InputParameters::mooseObjectSyntaxVisibility() const
     579             : {
     580      111731 :   return _moose_object_syntax_visibility;
     581             : }
     582             : 
     583             : #define checkMooseType(param_type, name)                                                           \
     584             :   if (have_parameter<param_type>(name) || have_parameter<std::vector<param_type>>(name))           \
     585             :     error = "non-controllable type '" + type(name) + "' for parameter '" +                         \
     586             :             paramFullpath(param_name) + "' marked controllable";
     587             : 
     588             : void
     589     5497193 : InputParameters::checkParams(const std::string & parsing_syntax)
     590             : {
     591     5497193 :   const std::string parampath = blockFullpath() != "" ? blockFullpath() : parsing_syntax;
     592             : 
     593             :   // Required parameters
     594     5497193 :   std::vector<std::string> required_param_errors;
     595   142789681 :   for (const auto & it : *this)
     596             :   {
     597   137292488 :     const auto param_name = checkForRename(it.first);
     598   137292488 :     if (!isParamValid(param_name) && isParamRequired(param_name))
     599             :     {
     600             :       // check if an old, deprecated name exists for this parameter that may be specified
     601          29 :       auto oit = _new_to_deprecated_coupled_vars.find(param_name);
     602          29 :       if (oit != _new_to_deprecated_coupled_vars.end() && isParamValid(oit->second))
     603           0 :         continue;
     604             : 
     605          87 :       required_param_errors.push_back("missing required parameter '" + parampath + "/" +
     606          58 :                                       param_name + "'\n\tDoc String: \"" +
     607         116 :                                       getDocString(param_name) + "\"");
     608             :     }
     609   137292488 :   }
     610             : 
     611     5497193 :   if (required_param_errors.size())
     612          33 :     mooseError(MooseUtils::stringJoin(required_param_errors, "\n"));
     613             : 
     614             :   // Range checked parameters
     615   142788562 :   for (const auto & [name, param_ptr] : *this)
     616             :   {
     617   137291400 :     if (const auto error = parameterRangeCheck(*param_ptr, parampath + "/" + name, name, false))
     618             :     {
     619           2 :       if (error->first)
     620           4 :         paramError(name, error->second);
     621             :       else
     622           0 :         mooseError("For range checked parameter '" + name + "': " + error->second);
     623   137291400 :     }
     624             :   }
     625             : 
     626             :   // Controllable parameters
     627     6392816 :   for (const auto & param_name : getControllableParameters())
     628             :   {
     629      895658 :     if (isPrivate(param_name))
     630           2 :       paramError(param_name,
     631          10 :                  "private parameter '" + paramFullpath(param_name) + "' marked controllable");
     632             : 
     633      895656 :     std::optional<std::string> error;
     634      895656 :     checkMooseType(NonlinearVariableName, param_name);
     635      895656 :     checkMooseType(AuxVariableName, param_name);
     636      895656 :     checkMooseType(VariableName, param_name);
     637      895656 :     checkMooseType(BoundaryName, param_name);
     638      895656 :     checkMooseType(SubdomainName, param_name);
     639      895656 :     checkMooseType(PostprocessorName, param_name);
     640      895656 :     checkMooseType(VectorPostprocessorName, param_name);
     641      895656 :     checkMooseType(UserObjectName, param_name);
     642      895656 :     checkMooseType(MaterialPropertyName, param_name);
     643      895656 :     if (error)
     644           4 :       paramError(param_name, *error);
     645     6392818 :   }
     646     5497174 : }
     647             : 
     648             : std::optional<std::pair<bool, std::string>>
     649   137307975 : InputParameters::parameterRangeCheck(const Parameters::Value & value,
     650             :                                      const std::string & long_name,
     651             :                                      const std::string & short_name,
     652             :                                      const bool include_param_path)
     653             : {
     654             : #define dynamicCastRangeCheck(type, up_type, long_name, short_name)                                \
     655             :   do                                                                                               \
     656             :   {                                                                                                \
     657             :     if (const auto scalar_p = dynamic_cast<const InputParameters::Parameter<type> *>(&value))      \
     658             :       return rangeCheck<type, up_type>(long_name, short_name, *scalar_p, include_param_path);      \
     659             :     if (const auto vector_p =                                                                      \
     660             :             dynamic_cast<const InputParameters::Parameter<std::vector<type>> *>(&value))           \
     661             :       return rangeCheck<type, up_type>(long_name, short_name, *vector_p, include_param_path);      \
     662             :   } while (0)
     663             : 
     664   137307975 :   dynamicCastRangeCheck(Real, Real, long_name, short_name);
     665   130151129 :   dynamicCastRangeCheck(int, long, long_name, short_name);
     666   129455630 :   dynamicCastRangeCheck(long, long, long_name, short_name);
     667   129455578 :   dynamicCastRangeCheck(unsigned int, long, long_name, short_name);
     668             : #undef dynamicCastRangeCheck
     669             : 
     670   119703417 :   return {};
     671             : }
     672             : 
     673             : void
     674     5463475 : InputParameters::finalize(const std::string & parsing_syntax)
     675             : {
     676             :   mooseAssert(!isFinalized(), "Already finalized");
     677             : 
     678     5463475 :   checkParams(parsing_syntax);
     679             : 
     680             :   // Set parameters that represent file types
     681   141883762 :   for (const auto & name_value : *this)
     682             :   {
     683   136420340 :     const auto & param_name = name_value.first;
     684   136420340 :     const auto & param_value = name_value.second;
     685             : 
     686             :     // Helper for setting a file typed parameter value
     687      252287 :     const auto set_filename = [&](auto & value)
     688             :     {
     689      252287 :       constexpr bool is_data_file_name =
     690             :           std::is_same_v<std::decay_t<decltype(value)>, DataFileName>;
     691             : 
     692             :       // We have behavior (which is gross) that requires that for
     693             :       // everything but DataFileName, if the value is empty we
     694             :       // don't bother looking for it
     695             :       if constexpr (!is_data_file_name)
     696             :       {
     697      252119 :         if (value.empty())
     698      231280 :           return;
     699             :       }
     700             : 
     701             :       // Setup options for searching for the path
     702       21007 :       Moose::DataFileUtils::GetPathOptions options;
     703             :       // Associate relative path searches with the folder
     704             :       // that input file that has this parameter is located
     705       21007 :       options.base = getFileBase(param_name);
     706             :       // If we don't explicitly have a DataFileName parameter,
     707             :       // we only want to augment cases where a data name is
     708             :       // explicitly set (like moose:file). We don't want to
     709             :       // search all other data. To presere previous behavior,
     710             :       // we also don't want to error if nothing is found; for
     711             :       // example if a relative or absolute path is not found.
     712             :       // The only time we'll error is if the data name is
     713             :       // explicitly set and the path doesn't exist in the data
     714             :       // or if that data name isn't registered.
     715             :       if constexpr (!is_data_file_name)
     716             :       {
     717       20839 :         options.search_all_data = false;
     718       20839 :         options.graceful = true;
     719             :       }
     720             : 
     721       21007 :       Moose::DataFileUtils::Path path;
     722             :       try
     723             :       {
     724       21007 :         Moose::ScopedThrowOnError scoped_throw_on_error;
     725       21034 :         path = Moose::DataFileUtils::getPath(value, options);
     726       21007 :       }
     727          51 :       catch (std::exception & e)
     728             :       {
     729          27 :         paramError(param_name, e.what());
     730             :       }
     731             : 
     732       20980 :       value = path.path;
     733       20980 :       at(param_name)._data_file_name_path = path;
     734   136441368 :     };
     735             : 
     736             : #define set_if_filename(type)                                                                      \
     737             :   else if (auto type_value = dynamic_cast<Parameters::Parameter<type> *>(param_value.get()))       \
     738             :       set_filename(type_value->set());                                                             \
     739             :   else if (auto type_values = dynamic_cast<Parameters::Parameter<std::vector<type>> *>(            \
     740             :                param_value.get())) for (auto & value : type_values->set()) set_filename(value)
     741             : 
     742             :     if (false)
     743             :       ;
     744   136429732 :     set_if_filename(FileName);
     745   136323581 :     set_if_filename(FileNameNoExtension);
     746   136200394 :     set_if_filename(MeshFileName);
     747   136154428 :     set_if_filename(MatrixFileName);
     748   136152091 :     set_if_filename(DataFileName);
     749             : #undef set_if_filename
     750             :   }
     751             : 
     752     5463422 :   _finalized = true;
     753     5463422 : }
     754             : 
     755             : std::filesystem::path
     756       21007 : InputParameters::getFileBase(const std::optional<std::string> & param_name) const
     757             : {
     758             :   mooseAssert(!have_parameter<std::string>("_app_name"),
     759             :               "Not currently setup to work with app FileName parameters");
     760             : 
     761       21007 :   const hit::Node * hit_node = nullptr;
     762             : 
     763             :   // Context from the individual parameter
     764       21007 :   if (param_name)
     765       21007 :     hit_node = getHitNode(*param_name);
     766             :   // Context from the parameters
     767       21007 :   if (!hit_node)
     768        1193 :     hit_node = getHitNode();
     769             :   // No hit node, so use the cwd (no input files)
     770       21007 :   if (!hit_node)
     771         390 :     return std::filesystem::current_path();
     772             : 
     773             :   // Find any context that isn't command line arguments
     774       21231 :   while (hit_node && hit_node->filename() == "CLI_ARGS")
     775         614 :     hit_node = hit_node->parent();
     776             : 
     777             :   // Failed to find a node up the tree that isn't a command line argument
     778       20617 :   if (!hit_node)
     779             :   {
     780             :     const std::string error = "Input context was set via a command-line argument and does not have "
     781           0 :                               "sufficient context for determining a file path.";
     782           0 :     if (param_name)
     783           0 :       paramError(*param_name, error);
     784             :     else
     785           0 :       mooseError(error);
     786           0 :   }
     787             : 
     788       20617 :   return std::filesystem::absolute(std::filesystem::path(hit_node->filename()).parent_path());
     789             : }
     790             : 
     791             : bool
     792     7978844 : InputParameters::isRangeChecked(const std::string & param_name) const
     793             : {
     794     7978844 :   const auto name = checkForRename(param_name);
     795    15957688 :   return !_params.find(name)->second._range_function.empty();
     796     7978844 : }
     797             : 
     798             : std::string
     799       16136 : InputParameters::rangeCheckedFunction(const std::string & param_name) const
     800             : {
     801       16136 :   const auto name = checkForRename(param_name);
     802       32272 :   return _params.at(name)._range_function;
     803       16136 : }
     804             : 
     805             : bool
     806     3363682 : InputParameters::hasDefault(const std::string & param_name) const
     807             : {
     808     3363682 :   const auto name = checkForRename(param_name);
     809     3363682 :   if (hasDefaultCoupledValue(name))
     810           0 :     return true;
     811             :   // If it has a default, it's already valid
     812     3363682 :   else if (isParamSetByAddParam(name))
     813           4 :     return true;
     814     3363678 :   else if (isParamValid(name))
     815           0 :     mooseError("No way to know if the parameter '", param_name, "' has a default");
     816             :   else
     817     3363678 :     return false;
     818     3363682 : }
     819             : 
     820             : bool
     821     4296905 : InputParameters::hasCoupledValue(const std::string & coupling_name) const
     822             : {
     823     4296905 :   return _coupled_vars.find(coupling_name) != _coupled_vars.end();
     824             : }
     825             : 
     826             : bool
     827     8233882 : InputParameters::hasDefaultCoupledValue(const std::string & coupling_name) const
     828             : {
     829     8235439 :   return _params.count(coupling_name) > 0 && _params.at(coupling_name)._have_coupled_default &&
     830     8235439 :          _coupled_vars.count(coupling_name) > 0;
     831             : }
     832             : 
     833             : void
     834        1079 : InputParameters::defaultCoupledValue(const std::string & coupling_name, Real value, unsigned int i)
     835             : {
     836        1079 :   const auto actual_name = checkForRename(coupling_name);
     837        1079 :   _params[actual_name]._coupled_default.resize(i + 1);
     838        1079 :   _params[actual_name]._coupled_default[i] = value;
     839        1079 :   _params[actual_name]._have_coupled_default = true;
     840        1079 : }
     841             : 
     842             : Real
     843      929920 : InputParameters::defaultCoupledValue(const std::string & coupling_name, unsigned int i) const
     844             : {
     845      929920 :   auto value_it = _params.find(coupling_name);
     846             : 
     847      929920 :   if (value_it == _params.end() || !value_it->second._have_coupled_default)
     848           0 :     mooseError("Attempted to retrieve default value for coupled variable '",
     849             :                coupling_name,
     850             :                "' when none was provided. \n\nThere are three reasons why this may have "
     851             :                "occurred:\n 1. The other version of params.addCoupledVar() should be used in order "
     852             :                "to provide a default value. \n 2. This should have been a required coupled "
     853             :                "variable added with params.addRequiredCoupledVar() \n 3. The call to get the "
     854             :                "coupled value should have been properly guarded with isCoupled()\n");
     855             : 
     856     1849840 :   return value_it->second._coupled_default.at(i);
     857             : }
     858             : 
     859             : unsigned int
     860      223064 : InputParameters::numberDefaultCoupledValues(const std::string & coupling_name) const
     861             : {
     862      223064 :   auto value_it = _params.find(coupling_name);
     863      223064 :   if (value_it == _params.end())
     864           0 :     mooseError("Attempted to retrieve default value for coupled variable '",
     865             :                coupling_name,
     866             :                "' when none was provided.");
     867      446128 :   return value_it->second._coupled_default.size();
     868             : }
     869             : 
     870             : std::map<std::string, std::pair<std::string, std::string>>
     871     2299057 : InputParameters::getAutoBuildVectors() const
     872             : {
     873     2299057 :   std::map<std::string, std::pair<std::string, std::string>> abv;
     874    64912259 :   for (auto it = _params.begin(); it != _params.end(); ++it)
     875             :   {
     876    62613202 :     if (!it->second._autobuild_vecs.first.empty())
     877           2 :       abv[it->first] = it->second._autobuild_vecs;
     878             :   }
     879     2299057 :   return abv;
     880           0 : }
     881             : 
     882             : std::string
     883     1173073 : InputParameters::type(const std::string & name_in) const
     884             : {
     885     1173073 :   const auto name = checkForRename(name_in);
     886     1173073 :   if (!_values.count(name))
     887           0 :     mooseError("Parameter \"", name, "\" not found.\n\n", *this);
     888             : 
     889     1173073 :   if (_coupled_vars.find(name) != _coupled_vars.end())
     890       65336 :     return "std::vector<VariableName>";
     891     1140405 :   else if (_params.count(name) > 0 && !_params.at(name)._custom_type.empty())
     892        1251 :     return _params.at(name)._custom_type;
     893     1139154 :   return _values.at(name)->type();
     894     1173073 : }
     895             : 
     896             : std::string
     897     1402892 : InputParameters::getMooseType(const std::string & name_in) const
     898             : {
     899     1402892 :   const auto name = checkForRename(name_in);
     900     1402892 :   std::string var;
     901             : 
     902     1402892 :   if (have_parameter<VariableName>(name))
     903       83536 :     var = get<VariableName>(name);
     904     1319356 :   else if (have_parameter<NonlinearVariableName>(name))
     905      745150 :     var = get<NonlinearVariableName>(name);
     906      574206 :   else if (have_parameter<LinearVariableName>(name))
     907       12699 :     var = get<LinearVariableName>(name);
     908      561507 :   else if (have_parameter<AuxVariableName>(name))
     909      435911 :     var = get<AuxVariableName>(name);
     910      125596 :   else if (have_parameter<PostprocessorName>(name))
     911           0 :     var = get<PostprocessorName>(name);
     912      125596 :   else if (have_parameter<VectorPostprocessorName>(name))
     913           0 :     var = get<VectorPostprocessorName>(name);
     914      125596 :   else if (have_parameter<FunctionName>(name))
     915           0 :     var = get<FunctionName>(name);
     916      125596 :   else if (have_parameter<UserObjectName>(name))
     917           0 :     var = get<UserObjectName>(name);
     918      125596 :   else if (have_parameter<MaterialPropertyName>(name))
     919           0 :     var = get<MaterialPropertyName>(name);
     920      125596 :   else if (have_parameter<std::string>(name))
     921           0 :     var = get<std::string>(name);
     922             : 
     923     2805784 :   return var;
     924     1402892 : }
     925             : 
     926             : std::vector<std::string>
     927      728600 : InputParameters::getVecMooseType(const std::string & name_in) const
     928             : {
     929      728600 :   const auto name = checkForRename(name_in);
     930      728600 :   std::vector<std::string> svars;
     931             : 
     932      728600 :   if (have_parameter<std::vector<VariableName>>(name))
     933             :   {
     934      728594 :     std::vector<VariableName> vars = get<std::vector<VariableName>>(name);
     935      728594 :     std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
     936      728594 :   }
     937           6 :   else if (have_parameter<std::vector<NonlinearVariableName>>(name))
     938             :   {
     939           0 :     std::vector<NonlinearVariableName> vars = get<std::vector<NonlinearVariableName>>(name);
     940           0 :     std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
     941           0 :   }
     942           6 :   else if (have_parameter<std::vector<AuxVariableName>>(name))
     943             :   {
     944           0 :     std::vector<AuxVariableName> vars = get<std::vector<AuxVariableName>>(name);
     945           0 :     std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
     946           0 :   }
     947           6 :   else if (have_parameter<std::vector<MaterialPropertyName>>(name))
     948             :   {
     949           0 :     std::vector<MaterialPropertyName> vars = get<std::vector<MaterialPropertyName>>(name);
     950           0 :     std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
     951           0 :   }
     952           6 :   else if (have_parameter<std::vector<std::string>>(name))
     953             :   {
     954           0 :     std::vector<std::string> vars = get<std::vector<std::string>>(name);
     955           0 :     std::copy(vars.begin(), vars.end(), std::back_inserter(svars));
     956           0 :   }
     957             : 
     958     1457200 :   return svars;
     959      728600 : }
     960             : 
     961             : bool
     962       18877 : InputParameters::isMooseBaseObject() const
     963             : {
     964       37658 :   return have_parameter<std::string>(MooseBase::type_param) &&
     965       37658 :          get<std::string>(MooseBase::type_param).size() &&
     966       37631 :          have_parameter<std::string>(MooseBase::name_param);
     967             : }
     968             : 
     969             : const std::string *
     970    12368677 : InputParameters::queryObjectType() const
     971             : {
     972    12368677 :   return have_parameter<std::string>(MooseBase::type_param)
     973    12368677 :              ? &get<std::string>(MooseBase::type_param)
     974    12368677 :              : nullptr;
     975             : }
     976             : 
     977             : const std::string &
     978    12367649 : InputParameters::getObjectType() const
     979             : {
     980    12367649 :   if (const auto type_ptr = queryObjectType())
     981    12367647 :     return *type_ptr;
     982           2 :   ::mooseError("InputParameters::getObjectType(): Missing '", MooseBase::type_param, "' param");
     983             : }
     984             : 
     985             : const std::string &
     986    13429693 : InputParameters::getObjectName() const
     987             : {
     988    13429693 :   if (!have_parameter<std::string>(MooseBase::name_param))
     989           0 :     ::mooseError("InputParameters::getObjectName(): Missing '", MooseBase::name_param, "' param");
     990    13429693 :   return get<std::string>(MooseBase::name_param);
     991             : }
     992             : 
     993             : void
     994    63353980 : InputParameters::addParamNamesToGroup(const std::string & space_delim_names,
     995             :                                       const std::string group_name)
     996             : {
     997    63353980 :   std::vector<std::string> elements;
     998    63353980 :   MooseUtils::tokenize(space_delim_names, elements, 1, " \t\n\v\f\r"); // tokenize on whitespace
     999             : 
    1000             :   // Since we don't require types (templates) for this method, we need
    1001             :   // to get a raw list of parameter names to compare against.
    1002    63353980 :   std::set<std::string> param_names;
    1003  1012586784 :   for (const auto & it : *this)
    1004   949232804 :     param_names.insert(it.first);
    1005             : 
    1006   202912238 :   for (const auto & param_name : elements)
    1007   139558258 :     if (_params.count(param_name) > 0)
    1008   139558258 :       _params[param_name]._group = group_name;
    1009             :     else
    1010           0 :       mooseError("Unable to find a parameter with name: ",
    1011             :                  param_name,
    1012             :                  " when adding to group ",
    1013             :                  group_name,
    1014           0 :                  '.');
    1015    63353980 : }
    1016             : 
    1017             : void
    1018        9671 : InputParameters::renameParameterGroup(const std::string & old_name, const std::string & new_name)
    1019             : {
    1020      167697 :   for (auto & param : _params)
    1021      158026 :     if (param.second._group == old_name)
    1022       32730 :       param.second._group = new_name;
    1023        9671 : }
    1024             : 
    1025             : void
    1026     1875228 : InputParameters::setGlobalCommandLineParam(const std::string & name)
    1027             : {
    1028     1875228 :   auto & cl_data = at(checkForRename(name))._cl_data;
    1029     1875228 :   if (!cl_data)
    1030           2 :     mooseError("InputParameters::setGlobalCommandLineParam: The parameter '",
    1031             :                name,
    1032             :                "' is not a command line parameter");
    1033     1875226 :   cl_data->global = true;
    1034     1875226 : }
    1035             : 
    1036             : bool
    1037           4 : InputParameters::isCommandLineParameter(const std::string & name) const
    1038             : {
    1039           4 :   return at(checkForRename(name))._cl_data.has_value();
    1040             : }
    1041             : 
    1042             : std::optional<InputParameters::CommandLineMetadata>
    1043    24064504 : InputParameters::queryCommandLineMetadata(const std::string & name) const
    1044             : {
    1045    24064504 :   const auto & cl_data = at(checkForRename(name))._cl_data;
    1046    24064504 :   if (!cl_data)
    1047    18442597 :     return {};
    1048     5621907 :   return *cl_data;
    1049             : }
    1050             : 
    1051             : const InputParameters::CommandLineMetadata &
    1052          11 : InputParameters::getCommandLineMetadata(const std::string & name) const
    1053             : {
    1054          11 :   const auto & cl_data = at(checkForRename(name))._cl_data;
    1055          11 :   if (!cl_data)
    1056           2 :     mooseError("InputParameters::getCommandLineMetadata: The parameter '",
    1057             :                name,
    1058             :                "' is not a command line parameter");
    1059           9 :   return *cl_data;
    1060             : }
    1061             : 
    1062             : void
    1063      454216 : InputParameters::commandLineParamSet(const std::string & name, const CommandLineParamSetKey)
    1064             : {
    1065      454216 :   auto & cl_data = at(checkForRename(name))._cl_data;
    1066      454216 :   if (!cl_data)
    1067           2 :     mooseError("InputParameters::commandLineParamSet: The parameter '",
    1068             :                name,
    1069             :                "' is not a command line parameter");
    1070      454214 :   cl_data->set_by_command_line = true;
    1071      454214 : }
    1072             : 
    1073             : std::string
    1074     1171053 : InputParameters::getGroupName(const std::string & param_name_in) const
    1075             : {
    1076     1171053 :   const auto param_name = checkForRename(param_name_in);
    1077     1171053 :   auto it = _params.find(param_name);
    1078     1171053 :   if (it != _params.end())
    1079     1171053 :     return it->second._group;
    1080           0 :   return std::string();
    1081     1171053 : }
    1082             : 
    1083             : void
    1084      325644 : InputParameters::applyParameters(const InputParameters & common,
    1085             :                                  const std::vector<std::string> & exclude,
    1086             :                                  const bool allow_private)
    1087             : {
    1088             :   // If we're applying all of the things, also associate the top level hit node
    1089      325644 :   if (exclude.empty() && !getHitNode() && common.getHitNode())
    1090      174848 :     setHitNode(*common.getHitNode(), {});
    1091             : 
    1092             :   // Loop through the common parameters
    1093    24502101 :   for (const auto & it : common)
    1094             :   {
    1095             :     // Common parameter name
    1096    24176457 :     const std::string & common_name = it.first;
    1097             :     // Continue to next parameter, if the current is in list of  excluded parameters
    1098    24176457 :     if (std::find(exclude.begin(), exclude.end(), common_name) != exclude.end())
    1099           0 :       continue;
    1100             : 
    1101    24176457 :     applyParameter(common, common_name, allow_private);
    1102             :   }
    1103             : 
    1104             :   // Loop through the coupled variables
    1105      327071 :   for (const auto & var_name : common._coupled_vars)
    1106             :   {
    1107             :     // Continue to next variable, if the current is in list of  excluded parameters
    1108        1427 :     if (std::find(exclude.begin(), exclude.end(), var_name) != exclude.end())
    1109           0 :       continue;
    1110             : 
    1111        1427 :     applyCoupledVar(common, var_name);
    1112             :   }
    1113      325644 : }
    1114             : 
    1115             : void
    1116      285076 : InputParameters::applyCommonUserSetParameters(const InputParameters & common,
    1117             :                                               const std::vector<std::string> & exclude,
    1118             :                                               const bool allow_private)
    1119             : {
    1120    15679180 :   for (const auto & it : common)
    1121             :   {
    1122    15394104 :     const std::string & common_name = it.first;
    1123    15394104 :     if (std::find(exclude.begin(), exclude.end(), common_name) != exclude.end())
    1124           0 :       continue;
    1125    15394104 :     if (!common.isParamSetByUser(common_name))
    1126    14496470 :       continue;
    1127      897634 :     applyParameter(common, common_name, allow_private);
    1128             :   }
    1129             : 
    1130      285076 :   for (const auto & var_name : common._coupled_vars)
    1131             :   {
    1132           0 :     if (std::find(exclude.begin(), exclude.end(), var_name) != exclude.end())
    1133           0 :       continue;
    1134           0 :     if (!common.isParamSetByUser(var_name))
    1135           0 :       continue;
    1136           0 :     applyCoupledVar(common, var_name);
    1137             :   }
    1138      285076 : }
    1139             : 
    1140             : void
    1141      123986 : InputParameters::applySpecificParameters(const InputParameters & common,
    1142             :                                          const std::vector<std::string> & include,
    1143             :                                          bool allow_private)
    1144             : {
    1145             :   // Loop through the common parameters
    1146     2720691 :   for (const auto & it : common)
    1147             :   {
    1148             :     // Common parameter name
    1149     2596705 :     const std::string & common_name = it.first;
    1150             : 
    1151             :     // Continue to next parameter, if the current is not in list of included parameters
    1152     2596705 :     if (std::find(include.begin(), include.end(), common_name) == include.end())
    1153     2231774 :       continue;
    1154             : 
    1155      364931 :     applyParameter(common, common_name, allow_private);
    1156             :   }
    1157             : 
    1158             :   // Loop through the coupled variables
    1159      123986 :   for (std::set<std::string>::const_iterator it = common.coupledVarsBegin();
    1160      123986 :        it != common.coupledVarsEnd();
    1161           0 :        ++it)
    1162             :   {
    1163             :     // Variable name
    1164           0 :     const std::string var_name = *it;
    1165             : 
    1166             :     // Continue to next variable, if the current is not in list of included parameters
    1167           0 :     if (std::find(include.begin(), include.end(), var_name) == include.end())
    1168           0 :       continue;
    1169             : 
    1170           0 :     applyCoupledVar(common, var_name);
    1171           0 :   }
    1172      123986 : }
    1173             : 
    1174             : void
    1175        1427 : InputParameters::applyCoupledVar(const InputParameters & common, const std::string & var_name)
    1176             : {
    1177             :   // Disable the display of deprecated message when applying common parameters, this avoids a dump
    1178             :   // of messages
    1179        1427 :   _show_deprecated_message = false;
    1180             : 
    1181             :   // If the local parameters has a coupled variable, populate it with the value from the common
    1182             :   // parameters, if the common parameters has the coupled variable too
    1183        1427 :   if (hasCoupledValue(var_name))
    1184             :   {
    1185        1423 :     if (common.hasDefaultCoupledValue(var_name))
    1186             :     {
    1187             :       // prepare a vector of default coupled values
    1188           0 :       std::vector<Real> defaults(common.numberDefaultCoupledValues(var_name));
    1189           0 :       for (unsigned int j = 0; j < common.numberDefaultCoupledValues(var_name); ++j)
    1190           0 :         defaults[j] = common.defaultCoupledValue(var_name, j);
    1191           0 :       addCoupledVar(var_name, defaults, common.getDocString(var_name));
    1192           0 :     }
    1193        1423 :     else if (common.hasCoupledValue(var_name))
    1194        1423 :       addCoupledVar(var_name, common.getDocString(var_name));
    1195             :   }
    1196             : 
    1197             :   // Enable deprecated message printing
    1198        1427 :   _show_deprecated_message = true;
    1199        1427 : }
    1200             : 
    1201             : void
    1202    25439169 : InputParameters::applyParameter(const InputParameters & common,
    1203             :                                 const std::string & common_name,
    1204             :                                 bool allow_private)
    1205             : {
    1206             :   // Disable the display of deprecated message when applying common parameters, this avoids a dump
    1207             :   // of messages
    1208    25439169 :   _show_deprecated_message = false;
    1209             : 
    1210    25439169 :   const auto local_name = checkForRename(common_name);
    1211             : 
    1212             :   // Extract the properties from the local parameter for the current common parameter name
    1213    25439169 :   const bool local_exist = _values.find(local_name) != _values.end();
    1214    25439169 :   const bool local_set = _params.count(local_name) > 0 && !_params[local_name]._set_by_add_param;
    1215    25439169 :   const bool local_priv = allow_private ? false : isPrivate(local_name);
    1216    25439169 :   const bool local_valid = isParamValid(local_name);
    1217             : 
    1218             :   // Extract the properties from the common parameter
    1219    25439169 :   const bool common_exist = common._values.find(common_name) != common._values.end();
    1220    25439169 :   const bool common_priv = allow_private ? false : common.isPrivate(common_name);
    1221    25439169 :   const bool common_valid = common.isParamValid(common_name);
    1222             : 
    1223             :   /* In order to apply a common parameter 4 statements must be satisfied
    1224             :    * (1) A local parameter must exist with the same name as the common parameter
    1225             :    * (2) Common parameter must be valid and exist
    1226             :    * (3) Local parameter must be invalid OR not have been set from its default
    1227             :    * (4) Both cannot be private
    1228             :    */
    1229    25439169 :   if (local_exist && common_exist && common_valid && (!local_valid || !local_set) &&
    1230     7282636 :       (!common_priv || !local_priv))
    1231             :   {
    1232     3174966 :     remove(local_name);
    1233     3174966 :     _values[local_name] = common._values.find(common_name)->second->clone();
    1234     3174966 :     set_attributes(local_name, false);
    1235     6349932 :     _params[local_name]._set_by_add_param =
    1236     3174966 :         libmesh_map_find(common._params, common_name)._set_by_add_param;
    1237             :     // Keep track of where this param came from if we can. This will enable us to
    1238             :     // produce param errors from objects created within an action that link to
    1239             :     // the parameter in the action
    1240     3174966 :     at(local_name)._hit_node = common.getHitNode(common_name);
    1241             :   }
    1242    22264203 :   else if (!local_exist && !common_exist)
    1243           2 :     mooseError("InputParameters::applyParameter(): Attempted to apply invalid parameter \"",
    1244             :                common_name,
    1245             :                "\"");
    1246             : 
    1247             :   // Enable deprecated message printing
    1248    25439167 :   _show_deprecated_message = true;
    1249    25439169 : }
    1250             : 
    1251             : ///Deprecated method
    1252             : bool
    1253           0 : InputParameters::paramSetByUser(const std::string & name) const
    1254             : {
    1255           0 :   mooseDeprecated("paramSetByUser() is deprecated. Use isParamSetByUser() instead.");
    1256           0 :   return isParamSetByUser(name);
    1257             : }
    1258             : 
    1259             : bool
    1260    20050529 : InputParameters::isParamSetByUser(const std::string & name_in) const
    1261             : {
    1262    20050529 :   const auto name = checkForRename(name_in);
    1263             :   // Invalid; for sure not set by the user
    1264    20050529 :   if (!isParamValid(name))
    1265     2301696 :     return false;
    1266             :   // Parameter is not located in the list (called Parameters::set)
    1267    17748833 :   if (!_params.count(name))
    1268           0 :     return false;
    1269             :   // Special case for a command line option, which is a private parameter
    1270    17748833 :   if (const auto cl_data = queryCommandLineMetadata(name))
    1271    17748833 :     return cl_data->set_by_command_line;
    1272             :   // Not a command line option, not set by addParam and not private
    1273    17124145 :   return !_params.at(name)._set_by_add_param && !_params.at(name)._is_private;
    1274    20050529 : }
    1275             : 
    1276             : bool
    1277           4 : InputParameters::isParamDefined(const std::string & name_in) const
    1278             : {
    1279           4 :   const auto name = checkForRename(name_in);
    1280           8 :   return _params.count(name) > 0;
    1281           4 : }
    1282             : 
    1283             : const std::string &
    1284     4173785 : InputParameters::getDescription(const std::string & name_in) const
    1285             : {
    1286     4173785 :   const auto name = checkForRename(name_in);
    1287     4173785 :   auto it = _params.find(name);
    1288     4173785 :   if (it == _params.end())
    1289           0 :     mooseError("No parameter exists with the name ", name);
    1290     8347570 :   return it->second._doc_string;
    1291     4173785 : }
    1292             : 
    1293             : template <>
    1294             : void
    1295      498725 : InputParameters::addRequiredParam<MooseEnum>(const std::string & name,
    1296             :                                              const MooseEnum & moose_enum,
    1297             :                                              const std::string & doc_string)
    1298             : {
    1299      498725 :   InputParameters::set<MooseEnum>(name) = moose_enum; // valid parameter is set by set_attributes
    1300      498725 :   auto & metadata = _params[name];
    1301      498725 :   metadata._required = true;
    1302      498725 :   metadata._doc_string = doc_string;
    1303      498725 : }
    1304             : 
    1305             : template <>
    1306             : void
    1307           4 : InputParameters::addRequiredParam<MultiMooseEnum>(const std::string & name,
    1308             :                                                   const MultiMooseEnum & moose_enum,
    1309             :                                                   const std::string & doc_string)
    1310             : {
    1311           4 :   InputParameters::set<MultiMooseEnum>(name) =
    1312           4 :       moose_enum; // valid parameter is set by set_attributes
    1313           4 :   auto & metadata = _params[name];
    1314           4 :   metadata._required = true;
    1315           4 :   metadata._doc_string = doc_string;
    1316           4 : }
    1317             : 
    1318             : template <>
    1319             : void
    1320           4 : InputParameters::addRequiredParam<std::vector<MooseEnum>>(
    1321             :     const std::string & name,
    1322             :     const std::vector<MooseEnum> & moose_enums,
    1323             :     const std::string & doc_string)
    1324             : {
    1325           4 :   InputParameters::set<std::vector<MooseEnum>>(name) =
    1326           4 :       moose_enums; // valid parameter is set by set_attributes
    1327           4 :   auto & metadata = _params[name];
    1328           4 :   metadata._required = true;
    1329           4 :   metadata._doc_string = doc_string;
    1330           4 : }
    1331             : 
    1332             : template <>
    1333             : void
    1334        3102 : InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(
    1335             :     const std::string & name,
    1336             :     const std::vector<MultiMooseEnum> & moose_enums,
    1337             :     const std::string & doc_string)
    1338             : {
    1339             :   mooseAssert(
    1340             :       moose_enums.size() == 1,
    1341             :       "Only 1 MultiMooseEnum is supported in addRequiredParam<std::vector<MultiMooseEnum>> for " +
    1342             :           name);
    1343             :   mooseAssert(!moose_enums[0].items().empty(),
    1344             :               "The MultiMooseEnum in addRequiredParam<std::vector<MultiMooseEnum>> is empty for " +
    1345             :                   name);
    1346        3102 :   InputParameters::set<std::vector<MultiMooseEnum>>(name) =
    1347        3102 :       moose_enums; // valid parameter is set by set_attributes
    1348        3102 :   auto & metadata = _params[name];
    1349        3102 :   metadata._required = true;
    1350        3102 :   metadata._doc_string = doc_string;
    1351        3102 : }
    1352             : 
    1353             : template <>
    1354             : void
    1355           0 : InputParameters::addParam<MooseEnum>(const std::string & /*name*/,
    1356             :                                      const std::string & /*doc_string*/)
    1357             : {
    1358           0 :   mooseError("You must supply a MooseEnum object when using addParam, even if the parameter is not "
    1359             :              "required!");
    1360             : }
    1361             : 
    1362             : template <>
    1363             : void
    1364           0 : InputParameters::addParam<MultiMooseEnum>(const std::string & /*name*/,
    1365             :                                           const std::string & /*doc_string*/)
    1366             : {
    1367           0 :   mooseError("You must supply a MultiMooseEnum object when using addParam, even if the parameter "
    1368             :              "is not required!");
    1369             : }
    1370             : 
    1371             : template <>
    1372             : void
    1373           0 : InputParameters::addParam<std::vector<MooseEnum>>(const std::string & /*name*/,
    1374             :                                                   const std::string & /*doc_string*/)
    1375             : {
    1376           0 :   mooseError("You must supply a vector of MooseEnum object(s) when using addParam, even if the "
    1377             :              "parameter is not required!");
    1378             : }
    1379             : 
    1380             : template <>
    1381             : void
    1382           0 : InputParameters::addParam<std::vector<MultiMooseEnum>>(const std::string & /*name*/,
    1383             :                                                        const std::string & /*doc_string*/)
    1384             : {
    1385           0 :   mooseError(
    1386             :       "You must supply a vector of MultiMooseEnum object(s) when using addParam, even if the "
    1387             :       "parameter is not required!");
    1388             : }
    1389             : 
    1390             : template <>
    1391             : void
    1392           0 : InputParameters::addRequiredParam<std::vector<MultiMooseEnum>>(const std::string & /*name*/,
    1393             :                                                                const std::string & /*doc_string*/)
    1394             : {
    1395           0 :   mooseError("You must supply a vector of MultiMooseEnum object(s) when using addRequiredParam!");
    1396             : }
    1397             : 
    1398             : template <>
    1399             : void
    1400           0 : InputParameters::addPrivateParam<MooseEnum>(const std::string & /*name*/)
    1401             : {
    1402           0 :   mooseError("You must supply a MooseEnum object when using addPrivateParam, even if the parameter "
    1403             :              "is not required!");
    1404             : }
    1405             : 
    1406             : template <>
    1407             : void
    1408           0 : InputParameters::addPrivateParam<MultiMooseEnum>(const std::string & /*name*/)
    1409             : {
    1410           0 :   mooseError("You must supply a MultiMooseEnum object when using addPrivateParam, even if the "
    1411             :              "parameter is not required!");
    1412             : }
    1413             : 
    1414             : template <>
    1415             : void
    1416           0 : InputParameters::addDeprecatedParam<MooseEnum>(const std::string & /*name*/,
    1417             :                                                const std::string & /*doc_string*/,
    1418             :                                                const std::string & /*deprecation_message*/)
    1419             : {
    1420           0 :   mooseError("You must supply a MooseEnum object and the deprecation string when using "
    1421             :              "addDeprecatedParam, even if the parameter is not required!");
    1422             : }
    1423             : 
    1424             : template <>
    1425             : void
    1426           0 : InputParameters::addDeprecatedParam<MultiMooseEnum>(const std::string & /*name*/,
    1427             :                                                     const std::string & /*doc_string*/,
    1428             :                                                     const std::string & /*deprecation_message*/)
    1429             : {
    1430           0 :   mooseError("You must supply a MultiMooseEnum object and the deprecation string when using "
    1431             :              "addDeprecatedParam, even if the parameter is not required!");
    1432             : }
    1433             : 
    1434             : template <>
    1435             : void
    1436           0 : InputParameters::addDeprecatedParam<std::vector<MooseEnum>>(
    1437             :     const std::string & /*name*/,
    1438             :     const std::string & /*doc_string*/,
    1439             :     const std::string & /*deprecation_message*/)
    1440             : {
    1441           0 :   mooseError("You must supply a vector of MooseEnum object(s) and the deprecation string when "
    1442             :              "using addDeprecatedParam, even if the parameter is not required!");
    1443             : }
    1444             : 
    1445             : template <>
    1446             : void
    1447       38278 : InputParameters::setParamHelper<PostprocessorName, Real>(const std::string & /*name*/,
    1448             :                                                          PostprocessorName & l_value,
    1449             :                                                          const Real & r_value)
    1450             : {
    1451             :   // Assign the default value so that it appears in the dump
    1452       38278 :   std::ostringstream oss;
    1453       38278 :   oss << r_value;
    1454       38278 :   l_value = oss.str();
    1455       38278 : }
    1456             : 
    1457             : template <>
    1458             : void
    1459       60682 : InputParameters::setParamHelper<PostprocessorName, int>(const std::string & /*name*/,
    1460             :                                                         PostprocessorName & l_value,
    1461             :                                                         const int & r_value)
    1462             : {
    1463             :   // Assign the default value so that it appears in the dump
    1464       60682 :   std::ostringstream oss;
    1465       60682 :   oss << r_value;
    1466       60682 :   l_value = oss.str();
    1467       60682 : }
    1468             : 
    1469             : template <>
    1470             : void
    1471        9668 : InputParameters::setParamHelper<FunctionName, Real>(const std::string & /*name*/,
    1472             :                                                     FunctionName & l_value,
    1473             :                                                     const Real & r_value)
    1474             : {
    1475             :   // Assign the default value so that it appears in the dump
    1476        9668 :   std::ostringstream oss;
    1477        9668 :   oss << r_value;
    1478        9668 :   l_value = oss.str();
    1479        9668 : }
    1480             : 
    1481             : template <>
    1482             : void
    1483      168982 : InputParameters::setParamHelper<FunctionName, int>(const std::string & /*name*/,
    1484             :                                                    FunctionName & l_value,
    1485             :                                                    const int & r_value)
    1486             : {
    1487             :   // Assign the default value so that it appears in the dump
    1488      168982 :   std::ostringstream oss;
    1489      168982 :   oss << r_value;
    1490      168982 :   l_value = oss.str();
    1491      168982 : }
    1492             : 
    1493             : template <>
    1494             : void
    1495       26584 : InputParameters::setParamHelper<MaterialPropertyName, Real>(const std::string & /*name*/,
    1496             :                                                             MaterialPropertyName & l_value,
    1497             :                                                             const Real & r_value)
    1498             : {
    1499             :   // Assign the default value so that it appears in the dump
    1500       26584 :   std::ostringstream oss;
    1501       26584 :   oss << r_value;
    1502       26584 :   l_value = oss.str();
    1503       26584 : }
    1504             : 
    1505             : template <>
    1506             : void
    1507       30992 : InputParameters::setParamHelper<MaterialPropertyName, int>(const std::string & /*name*/,
    1508             :                                                            MaterialPropertyName & l_value,
    1509             :                                                            const int & r_value)
    1510             : {
    1511             :   // Assign the default value so that it appears in the dump
    1512       30992 :   std::ostringstream oss;
    1513       30992 :   oss << r_value;
    1514       30992 :   l_value = oss.str();
    1515       30992 : }
    1516             : 
    1517             : template <>
    1518             : void
    1519       53057 : InputParameters::setParamHelper<MooseFunctorName, Real>(const std::string & /*name*/,
    1520             :                                                         MooseFunctorName & l_value,
    1521             :                                                         const Real & r_value)
    1522             : {
    1523             :   // Assign the default value so that it appears in the dump
    1524       53057 :   std::ostringstream oss;
    1525       53057 :   oss << r_value;
    1526       53057 :   l_value = oss.str();
    1527       53057 : }
    1528             : 
    1529             : template <>
    1530             : void
    1531       73747 : InputParameters::setParamHelper<MooseFunctorName, int>(const std::string & /*name*/,
    1532             :                                                        MooseFunctorName & l_value,
    1533             :                                                        const int & r_value)
    1534             : {
    1535             :   // Assign the default value so that it appears in the dump
    1536       73747 :   std::ostringstream oss;
    1537       73747 :   oss << r_value;
    1538       73747 :   l_value = oss.str();
    1539       73747 : }
    1540             : 
    1541             : template <>
    1542             : const MooseEnum &
    1543     2293038 : InputParameters::getParamHelper<MooseEnum>(const std::string & name_in,
    1544             :                                            const InputParameters & pars)
    1545             : {
    1546     2293038 :   const auto name = pars.checkForRename(name_in);
    1547     4586076 :   return pars.get<MooseEnum>(name);
    1548     2293038 : }
    1549             : 
    1550             : template <>
    1551             : const MultiMooseEnum &
    1552      198345 : InputParameters::getParamHelper<MultiMooseEnum>(const std::string & name_in,
    1553             :                                                 const InputParameters & pars)
    1554             : {
    1555      198345 :   const auto name = pars.checkForRename(name_in);
    1556      396690 :   return pars.get<MultiMooseEnum>(name);
    1557      198345 : }
    1558             : 
    1559             : void
    1560     2235519 : InputParameters::setReservedValues(const std::string & name_in,
    1561             :                                    const std::set<std::string> & reserved)
    1562             : {
    1563     2235519 :   const auto name = checkForRename(name_in);
    1564     2235519 :   _params[name]._reserved_values = reserved;
    1565     2235519 : }
    1566             : 
    1567             : std::set<std::string>
    1568      718212 : InputParameters::reservedValues(const std::string & name_in) const
    1569             : {
    1570      718212 :   const auto name = checkForRename(name_in);
    1571      718212 :   auto it = _params.find(name);
    1572      718212 :   if (it == _params.end())
    1573           0 :     return std::set<std::string>();
    1574      718212 :   return it->second._reserved_values;
    1575      718212 : }
    1576             : 
    1577             : std::string
    1578           0 : InputParameters::blockLocation() const
    1579             : {
    1580           0 :   if (const auto hit_node = getHitNode())
    1581           0 :     return hit_node->fileLocation(/* with_column = */ false);
    1582           0 :   return "";
    1583             : }
    1584             : 
    1585             : std::string
    1586    14825595 : InputParameters::blockFullpath() const
    1587             : {
    1588    14825595 :   if (const auto hit_node = getHitNode())
    1589    13733510 :     return hit_node->fullpath();
    1590     2184170 :   return "";
    1591             : }
    1592             : 
    1593             : const hit::Node *
    1594     3466208 : InputParameters::getHitNode(const std::string & param) const
    1595             : {
    1596     3466208 :   return at(param)._hit_node;
    1597             : }
    1598             : 
    1599             : void
    1600     2634177 : InputParameters::setHitNode(const std::string & param,
    1601             :                             const hit::Node & node,
    1602             :                             const InputParameters::SetParamHitNodeKey)
    1603             : {
    1604             :   mooseAssert(node.type() == hit::NodeType::Field, "Must be a field");
    1605     2634177 :   at(param)._hit_node = &node;
    1606     2634177 : }
    1607             : 
    1608             : std::string
    1609          24 : InputParameters::inputLocation(const std::string & param) const
    1610             : {
    1611          24 :   if (const auto hit_node = getHitNode(param))
    1612          24 :     return hit_node->fileLocation(/* with_column = */ false);
    1613           0 :   return "";
    1614             : }
    1615             : 
    1616             : std::string
    1617          34 : InputParameters::paramFullpath(const std::string & param) const
    1618             : {
    1619          34 :   if (const auto hit_node = getHitNode(param))
    1620          30 :     return hit_node->fullpath();
    1621           8 :   return "";
    1622             : }
    1623             : 
    1624             : void
    1625   852505701 : InputParameters::checkParamName(const std::string & name) const
    1626             : {
    1627   852505701 :   const static pcrecpp::RE valid("[\\w:/]+");
    1628   852505701 :   if (!valid.FullMatch(name))
    1629           6 :     mooseError("Invalid parameter name: '", name, "'");
    1630   852505695 : }
    1631             : 
    1632             : bool
    1633    62613202 : InputParameters::shouldIgnore(const std::string & name_in)
    1634             : {
    1635    62613202 :   const auto name = checkForRename(name_in);
    1636    62613202 :   auto it = _params.find(name);
    1637    62613202 :   if (it != _params.end())
    1638   125226404 :     return it->second._ignore;
    1639           0 :   mooseError("Parameter ", name, " does not exist");
    1640    62613202 : }
    1641             : 
    1642             : std::set<std::string>
    1643           0 : InputParameters::getGroupParameters(const std::string & group) const
    1644             : {
    1645           0 :   std::set<std::string> names;
    1646           0 :   for (auto it = _params.begin(); it != _params.end(); ++it)
    1647           0 :     if (it->second._group == group)
    1648           0 :       names.emplace(it->first);
    1649           0 :   return names;
    1650           0 : }
    1651             : 
    1652             : std::set<std::string>
    1653         665 : InputParameters::getParametersList() const
    1654             : {
    1655         665 :   std::set<std::string> param_set;
    1656       28193 :   for (auto it = _params.begin(); it != _params.end(); ++it)
    1657       27528 :     param_set.emplace(it->first);
    1658         665 :   return param_set;
    1659           0 : }
    1660             : 
    1661             : std::set<std::string>
    1662     5641380 : InputParameters::getControllableParameters() const
    1663             : {
    1664     5641380 :   std::set<std::string> controllable;
    1665   150450954 :   for (auto it = _params.begin(); it != _params.end(); ++it)
    1666   144809574 :     if (it->second._controllable)
    1667      897082 :       controllable.emplace(it->first);
    1668     5641380 :   return controllable;
    1669           0 : }
    1670             : 
    1671             : std::string
    1672          12 : InputParameters::paramLocationPrefix(const std::string & param) const
    1673             : {
    1674          12 :   auto prefix = param + ":";
    1675          12 :   if (!inputLocation(param).empty())
    1676          12 :     prefix = inputLocation(param) + ": (" + paramFullpath(param) + ")";
    1677          12 :   return prefix;
    1678           0 : }
    1679             : 
    1680             : std::string
    1681           0 : InputParameters::rawParamVal(const std::string & param) const
    1682             : {
    1683           0 :   if (const auto hit_node = getHitNode(param))
    1684           0 :     return hit_node->strVal();
    1685           0 :   return "";
    1686             : }
    1687             : 
    1688             : std::string
    1689      508936 : InputParameters::varName(const std::string & var_param_name,
    1690             :                          const std::string & moose_object_with_var_param_name) const
    1691             : {
    1692             :   // Try the scalar version first
    1693      508936 :   std::string variable_name = getMooseType(var_param_name);
    1694      508936 :   if (variable_name == "")
    1695             :   {
    1696       64672 :     auto vec = getVecMooseType(var_param_name);
    1697             : 
    1698             :     // Catch the (very unlikely) case where a user specifies
    1699             :     // variable = '' (the empty string)
    1700             :     // in their input file. This could happen if e.g. something goes
    1701             :     // wrong with dollar bracket expression expansion.
    1702       64672 :     if (vec.empty())
    1703           6 :       mooseError("Error constructing object '",
    1704             :                  moose_object_with_var_param_name,
    1705             :                  "' while retrieving value for '",
    1706             :                  var_param_name,
    1707             :                  "' parameter! Did you forget to set '",
    1708             :                  var_param_name,
    1709             :                  "' or set it to '' (empty string) by accident?");
    1710             : 
    1711             :     // When using vector variables, we are only going to use the first one in the list at the
    1712             :     // interface level...
    1713       64666 :     variable_name = vec[0];
    1714       64666 :   }
    1715             : 
    1716      508930 :   return variable_name;
    1717           0 : }
    1718             : 
    1719             : void
    1720      155908 : InputParameters::renameParamInternal(const std::string & old_name,
    1721             :                                      const std::string & new_name,
    1722             :                                      const std::string & docstring,
    1723             :                                      const std::string & removal_date)
    1724             : {
    1725      155908 :   auto params_it = _params.find(old_name);
    1726      155908 :   if (params_it == _params.end())
    1727           0 :     mooseError("Requested to rename parameter '",
    1728             :                old_name,
    1729             :                "' but that parameter name doesn't exist in the parameters object.");
    1730             :   mooseAssert(params_it->second._deprecation_message.empty(),
    1731             :               "Attempting to rename the parameter, '" << old_name << "', that is deprecated");
    1732             : 
    1733      155908 :   auto new_metadata = std::move(params_it->second);
    1734      155908 :   if (!docstring.empty())
    1735      109243 :     new_metadata._doc_string = docstring;
    1736      155908 :   _params.emplace(new_name, std::move(new_metadata));
    1737      155908 :   _params.erase(params_it);
    1738             : 
    1739      155908 :   auto values_it = _values.find(old_name);
    1740      155908 :   auto new_value = std::move(values_it->second);
    1741      155908 :   _values.emplace(new_name, std::move(new_value));
    1742      155908 :   _values.erase(values_it);
    1743             : 
    1744      155908 :   std::string deprecation_message;
    1745      155908 :   if (!removal_date.empty())
    1746       51514 :     deprecation_message = "'" + old_name + "' has been deprecated and will be removed on " +
    1747       51514 :                           removal_date + ". Please use '" + new_name + "' instead.";
    1748             : 
    1749      155908 :   _old_to_new_name_and_dep.emplace(old_name, std::make_pair(new_name, deprecation_message));
    1750      155908 :   _new_to_old_names.emplace(new_name, old_name);
    1751      155908 : }
    1752             : 
    1753             : void
    1754       47746 : InputParameters::renameCoupledVarInternal(const std::string & old_name,
    1755             :                                           const std::string & new_name,
    1756             :                                           const std::string & docstring,
    1757             :                                           const std::string & removal_date)
    1758             : {
    1759       47746 :   auto coupled_vars_it = _coupled_vars.find(old_name);
    1760       47746 :   if (coupled_vars_it == _coupled_vars.end())
    1761           0 :     mooseError("Requested to rename coupled variable '",
    1762             :                old_name,
    1763             :                "' but that coupled variable name doesn't exist in the parameters object.");
    1764             : 
    1765       47746 :   _coupled_vars.insert(new_name);
    1766       47746 :   _coupled_vars.erase(coupled_vars_it);
    1767             : 
    1768       47746 :   renameParamInternal(old_name, new_name, docstring, removal_date);
    1769       47746 : }
    1770             : 
    1771             : void
    1772       95571 : InputParameters::renameParam(const std::string & old_name,
    1773             :                              const std::string & new_name,
    1774             :                              const std::string & new_docstring)
    1775             : {
    1776       95571 :   renameParamInternal(old_name, new_name, new_docstring, "");
    1777       95571 : }
    1778             : 
    1779             : void
    1780       34580 : InputParameters::renameCoupledVar(const std::string & old_name,
    1781             :                                   const std::string & new_name,
    1782             :                                   const std::string & new_docstring)
    1783             : {
    1784       34580 :   renameCoupledVarInternal(old_name, new_name, new_docstring, "");
    1785       34580 : }
    1786             : 
    1787             : void
    1788       12591 : InputParameters::deprecateParam(const std::string & old_name,
    1789             :                                 const std::string & new_name,
    1790             :                                 const std::string & removal_date)
    1791             : {
    1792       12591 :   renameParamInternal(old_name, new_name, "", removal_date);
    1793       12591 : }
    1794             : 
    1795             : void
    1796       13166 : InputParameters::deprecateCoupledVar(const std::string & old_name,
    1797             :                                      const std::string & new_name,
    1798             :                                      const std::string & removal_date)
    1799             : {
    1800       13166 :   renameCoupledVarInternal(old_name, new_name, "", removal_date);
    1801       13166 : }
    1802             : 
    1803             : std::string
    1804  5644560345 : InputParameters::checkForRename(const std::string & name) const
    1805             : {
    1806  5644560345 :   if (auto it = _old_to_new_name_and_dep.find(name); it != _old_to_new_name_and_dep.end())
    1807       36832 :     return it->second.first;
    1808             :   else
    1809  5644523513 :     return name;
    1810             : }
    1811             : 
    1812             : std::vector<std::string>
    1813    62610532 : InputParameters::paramAliases(const std::string & param_name) const
    1814             : {
    1815             :   mooseAssert(_values.find(param_name) != _values.end(),
    1816             :               "The parameter we are searching for aliases for should exist in our parameter map");
    1817   187831596 :   std::vector<std::string> aliases = {param_name};
    1818             : 
    1819    62626594 :   for (const auto & pr : as_range(_new_to_old_names.equal_range(param_name)))
    1820       16062 :     aliases.push_back(pr.second);
    1821             : 
    1822    62610532 :   return aliases;
    1823    62610532 : }
    1824             : 
    1825             : std::optional<Moose::DataFileUtils::Path>
    1826       11343 : InputParameters::queryDataFileNamePath(const std::string & name) const
    1827             : {
    1828       11343 :   return at(checkForRename(name))._data_file_name_path;
    1829             : }
    1830             : 
    1831             : std::optional<std::string>
    1832       77502 : InputParameters::setupVariableNames(std::vector<VariableName> & names,
    1833             :                                     const hit::Node & node,
    1834             :                                     const Moose::PassKey<Moose::Builder>)
    1835             : {
    1836             :   // Whether or not a name was found
    1837       77502 :   bool has_name = false;
    1838             :   // Whether or not a default value (real) was found
    1839       77502 :   bool has_default = false;
    1840             : 
    1841             :   // Search through the names for values that convert to Real values,
    1842             :   // which are default values. If defaults are found, set appropriately
    1843             :   // in the InputParameters object. Keep track of if names or defaults
    1844             :   // were found because we don't allow having both
    1845      165238 :   for (const auto i : index_range(names))
    1846             :   {
    1847       87736 :     auto & name = names[i];
    1848             :     Real real_value;
    1849       87736 :     if (MooseUtils::convert<Real>(name, real_value, false))
    1850             :     {
    1851        1079 :       has_default = true;
    1852        1079 :       defaultCoupledValue(node.path(), real_value, i);
    1853             :     }
    1854             :     else
    1855       86657 :       has_name = true;
    1856             :   }
    1857             : 
    1858       77502 :   if (has_default)
    1859             :   {
    1860         538 :     if (has_name)
    1861           6 :       return {"invalid value for '" + node.fullpath() +
    1862             :               "': coupled vectors where some parameters are reals and others are variables are not "
    1863           3 :               "supported"};
    1864             : 
    1865             :     // Don't actually use the names if these don't represent names
    1866         535 :     names.clear();
    1867             :   }
    1868             : 
    1869       77499 :   return {};
    1870             : }
    1871             : 
    1872             : std::pair<std::string, const hit::Node *>
    1873        2520 : InputParameters::paramMessageContext(const std::string & param) const
    1874             : {
    1875        2520 :   const hit::Node * node = nullptr;
    1876             : 
    1877        2520 :   std::string fullpath;
    1878             :   // First try to find the parameter
    1879        2520 :   if (const hit::Node * param_node = getHitNode(param))
    1880             :   {
    1881        2336 :     fullpath = param_node->fullpath();
    1882        2336 :     node = param_node;
    1883             :   }
    1884             :   // If no parameter node, hope for a block node
    1885         184 :   else if (const hit::Node * block_node = getHitNode())
    1886             :   {
    1887         140 :     node = block_node;
    1888         140 :     fullpath = block_node->fullpath() + "/" + param;
    1889             :   }
    1890             :   // Didn't find anything, at least use the parameter
    1891             :   else
    1892          44 :     fullpath = param;
    1893             : 
    1894        5040 :   return {fullpath + ": ", node};
    1895        2520 : }
    1896             : 
    1897             : std::string
    1898        1230 : InputParameters::paramMessagePrefix(const std::string & param) const
    1899             : {
    1900        1230 :   auto [prefix, node] = paramMessageContext(param);
    1901        1230 :   if (node)
    1902        1230 :     prefix = Moose::hitMessagePrefix(*node) + prefix;
    1903        2460 :   return prefix;
    1904        1230 : }
    1905             : 
    1906             : [[noreturn]] void
    1907        1366 : InputParameters::callMooseError(std::string msg,
    1908             :                                 const bool with_prefix /* = true */,
    1909             :                                 const hit::Node * node /* = nullptr */,
    1910             :                                 const bool show_trace /* = true */) const
    1911             : {
    1912             :   // Find the context of the app if we can. This will let our errors be
    1913             :   // prefixed by the multiapp name (if applicable) and will flush the
    1914             :   // console before outputting an error
    1915        1366 :   MooseApp * app = nullptr;
    1916        1366 :   if (isMooseBaseObject() && have_parameter<MooseApp *>(MooseBase::app_param))
    1917        1284 :     app = get<MooseApp *>(MooseBase::app_param);
    1918             : 
    1919        1366 :   MooseBase::callMooseError(app, *this, msg, with_prefix, node, show_trace);
    1920             : }

Generated by: LCOV version 1.14