LCOV - code coverage report
Current view: top level - src/parser - Builder.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 939 1056 88.9 %
Date: 2025-08-08 20:01:16 Functions: 180 290 62.1 %
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             : // MOOSE includes
      11             : #include "MooseUtils.h"
      12             : #include "MooseInit.h"
      13             : #include "InputParameters.h"
      14             : #include "ActionFactory.h"
      15             : #include "Action.h"
      16             : #include "Factory.h"
      17             : #include "MooseObjectAction.h"
      18             : #include "AddActionComponentAction.h"
      19             : #include "ActionWarehouse.h"
      20             : #include "EmptyAction.h"
      21             : #include "FEProblem.h"
      22             : #include "MooseMesh.h"
      23             : #include "Executioner.h"
      24             : #include "MooseApp.h"
      25             : #include "MooseEnum.h"
      26             : #include "MultiMooseEnum.h"
      27             : #include "MultiApp.h"
      28             : #include "GlobalParamsAction.h"
      29             : #include "SyntaxTree.h"
      30             : #include "InputFileFormatter.h"
      31             : #include "YAMLFormatter.h"
      32             : #include "MooseTypes.h"
      33             : #include "CommandLine.h"
      34             : #include "JsonSyntaxTree.h"
      35             : #include "SystemInfo.h"
      36             : #include "MooseUtils.h"
      37             : #include "Conversion.h"
      38             : #include "Units.h"
      39             : #include "ActionComponent.h"
      40             : 
      41             : #include "libmesh/parallel.h"
      42             : #include "libmesh/fparser.hh"
      43             : 
      44             : // Regular expression includes
      45             : #include "pcrecpp.h"
      46             : 
      47             : // C++ includes
      48             : #include <string>
      49             : #include <map>
      50             : #include <fstream>
      51             : #include <iomanip>
      52             : #include <algorithm>
      53             : #include <cstdlib>
      54             : #include <filesystem>
      55             : 
      56             : namespace Moose
      57             : {
      58             : 
      59             : bool
      60     1232942 : isSectionActive(std::string path, hit::Node * root)
      61             : {
      62     1232942 :   hit::Node * n = root->find(path);
      63     4164267 :   while (n)
      64             :   {
      65     2999764 :     hit::Node * section = n->parent();
      66     2999764 :     if (section)
      67             :     {
      68     1835261 :       auto actives = section->find("active");
      69     1835261 :       auto inactives = section->find("inactive");
      70             : 
      71             :       // only check current level, not nested ones
      72     1835261 :       if (actives && actives->type() == hit::NodeType::Field && actives->parent() == section)
      73             :       {
      74       83836 :         auto vars = section->param<std::vector<std::string>>("active");
      75       83836 :         bool have_var = false;
      76      215583 :         for (auto & var : vars)
      77      131747 :           if (n->path() == hit::pathNorm(var))
      78       24150 :             have_var = true;
      79       83836 :         if (!have_var)
      80       59686 :           return false;
      81       83836 :       }
      82             :       // only check current level, not nested ones
      83     1775575 :       if (inactives && inactives->type() == hit::NodeType::Field && inactives->parent() == section)
      84             :       {
      85       12673 :         auto vars = section->param<std::vector<std::string>>("inactive");
      86       21206 :         for (auto & var : vars)
      87       17286 :           if (n->path() == hit::pathNorm(var))
      88        8753 :             return false;
      89       12673 :       }
      90             :     }
      91     2931325 :     n = section;
      92             :   }
      93     1164503 :   return true;
      94             : }
      95             : 
      96             : std::vector<std::string>
      97         131 : findSimilar(std::string param, std::vector<std::string> options)
      98             : {
      99         131 :   std::vector<std::string> candidates;
     100         131 :   if (options.size() == 0)
     101          14 :     return candidates;
     102             : 
     103         117 :   int mindist = MooseUtils::levenshteinDist(options[0], param);
     104        3662 :   for (auto & opt : options)
     105             :   {
     106        3545 :     int dist = MooseUtils::levenshteinDist(opt, param);
     107             :     // magic number heuristics to get similarity distance cutoff
     108        3545 :     int dist_cutoff = 1 + param.size() / 5;
     109        3545 :     if (dist > dist_cutoff || dist > mindist)
     110        3545 :       continue;
     111             : 
     112           0 :     if (dist < mindist)
     113             :     {
     114           0 :       mindist = dist;
     115           0 :       candidates.clear();
     116             :     }
     117           0 :     candidates.push_back(opt);
     118             :   }
     119         117 :   return candidates;
     120           0 : }
     121             : 
     122       67610 : Builder::Builder(MooseApp & app, ActionWarehouse & action_wh, std::shared_ptr<Parser> parser)
     123             :   : ConsoleStreamInterface(app),
     124       67610 :     _app(app),
     125       67610 :     _factory(app.getFactory()),
     126       67610 :     _action_wh(action_wh),
     127       67610 :     _action_factory(app.getActionFactory()),
     128       67610 :     _syntax(_action_wh.syntax()),
     129       67610 :     _parser(parser),
     130       67610 :     _syntax_formatter(nullptr),
     131       67610 :     _sections_read(false),
     132       67610 :     _current_params(nullptr),
     133      135220 :     _current_error_stream(nullptr)
     134             : {
     135             :   mooseAssert(_parser, "Parser is not set");
     136       67610 : }
     137             : 
     138       62074 : Builder::~Builder() {}
     139             : 
     140             : InputParameters
     141     7778841 : Builder::validParams()
     142             : {
     143     7778841 :   InputParameters params = emptyInputParameters();
     144             : 
     145             :   /**
     146             :    * Add the "active" and "inactive" parameters so that all blocks in the input file
     147             :    * can selectively create lists of active/inactive sub-blocks.
     148             :    */
     149    23336523 :   params.addParam<std::vector<std::string>>(
     150             :       "active",
     151    31115364 :       std::vector<std::string>({"__all__"}),
     152             :       "If specified only the blocks named will be visited and made active");
     153    23336523 :   params.addParam<std::vector<std::string>>(
     154             :       "inactive",
     155    15557682 :       std::vector<std::string>(),
     156             :       "If specified blocks matching these identifiers will be skipped.");
     157             : 
     158     7778841 :   return params;
     159    15557682 : }
     160             : 
     161             : std::vector<std::string>
     162         131 : Builder::listValidParams(std::string & section_name)
     163             : {
     164             :   bool dummy;
     165         131 :   std::string registered_identifier = _syntax.isAssociated(section_name, &dummy);
     166         131 :   auto iters = _syntax.getActions(registered_identifier);
     167             : 
     168         131 :   std::vector<std::string> paramlist;
     169         376 :   for (auto it = iters.first; it != iters.second; ++it)
     170             :   {
     171         245 :     auto params = _action_factory.getValidParams(it->second._action);
     172        3790 :     for (const auto & it : params)
     173        3545 :       paramlist.push_back(it.first);
     174         245 :   }
     175         262 :   return paramlist;
     176         131 : }
     177             : 
     178             : void
     179     2526689 : UnusedWalker::walk(const std::string & fullpath, const std::string & nodename, hit::Node * n)
     180             : {
     181             :   // the line() > 0 check allows us to skip nodes that were merged into this tree (i.e. CLI
     182             :   // args) because their unused params are checked+reported independently of the ones in the
     183             :   // main tree.
     184       70653 :   if (!_used.count(fullpath) && nodename != "active" && nodename != "inactive" &&
     185     2597342 :       isSectionActive(fullpath, n->root()) && n->line() > 0)
     186             :   {
     187         131 :     auto section_name = fullpath.substr(0, fullpath.rfind("/"));
     188         131 :     auto paramlist = _builder.listValidParams(section_name);
     189         131 :     auto candidates = findSimilar(nodename, paramlist);
     190         131 :     if (candidates.size() > 0)
     191           0 :       errors.push_back(hit::errormsg(
     192           0 :           n, "unused parameter '", fullpath, "'\n", "      Did you mean '", candidates[0], "'?"));
     193             :     else
     194         131 :       errors.push_back(hit::errormsg(n, "unused parameter '", fullpath, "'"));
     195         131 :   }
     196     2526689 : }
     197             : 
     198             : std::string
     199        2445 : Builder::getPrimaryFileName(bool strip_leading_path) const
     200             : {
     201        2445 :   const auto path = _parser->getLastInputFilePath();
     202        7335 :   return (strip_leading_path ? path.filename() : std::filesystem::absolute(path)).string();
     203        2445 : }
     204             : 
     205             : void
     206     1180007 : Builder::walkRaw(std::string /*fullpath*/, std::string /*nodepath*/, hit::Node * n)
     207             : {
     208     1180007 :   InputParameters active_list_params = Action::validParams();
     209     1180007 :   InputParameters params = EmptyAction::validParams();
     210             : 
     211     1180007 :   std::string section_name = n->fullpath();
     212     1180007 :   std::string curr_identifier = n->fullpath();
     213             : 
     214             :   // Before we retrieve any actions or build any objects, make sure that the section they are in
     215             :   // is active
     216     1180007 :   if (!isSectionActive(curr_identifier, root()))
     217       15635 :     return;
     218             : 
     219             :   // Extract the block parameters before constructing the action
     220             :   // There may be more than one Action registered for a given section in which case we need to
     221             :   // build them all
     222             :   bool is_parent;
     223     1164372 :   std::string registered_identifier = _syntax.isAssociated(section_name, &is_parent);
     224             : 
     225             :   // Make sure at least one action is associated with the current identifier
     226     1164372 :   if (const auto [begin, end] = _syntax.getActions(registered_identifier); begin == end)
     227             :   {
     228           8 :     _errmsg += hit::errormsg(n,
     229             :                              "section '[",
     230             :                              curr_identifier,
     231             :                              "]' does not have an associated \"Action\".\n Common causes:\n"
     232             :                              "- you misspelled the Action/section name\n"
     233           8 :                              "- the app you are running does not support this Action/syntax") +
     234           4 :                "\n";
     235           4 :     return;
     236             :   }
     237             : 
     238             :   // The DynamicObjecRegistrationAction changes the action multimap and would invalidate the
     239             :   // iterators returned by _syntax.getActions, that's why we have to loop in this awkward way.
     240     1164368 :   std::set<const Syntax::ActionInfo *> processed_actions;
     241             :   while (true)
     242             :   {
     243             :     // search for an unprocessed action
     244     3001978 :     auto [begin, end] = _syntax.getActions(registered_identifier);
     245     3001978 :     auto it = begin;
     246     6102542 :     for (; it != end && processed_actions.count(&it->second); ++it)
     247             :       ;
     248             : 
     249             :     // no more unprocessed actions
     250     3001978 :     if (it == end)
     251     1164206 :       break;
     252             : 
     253             :     // mark action as processed
     254     1837772 :     processed_actions.insert(&it->second);
     255             : 
     256     1837772 :     if (is_parent)
     257      339367 :       continue;
     258     1498405 :     if (_syntax.isDeprecatedSyntax(registered_identifier))
     259           0 :       mooseDeprecated(
     260           0 :           hit::errormsg(n, _syntax.deprecatedActionSyntaxMessage(registered_identifier)));
     261             : 
     262     1498405 :     params = _action_factory.getValidParams(it->second._action);
     263     1498405 :     params.set<ActionWarehouse *>("awh") = &_action_wh;
     264     1498405 :     params.setHitNode(*n, {});
     265             : 
     266     1498405 :     extractParams(curr_identifier, params);
     267             : 
     268             :     // Add the parsed syntax to the parameters object for consumption by the Action
     269     1498401 :     params.set<std::string>("task") = it->second._task;
     270     1498401 :     params.set<std::string>("registered_identifier") = registered_identifier;
     271             : 
     272     1498401 :     if (!(params.have_parameter<bool>("isObjectAction") && params.get<bool>("isObjectAction")))
     273     1495606 :       params.set<std::vector<std::string>>("control_tags")
     274      747803 :           .push_back(MooseUtils::baseName(curr_identifier));
     275             : 
     276             :     // Create the Action
     277             :     std::shared_ptr<Action> action_obj =
     278     1498401 :         _action_factory.create(it->second._action, curr_identifier, params);
     279             : 
     280             :     {
     281             :       // extract the MooseObject params if necessary
     282             :       std::shared_ptr<MooseObjectAction> object_action =
     283     1498291 :           std::dynamic_pointer_cast<MooseObjectAction>(action_obj);
     284     1498291 :       if (object_action)
     285             :       {
     286      750375 :         auto & object_params = object_action->getObjectParams();
     287      750375 :         object_params.setHitNode(*n, {});
     288      750375 :         extractParams(curr_identifier, object_params);
     289     1500662 :         object_params.set<std::vector<std::string>>("control_tags")
     290      750331 :             .push_back(MooseUtils::baseName(curr_identifier));
     291             :       }
     292             :       // extract the Component params if necessary
     293             :       std::shared_ptr<AddActionComponentAction> component_action =
     294     1498247 :           std::dynamic_pointer_cast<AddActionComponentAction>(action_obj);
     295     1498247 :       if (component_action)
     296             :       {
     297         196 :         auto & component_params = component_action->getComponentParams();
     298         196 :         component_params.setHitNode(*n, {});
     299         196 :         extractParams(curr_identifier, component_params);
     300         392 :         component_params.set<std::vector<std::string>>("control_tags")
     301         196 :             .push_back(MooseUtils::baseName(curr_identifier));
     302             :       }
     303     1498247 :     }
     304             : 
     305             :     // add it to the warehouse
     306     1498247 :     _action_wh.addActionBlock(action_obj);
     307     3335853 :   }
     308     1226766 : }
     309             : 
     310             : void
     311     1179996 : Builder::walk(const std::string & fullpath, const std::string & nodepath, hit::Node * n)
     312             : {
     313             :   // skip sections that were manually processed first.
     314     4686020 :   for (auto & sec : _secs_need_first)
     315     3533783 :     if (nodepath == sec)
     316       27759 :       return;
     317     1152237 :   walkRaw(fullpath, nodepath, n);
     318             : }
     319             : 
     320             : hit::Node *
     321    66123858 : Builder::root()
     322             : {
     323             :   mooseAssert(_parser, "Parser is not set");
     324    66123858 :   return _parser->root();
     325             : }
     326             : 
     327             : void
     328       67043 : Builder::build()
     329             : {
     330             :   // add in command line arguments
     331       67043 :   const auto cli_input = _app.commandLine()->buildHitParams();
     332             :   try
     333             :   {
     334       67043 :     _cli_root.reset(hit::parse("CLI_ARGS", cli_input));
     335       67043 :     hit::explode(_cli_root.get());
     336       67043 :     hit::merge(_cli_root.get(), root());
     337             :   }
     338           0 :   catch (hit::ParseError & err)
     339             :   {
     340           0 :     mooseError(err.what());
     341           0 :   }
     342             : 
     343             :   // expand ${bla} parameter values and mark/include variables used in expansions as "used".  This
     344             :   // MUST occur before parameter extraction - otherwise parameters will get wrong values.
     345       67043 :   hit::RawEvaler raw;
     346       67043 :   hit::EnvEvaler env;
     347       67043 :   hit::ReplaceEvaler repl;
     348       67043 :   FuncParseEvaler fparse_ev;
     349       67043 :   UnitsConversionEvaler units_ev;
     350       67043 :   hit::BraceExpander exw;
     351       67043 :   exw.registerEvaler("raw", raw);
     352       67043 :   exw.registerEvaler("env", env);
     353       67043 :   exw.registerEvaler("fparse", fparse_ev);
     354       67043 :   exw.registerEvaler("replace", repl);
     355       67043 :   exw.registerEvaler("units", units_ev);
     356       67043 :   root()->walk(&exw);
     357       94720 :   for (auto & var : exw.used)
     358       27677 :     _extracted_vars.insert(var);
     359       67044 :   for (auto & msg : exw.errors)
     360           1 :     _errmsg += msg + "\n";
     361             : 
     362             :   // do as much error checking as early as possible so that errors are more useful instead
     363             :   // of surprising and disconnected from what caused them.
     364       67043 :   DupParamWalker dw;
     365       67043 :   BadActiveWalker bw;
     366       67043 :   root()->walk(&dw, hit::NodeType::Field);
     367       67043 :   root()->walk(&bw, hit::NodeType::Section);
     368       67043 :   for (auto & msg : dw.errors)
     369           0 :     _errmsg += msg + "\n";
     370       67059 :   for (auto & msg : bw.errors)
     371          16 :     _errmsg += msg + "\n";
     372             : 
     373             :   // Print parse errors related to brace expansion early
     374       67043 :   if (_errmsg.size() > 0)
     375          13 :     mooseError(_errmsg);
     376             : 
     377             :   // There are a few order dependent actions that have to be built first in
     378             :   // order for the parser and application to function properly:
     379             :   //
     380             :   // SetupDebugAction: This action can contain an option for monitoring the parser progress. It must
     381             :   //                   be parsed first to capture all of the parsing output.
     382             :   //
     383             :   // GlobalParamsAction: This action is checked during the parameter extraction routines of all
     384             :   //                     subsequent blocks. It must be parsed early since it must exist during
     385             :   //                     subsequent parameter extraction.
     386             :   //
     387             :   // DynamicObjectRegistration: This action must be built before any MooseObjectActions are built.
     388             :   //                            This is because we retrieve valid parameters from the Factory
     389             :   //                            during parse time. Objects must be registered before
     390             :   //                            validParameters can be retrieved.
     391       67030 :   auto syntax = _syntax.getSyntaxByAction("SetupDebugAction");
     392       67030 :   std::copy(syntax.begin(), syntax.end(), std::back_inserter(_secs_need_first));
     393             : 
     394       67030 :   syntax = _syntax.getSyntaxByAction("GlobalParamsAction");
     395       67030 :   std::copy(syntax.begin(), syntax.end(), std::back_inserter(_secs_need_first));
     396             : 
     397       67030 :   syntax = _syntax.getSyntaxByAction("DynamicObjectRegistrationAction");
     398       67030 :   std::copy(syntax.begin(), syntax.end(), std::back_inserter(_secs_need_first));
     399             : 
     400             :   // walk all the sections extracting paramters from each into InputParameters objects
     401      268120 :   for (auto & sec : _secs_need_first)
     402             :   {
     403      201090 :     auto n = root()->find(sec);
     404      201090 :     if (n)
     405       27770 :       walkRaw(n->parent()->fullpath(), n->path(), n);
     406             :   }
     407       67030 :   root()->walk(this, hit::NodeType::Section);
     408             : 
     409       66868 :   if (_errmsg.size() > 0)
     410          28 :     mooseError(_errmsg);
     411       66849 : }
     412             : 
     413             : // Checks the input and the way it has been used and emits any errors/warnings.
     414             : // This has to be a separate function because for we don't know if some parameters were unused
     415             : // until all the multiapps/subapps have been fully initialized - which isn't complete until
     416             : // *after* all the other member functions on Parser have been run.  So this is here to be
     417             : // externally called at the right time.
     418             : void
     419       62052 : Builder::errorCheck(const Parallel::Communicator & comm, bool warn_unused, bool err_unused)
     420             : {
     421             :   // this if guard is important in case the simulation was not configured via parsed input text -
     422             :   // e.g.  configured programatically.
     423       62052 :   if (!root() || !_cli_root)
     424           1 :     return;
     425             : 
     426       62051 :   UnusedWalker uw(_extracted_vars, *this);
     427       62051 :   UnusedWalker uwcli(_extracted_vars, *this);
     428             : 
     429       62051 :   root()->walk(&uw);
     430       62051 :   _cli_root->walk(&uwcli);
     431             : 
     432       62051 :   auto cli = _app.commandLine();
     433       62051 :   if (warn_unused)
     434             :   {
     435         127 :     for (const auto & arg : cli->unusedHitParams(comm))
     436             :       _warnmsg +=
     437         127 :           hit::errormsg("CLI_ARG", nullptr, "unused command line parameter '", arg, "'") + "\n";
     438         145 :     for (auto & msg : uwcli.errors)
     439          18 :       _warnmsg += msg + "\n";
     440         178 :     for (auto & msg : uw.errors)
     441          51 :       _warnmsg += msg + "\n";
     442             :   }
     443       61924 :   else if (err_unused)
     444             :   {
     445       61928 :     for (const auto & arg : cli->unusedHitParams(comm))
     446             :       _errmsg +=
     447       61928 :           hit::errormsg("CLI_ARG", nullptr, "unused command line parameter '", arg, "'") + "\n";
     448       61943 :     for (auto & msg : uwcli.errors)
     449          19 :       _errmsg += msg + "\n";
     450       61967 :     for (auto & msg : uw.errors)
     451          43 :       _errmsg += msg + "\n";
     452             :   }
     453             : 
     454       62051 :   if (_warnmsg.size() > 0)
     455          51 :     mooseUnused(_warnmsg);
     456       62051 :   if (_errmsg.size() > 0)
     457          39 :     mooseError(
     458          39 :         _errmsg +
     459             :         "\n\nAppend --allow-unused (or -w) on the command line to ignore unused parameters.");
     460       62012 : }
     461             : 
     462             : void
     463          20 : Builder::initSyntaxFormatter(SyntaxFormatterType type, bool dump_mode)
     464             : {
     465          20 :   switch (type)
     466             :   {
     467           0 :     case INPUT_FILE:
     468           0 :       _syntax_formatter = std::make_unique<InputFileFormatter>(dump_mode);
     469           0 :       break;
     470          20 :     case YAML:
     471          20 :       _syntax_formatter = std::make_unique<YAMLFormatter>(dump_mode);
     472          20 :       break;
     473           0 :     default:
     474           0 :       mooseError("Unrecognized Syntax Formatter requested");
     475             :       break;
     476             :   }
     477          20 : }
     478             : 
     479             : void
     480         183 : Builder::buildJsonSyntaxTree(JsonSyntaxTree & root) const
     481             : {
     482         183 :   std::vector<std::pair<std::string, Syntax::ActionInfo>> all_names;
     483             : 
     484        4941 :   for (const auto & iter : _syntax.getAssociatedTypes())
     485        4758 :     root.addSyntaxType(iter.first, iter.second);
     486             : 
     487             :   // Build a list of all the actions appearing in the syntax
     488       21921 :   for (const auto & iter : _syntax.getAssociatedActions())
     489             :   {
     490       21738 :     Syntax::ActionInfo act_info = iter.second;
     491             :     /**
     492             :      * If the task is nullptr that means we need to figure out which task goes with this syntax for
     493             :      * the purpose of building the Moose Object part of the tree. We will figure this out by asking
     494             :      * the ActionFactory for the registration info.
     495             :      */
     496       21738 :     if (act_info._task == "")
     497       17111 :       act_info._task = _action_factory.getTaskName(act_info._action);
     498             : 
     499       21738 :     all_names.push_back(std::make_pair(iter.first, act_info));
     500       21738 :   }
     501             : 
     502             :   // Add all the actions to the JSON tree, except for ActionComponents (below)
     503       21921 :   for (const auto & act_names : all_names)
     504             :   {
     505       21738 :     const auto & act_info = act_names.second;
     506       21738 :     const std::string & action = act_info._action;
     507       21738 :     const std::string & task = act_info._task;
     508       21738 :     const std::string syntax = act_names.first;
     509       21738 :     InputParameters action_obj_params = _action_factory.getValidParams(action);
     510       65214 :     bool params_added = root.addParameters("",
     511             :                                            syntax,
     512             :                                            false,
     513             :                                            action,
     514             :                                            true,
     515             :                                            &action_obj_params,
     516       43476 :                                            _syntax.getLineInfo(syntax, action, ""),
     517             :                                            "");
     518             : 
     519       21738 :     if (params_added)
     520             :     {
     521       19111 :       auto tasks = _action_factory.getTasksByAction(action);
     522       49400 :       for (auto & t : tasks)
     523             :       {
     524       30289 :         auto info = _action_factory.getLineInfo(action, t);
     525       30289 :         root.addActionTask(syntax, action, t, info);
     526       30289 :       }
     527       19111 :     }
     528             : 
     529             :     /**
     530             :      * We need to see if this action is inherited from MooseObjectAction. If it is, then we will
     531             :      * loop over all the Objects in MOOSE's Factory object to print them out if they have associated
     532             :      * bases matching the current task.
     533             :      */
     534       34593 :     if (action_obj_params.have_parameter<bool>("isObjectAction") &&
     535       34593 :         action_obj_params.get<bool>("isObjectAction"))
     536             :     {
     537    19250631 :       for (auto & [moose_obj_name, obj] : _factory.registeredObjects())
     538             :       {
     539    19237776 :         auto moose_obj_params = obj->buildParameters();
     540             :         // Now that we know that this is a MooseObjectAction we need to see if it has been
     541             :         // restricted
     542             :         // in any way by the user.
     543    19237776 :         const std::vector<std::string> & buildable_types = action_obj_params.getBuildableTypes();
     544             : 
     545             :         // See if the current Moose Object syntax belongs under this Action's block
     546    19237776 :         if ((buildable_types.empty() || // Not restricted
     547           0 :              std::find(buildable_types.begin(), buildable_types.end(), moose_obj_name) !=
     548           0 :                  buildable_types.end()) &&                                 // Restricted but found
     549    19237776 :             moose_obj_params.have_parameter<std::string>("_moose_base") && // Has a registered base
     550    19237776 :             _syntax.verifyMooseObjectTask(moose_obj_params.get<std::string>("_moose_base"),
     551    38475552 :                                           task) &&          // and that base is associated
     552      405921 :             action_obj_params.mooseObjectSyntaxVisibility() // and the Action says it's visible
     553             :         )
     554             :         {
     555      405921 :           std::string name;
     556      405921 :           size_t pos = 0;
     557      405921 :           bool is_action_params = false;
     558      405921 :           bool is_type = false;
     559      405921 :           if (syntax[syntax.size() - 1] == '*')
     560             :           {
     561      353694 :             pos = syntax.size();
     562             : 
     563      353694 :             if (!action_obj_params.collapseSyntaxNesting())
     564      353694 :               name = syntax.substr(0, pos - 1) + moose_obj_name;
     565             :             else
     566             :             {
     567           0 :               name = syntax.substr(0, pos - 1) + "/<type>/" + moose_obj_name;
     568           0 :               is_action_params = true;
     569             :             }
     570             :           }
     571             :           else
     572             :           {
     573       52227 :             name = syntax + "/<type>/" + moose_obj_name;
     574       52227 :             is_type = true;
     575             :           }
     576      405921 :           moose_obj_params.set<std::string>("type") = moose_obj_name;
     577             : 
     578      405921 :           auto lineinfo = _factory.getLineInfo(moose_obj_name);
     579      405921 :           std::string classname = _factory.associatedClassName(moose_obj_name);
     580      405921 :           root.addParameters(syntax,
     581             :                              name,
     582             :                              is_type,
     583             :                              moose_obj_name,
     584             :                              is_action_params,
     585             :                              &moose_obj_params,
     586             :                              lineinfo,
     587             :                              classname);
     588      405921 :         }
     589    19237776 :       }
     590             : 
     591             :       // Same thing for ActionComponents, which, while they are not MooseObjects, should behave
     592             :       // similarly syntax-wise
     593       12855 :       if (syntax != "ActionComponents/*")
     594       12672 :         continue;
     595             : 
     596         183 :       auto iters = _action_factory.getActionsByTask("list_component");
     597             : 
     598         549 :       for (auto it = iters.first; it != iters.second; ++it)
     599             :       {
     600             :         // Get the name and parameters
     601         366 :         const auto component_name = it->second;
     602         366 :         auto component_params = _action_factory.getValidParams(component_name);
     603             : 
     604             :         // We currently do not have build-type restrictions on this action that adds
     605             :         // action-components
     606             : 
     607             :         // See if the current Moose Object syntax belongs under this Action's block
     608         366 :         if (action_obj_params.mooseObjectSyntaxVisibility() // and the Action says it's visible
     609             :         )
     610             :         {
     611             :           // The logic for Components is a little simpler here for now because syntax like
     612             :           // Executioner/TimeIntegrator/type= do not exist for components
     613         366 :           std::string name;
     614         366 :           if (syntax[syntax.size() - 1] == '*')
     615             :           {
     616         366 :             size_t pos = syntax.size();
     617         366 :             name = syntax.substr(0, pos - 1) + component_name;
     618             :           }
     619         366 :           component_params.set<std::string>("type") = component_name;
     620             : 
     621         366 :           auto lineinfo = _action_factory.getLineInfo(component_name, "list_component");
     622             :           // We add the parameters as for an object, because we want to fit them to be
     623             :           // added to json["AddActionComponentAction"]["subblock_types"]
     624         366 :           root.addParameters(syntax,
     625             :                              /*syntax_path*/ name,
     626             :                              /*is_type*/ false,
     627             :                              "AddActionComponentAction",
     628             :                              /*is_action=*/false,
     629             :                              &component_params,
     630             :                              lineinfo,
     631             :                              component_name);
     632         366 :         }
     633         366 :       }
     634             :     }
     635       34410 :   }
     636         183 :   root.addGlobal();
     637         183 : }
     638             : 
     639             : void
     640          20 : Builder::buildFullTree(const std::string & search_string)
     641             : {
     642          20 :   std::vector<std::pair<std::string, Syntax::ActionInfo>> all_names;
     643             : 
     644        2408 :   for (const auto & iter : _syntax.getAssociatedActions())
     645             :   {
     646        2388 :     Syntax::ActionInfo act_info = iter.second;
     647             :     /**
     648             :      * If the task is nullptr that means we need to figure out which task goes with this syntax for
     649             :      * the purpose of building the Moose Object part of the tree. We will figure this out by asking
     650             :      * the ActionFactory for the registration info.
     651             :      */
     652        2388 :     if (act_info._task == "")
     653        1880 :       act_info._task = _action_factory.getTaskName(act_info._action);
     654             : 
     655        2388 :     all_names.push_back(std::pair<std::string, Syntax::ActionInfo>(iter.first, act_info));
     656        2388 :   }
     657             : 
     658        2408 :   for (const auto & act_names : all_names)
     659             :   {
     660        2388 :     InputParameters action_obj_params = _action_factory.getValidParams(act_names.second._action);
     661        4776 :     _syntax_formatter->insertNode(
     662        2388 :         act_names.first, act_names.second._action, true, &action_obj_params);
     663             : 
     664        2388 :     const std::string & task = act_names.second._task;
     665        2388 :     std::string act_name = act_names.first;
     666             : 
     667             :     /**
     668             :      * We need to see if this action is inherited from MooseObjectAction. If it is, then we will
     669             :      * loop over all the Objects in MOOSE's Factory object to print them out if they have associated
     670             :      * bases matching the current task.
     671             :      */
     672        3796 :     if (action_obj_params.have_parameter<bool>("isObjectAction") &&
     673        3796 :         action_obj_params.get<bool>("isObjectAction"))
     674             :     {
     675     2109152 :       for (const auto & [moose_obj_name, obj] : _factory.registeredObjects())
     676             :       {
     677     2107744 :         auto moose_obj_params = obj->buildParameters();
     678             :         /**
     679             :          * Now that we know that this is a MooseObjectAction we need to see if it has been
     680             :          * restricted in any way by the user.
     681             :          */
     682     2107744 :         const std::vector<std::string> & buildable_types = action_obj_params.getBuildableTypes();
     683             : 
     684             :         // See if the current Moose Object syntax belongs under this Action's block
     685     2107744 :         if ((buildable_types.empty() || // Not restricted
     686           0 :              std::find(buildable_types.begin(), buildable_types.end(), moose_obj_name) !=
     687           0 :                  buildable_types.end()) &&                                 // Restricted but found
     688     2107744 :             moose_obj_params.have_parameter<std::string>("_moose_base") && // Has a registered base
     689     2107744 :             _syntax.verifyMooseObjectTask(moose_obj_params.get<std::string>("_moose_base"),
     690     4215488 :                                           task) &&          // and that base is associated
     691       44586 :             action_obj_params.mooseObjectSyntaxVisibility() // and the Action says it's visible
     692             :         )
     693             :         {
     694       44586 :           std::string name;
     695       44586 :           size_t pos = 0;
     696       44586 :           bool is_action_params = false;
     697       44586 :           if (act_name[act_name.size() - 1] == '*')
     698             :           {
     699       38874 :             pos = act_name.size();
     700             : 
     701       38874 :             if (!action_obj_params.collapseSyntaxNesting())
     702       38874 :               name = act_name.substr(0, pos - 1) + moose_obj_name;
     703             :             else
     704             :             {
     705           0 :               name = act_name.substr(0, pos - 1) + "/<type>/" + moose_obj_name;
     706           0 :               is_action_params = true;
     707             :             }
     708             :           }
     709             :           else
     710             :           {
     711        5712 :             name = act_name + "/<type>/" + moose_obj_name;
     712             :           }
     713             : 
     714       44586 :           moose_obj_params.set<std::string>("type") = moose_obj_name;
     715             : 
     716       44586 :           _syntax_formatter->insertNode(name, moose_obj_name, is_action_params, &moose_obj_params);
     717       44586 :         }
     718     2107744 :       }
     719             :     }
     720        2388 :   }
     721             : 
     722             :   // Do not change to _console, we need this printed to the stdout in all cases
     723          20 :   Moose::out << _syntax_formatter->print(search_string) << std::flush;
     724          20 : }
     725             : 
     726             : /**************************************************************************************************
     727             :  **************************************************************************************************
     728             :  *                                   Parameter Extraction Routines                                *
     729             :  **************************************************************************************************
     730             :  **************************************************************************************************/
     731             : using std::string;
     732             : 
     733             : // Template Specializations for retrieving special types from the input file
     734             : template <>
     735             : void Builder::setScalarParameter<RealVectorValue, RealVectorValue>(
     736             :     const std::string & full_name,
     737             :     const std::string & short_name,
     738             :     InputParameters::Parameter<RealVectorValue> * param,
     739             :     bool in_global,
     740             :     GlobalParamsAction * global_block);
     741             : 
     742             : template <>
     743             : void Builder::setScalarParameter<Point, Point>(const std::string & full_name,
     744             :                                                const std::string & short_name,
     745             :                                                InputParameters::Parameter<Point> * param,
     746             :                                                bool in_global,
     747             :                                                GlobalParamsAction * global_block);
     748             : 
     749             : template <>
     750             : void Builder::setScalarParameter<RealEigenVector, RealEigenVector>(
     751             :     const std::string & full_name,
     752             :     const std::string & short_name,
     753             :     InputParameters::Parameter<RealEigenVector> * param,
     754             :     bool in_global,
     755             :     GlobalParamsAction * global_block);
     756             : 
     757             : template <>
     758             : void Builder::setScalarParameter<RealEigenMatrix, RealEigenMatrix>(
     759             :     const std::string & full_name,
     760             :     const std::string & short_name,
     761             :     InputParameters::Parameter<RealEigenMatrix> * param,
     762             :     bool in_global,
     763             :     GlobalParamsAction * global_block);
     764             : 
     765             : template <>
     766             : void Builder::setScalarParameter<PostprocessorName, PostprocessorName>(
     767             :     const std::string & full_name,
     768             :     const std::string & short_name,
     769             :     InputParameters::Parameter<PostprocessorName> * param,
     770             :     bool in_global,
     771             :     GlobalParamsAction * global_block);
     772             : 
     773             : template <>
     774             : void
     775             : Builder::setScalarParameter<MooseEnum, MooseEnum>(const std::string & full_name,
     776             :                                                   const std::string & short_name,
     777             :                                                   InputParameters::Parameter<MooseEnum> * param,
     778             :                                                   bool in_global,
     779             :                                                   GlobalParamsAction * global_block);
     780             : 
     781             : template <>
     782             : void Builder::setScalarParameter<MultiMooseEnum, MultiMooseEnum>(
     783             :     const std::string & full_name,
     784             :     const std::string & short_name,
     785             :     InputParameters::Parameter<MultiMooseEnum> * param,
     786             :     bool in_global,
     787             :     GlobalParamsAction * global_block);
     788             : 
     789             : template <>
     790             : void Builder::setScalarParameter<ExecFlagEnum, ExecFlagEnum>(
     791             :     const std::string & full_name,
     792             :     const std::string & short_name,
     793             :     InputParameters::Parameter<ExecFlagEnum> * param,
     794             :     bool in_global,
     795             :     GlobalParamsAction * global_block);
     796             : 
     797             : template <>
     798             : void Builder::setScalarParameter<RealTensorValue, RealTensorValue>(
     799             :     const std::string & full_name,
     800             :     const std::string & short_name,
     801             :     InputParameters::Parameter<RealTensorValue> * param,
     802             :     bool in_global,
     803             :     GlobalParamsAction * global_block);
     804             : 
     805             : template <>
     806             : void Builder::setScalarParameter<ReporterName, std::string>(
     807             :     const std::string & full_name,
     808             :     const std::string & short_name,
     809             :     InputParameters::Parameter<ReporterName> * param,
     810             :     bool in_global,
     811             :     GlobalParamsAction * global_block);
     812             : 
     813             : // Vectors
     814             : template <>
     815             : void Builder::setVectorParameter<RealVectorValue, RealVectorValue>(
     816             :     const std::string & full_name,
     817             :     const std::string & short_name,
     818             :     InputParameters::Parameter<std::vector<RealVectorValue>> * param,
     819             :     bool in_global,
     820             :     GlobalParamsAction * global_block);
     821             : 
     822             : template <>
     823             : void
     824             : Builder::setVectorParameter<Point, Point>(const std::string & full_name,
     825             :                                           const std::string & short_name,
     826             :                                           InputParameters::Parameter<std::vector<Point>> * param,
     827             :                                           bool in_global,
     828             :                                           GlobalParamsAction * global_block);
     829             : 
     830             : template <>
     831             : void Builder::setVectorParameter<PostprocessorName, PostprocessorName>(
     832             :     const std::string & full_name,
     833             :     const std::string & short_name,
     834             :     InputParameters::Parameter<std::vector<PostprocessorName>> * param,
     835             :     bool in_global,
     836             :     GlobalParamsAction * global_block);
     837             : 
     838             : template <>
     839             : void Builder::setVectorParameter<MooseEnum, MooseEnum>(
     840             :     const std::string & full_name,
     841             :     const std::string & short_name,
     842             :     InputParameters::Parameter<std::vector<MooseEnum>> * param,
     843             :     bool in_global,
     844             :     GlobalParamsAction * global_block);
     845             : 
     846             : template <>
     847             : void Builder::setVectorParameter<MultiMooseEnum, MultiMooseEnum>(
     848             :     const std::string & full_name,
     849             :     const std::string & short_name,
     850             :     InputParameters::Parameter<std::vector<MultiMooseEnum>> * param,
     851             :     bool in_global,
     852             :     GlobalParamsAction * global_block);
     853             : 
     854             : template <>
     855             : void Builder::setVectorParameter<VariableName, VariableName>(
     856             :     const std::string & full_name,
     857             :     const std::string & short_name,
     858             :     InputParameters::Parameter<std::vector<VariableName>> * param,
     859             :     bool in_global,
     860             :     GlobalParamsAction * global_block);
     861             : 
     862             : template <>
     863             : void Builder::setVectorParameter<ReporterName, std::string>(
     864             :     const std::string & full_name,
     865             :     const std::string & short_name,
     866             :     InputParameters::Parameter<std::vector<ReporterName>> * param,
     867             :     bool in_global,
     868             :     GlobalParamsAction * global_block);
     869             : 
     870             : template <>
     871             : void Builder::setVectorParameter<CLIArgString, std::string>(
     872             :     const std::string & full_name,
     873             :     const std::string & short_name,
     874             :     InputParameters::Parameter<std::vector<CLIArgString>> * param,
     875             :     bool in_global,
     876             :     GlobalParamsAction * global_block);
     877             : 
     878             : template <>
     879             : void Builder::setDoubleIndexParameter<Point>(
     880             :     const std::string & full_name,
     881             :     const std::string & short_name,
     882             :     InputParameters::Parameter<std::vector<std::vector<Point>>> * param,
     883             :     bool in_global,
     884             :     GlobalParamsAction * global_block);
     885             : 
     886             : void
     887     2274397 : Builder::extractParams(const std::string & prefix, InputParameters & p)
     888             : {
     889     2274397 :   std::ostringstream error_stream;
     890     2274397 :   static const std::string global_params_task = "set_global_params";
     891             :   static const std::string global_params_block_name =
     892     2274397 :       _syntax.getSyntaxByAction("GlobalParamsAction").front();
     893             : 
     894     2274397 :   ActionIterator act_iter = _action_wh.actionBlocksWithActionBegin(global_params_task);
     895     2274397 :   GlobalParamsAction * global_params_block = nullptr;
     896             : 
     897             :   // We are grabbing only the first
     898     2274397 :   if (act_iter != _action_wh.actionBlocksWithActionEnd(global_params_task))
     899      168544 :     global_params_block = dynamic_cast<GlobalParamsAction *>(*act_iter);
     900             : 
     901             :   // Set a pointer to the current InputParameters object being parsed so that it can be referred
     902             :   // to
     903             :   // in the extraction routines
     904     2274397 :   _current_params = &p;
     905     2274397 :   _current_error_stream = &error_stream;
     906    59483463 :   for (const auto & it : p)
     907             :   {
     908    57209102 :     if (p.shouldIgnore(it.first))
     909        2752 :       continue;
     910             : 
     911    57206350 :     bool found = false;
     912    57206350 :     bool in_global = false;
     913             : 
     914   111922552 :     for (const auto & param_name : p.paramAliases(it.first))
     915             :     {
     916    57379792 :       std::string orig_name = prefix + "/" + param_name;
     917    57379792 :       std::string full_name = orig_name;
     918             : 
     919             :       // Mark parameters appearing in the input file or command line
     920    57379792 :       auto node = root()->find(full_name);
     921    57379792 :       if (node && node->type() == hit::NodeType::Field)
     922             :       {
     923     2602550 :         p.setHitNode(param_name, *node, {});
     924     2602550 :         p.set_attributes(param_name, false);
     925             :         // Check if we have already printed the deprecated param message.
     926             :         // If we haven't, add it to the tracker, and print it.
     927     2602550 :         if (!_deprec_param_tracker.count(param_name))
     928     2601519 :           if (p.attemptPrintDeprecated(param_name))
     929        1310 :             _deprec_param_tracker.insert(param_name);
     930     2602542 :         _extracted_vars.insert(
     931             :             full_name); // Keep track of all variables extracted from the input file
     932     2602542 :         found = true;
     933             :       }
     934             :       // Wait! Check the GlobalParams section
     935    54777242 :       else if (global_params_block)
     936             :       {
     937     3816140 :         full_name = global_params_block_name + "/" + param_name;
     938     3816140 :         node = root()->find(full_name);
     939     3816140 :         if (node)
     940             :         {
     941       61118 :           p.setHitNode(param_name, *node, {});
     942       61118 :           p.set_attributes(param_name, false);
     943       61118 :           _extracted_vars.insert(
     944             :               full_name); // Keep track of all variables extracted from the input file
     945       61118 :           found = true;
     946       61118 :           in_global = true;
     947             :         }
     948             :       }
     949    57379784 :       if (found)
     950             :       {
     951     2663660 :         if (p.isPrivate(param_name) && !in_global)
     952           8 :           mooseError("The parameter '",
     953             :                      full_name,
     954             :                      "' is a private parameter and should not be used in an input file.");
     955             :         // avoid setting the parameter
     956     2663652 :         else if (p.isPrivate(param_name) && in_global)
     957          78 :           continue;
     958             : 
     959     2663574 :         auto & short_name = param_name;
     960     2663574 :         libMesh::Parameters::Value * par = MooseUtils::get(it.second);
     961             : 
     962             : #define setscalarvaltype(ptype, base, range)                                                       \
     963             :   else if (par->type() == demangle(typeid(ptype).name()))                                          \
     964             :       setScalarValueTypeParameter<ptype, range, base>(                                             \
     965             :           full_name,                                                                               \
     966             :           short_name,                                                                              \
     967             :           dynamic_cast<InputParameters::Parameter<ptype> *>(par),                                  \
     968             :           in_global,                                                                               \
     969             :           global_params_block)
     970             : #define setscalar(ptype, base)                                                                     \
     971             :   else if (par->type() == demangle(typeid(ptype).name()))                                          \
     972             :       setScalarParameter<ptype, base>(full_name,                                                   \
     973             :                                       short_name,                                                  \
     974             :                                       dynamic_cast<InputParameters::Parameter<ptype> *>(par),      \
     975             :                                       in_global,                                                   \
     976             :                                       global_params_block)
     977             : #define setvector(ptype, base)                                                                     \
     978             :   else if (par->type() == demangle(typeid(std::vector<ptype>).name()))                             \
     979             :       setVectorParameter<ptype, base>(                                                             \
     980             :           full_name,                                                                               \
     981             :           short_name,                                                                              \
     982             :           dynamic_cast<InputParameters::Parameter<std::vector<ptype>> *>(par),                     \
     983             :           in_global,                                                                               \
     984             :           global_params_block)
     985             : #define setmap(key_type, mapped_type)                                                              \
     986             :   else if (par->type() == demangle(typeid(std::map<key_type, mapped_type>).name()))                \
     987             :       setMapParameter(                                                                             \
     988             :           full_name,                                                                               \
     989             :           short_name,                                                                              \
     990             :           dynamic_cast<InputParameters::Parameter<std::map<key_type, mapped_type>> *>(par),        \
     991             :           in_global,                                                                               \
     992             :           global_params_block)
     993             : #define setvectorvector(ptype)                                                                     \
     994             :   else if (par->type() == demangle(typeid(std::vector<std::vector<ptype>>).name()))                \
     995             :       setDoubleIndexParameter<ptype>(                                                              \
     996             :           full_name,                                                                               \
     997             :           short_name,                                                                              \
     998             :           dynamic_cast<InputParameters::Parameter<std::vector<std::vector<ptype>>> *>(par),        \
     999             :           in_global,                                                                               \
    1000             :           global_params_block)
    1001             : #define setvectorvectorvector(ptype)                                                               \
    1002             :   else if (par->type() == demangle(typeid(std::vector<std::vector<std::vector<ptype>>>).name()))   \
    1003             :       setTripleIndexParameter<ptype>(                                                              \
    1004             :           full_name,                                                                               \
    1005             :           short_name,                                                                              \
    1006             :           dynamic_cast<                                                                            \
    1007             :               InputParameters::Parameter<std::vector<std::vector<std::vector<ptype>>>> *>(par),    \
    1008             :           in_global,                                                                               \
    1009             :           global_params_block)
    1010             : 
    1011             :         /**
    1012             :          * Scalar types
    1013             :          */
    1014             :         // built-ins
    1015             :         // NOTE: Similar dynamic casting is done in InputParameters.C, please update appropriately
    1016             :         if (false)
    1017             :           ;
    1018     2663574 :         setscalarvaltype(Real, double, Real);
    1019     2431430 :         setscalarvaltype(int, int, long);
    1020     2429313 :         setscalarvaltype(unsigned short, unsigned int, long);
    1021     2417255 :         setscalarvaltype(long, int, long);
    1022     2417255 :         setscalarvaltype(unsigned int, unsigned int, long);
    1023     2251812 :         setscalarvaltype(unsigned long, unsigned int, long);
    1024     2249142 :         setscalarvaltype(long int, int64_t, long);
    1025     2249142 :         setscalarvaltype(unsigned long long, unsigned int, long);
    1026             : 
    1027     2249142 :         setscalar(bool, bool);
    1028     2070328 :         setscalar(SubdomainID, int);
    1029     2070328 :         setscalar(BoundaryID, int);
    1030             : 
    1031             :         // string and string-subclass types
    1032     2068621 :         setscalar(string, string);
    1033     1412905 :         setscalar(SubdomainName, string);
    1034     1407098 :         setscalar(BoundaryName, string);
    1035     1388550 :         setscalar(FileName, string);
    1036     1387237 :         setscalar(MeshFileName, string);
    1037     1380740 :         setscalar(MatrixFileName, string);
    1038     1380700 :         setscalar(FileNameNoExtension, string);
    1039     1379953 :         setscalar(RelativeFileName, string);
    1040     1379953 :         setscalar(DataFileName, string);
    1041     1379902 :         setscalar(ComponentName, string);
    1042     1379902 :         setscalar(PhysicsName, string);
    1043     1379902 :         setscalar(OutFileBase, string);
    1044     1379902 :         setscalar(VariableName, string);
    1045     1366146 :         setscalar(NonlinearVariableName, string);
    1046     1173417 :         setscalar(LinearVariableName, string);
    1047     1167818 :         setscalar(SolverVariableName, string);
    1048     1167818 :         setscalar(AuxVariableName, string);
    1049     1133065 :         setscalar(FunctionName, string);
    1050     1086690 :         setscalar(ConvergenceName, string);
    1051     1085583 :         setscalar(MeshDivisionName, string);
    1052     1084251 :         setscalar(UserObjectName, string);
    1053     1077771 :         setscalar(VectorPostprocessorName, string);
    1054     1076233 :         setscalar(IndicatorName, string);
    1055     1075741 :         setscalar(MarkerName, string);
    1056     1073760 :         setscalar(MultiAppName, string);
    1057     1059971 :         setscalar(OutputName, string);
    1058     1059971 :         setscalar(MaterialPropertyName, string);
    1059     1047337 :         setscalar(MooseFunctorName, string);
    1060     1029289 :         setscalar(MaterialName, string);
    1061     1029161 :         setscalar(DistributionName, string);
    1062     1029161 :         setscalar(PositionsName, string);
    1063     1028713 :         setscalar(SamplerName, string);
    1064     1028359 :         setscalar(TagName, string);
    1065     1026979 :         setscalar(TimesName, string);
    1066     1026949 :         setscalar(MeshGeneratorName, string);
    1067     1002060 :         setscalar(ExtraElementIDName, string);
    1068     1001955 :         setscalar(PostprocessorName, PostprocessorName);
    1069      993728 :         setscalar(ExecutorName, string);
    1070      993688 :         setscalar(NonlinearSystemName, string);
    1071      993204 :         setscalar(LinearSystemName, string);
    1072      993204 :         setscalar(SolverSystemName, string);
    1073      991397 :         setscalar(CLIArgString, string);
    1074             : #ifdef MOOSE_MFEM_ENABLED
    1075      653996 :         setscalar(MFEMScalarCoefficientName, string);
    1076      653657 :         setscalar(MFEMVectorCoefficientName, string);
    1077      653536 :         setscalar(MFEMMatrixCoefficientName, string);
    1078             : #endif
    1079             : 
    1080             :         // Moose Compound Scalars
    1081      990937 :         setscalar(RealVectorValue, RealVectorValue);
    1082      971090 :         setscalar(Point, Point);
    1083      963145 :         setscalar(RealEigenVector, RealEigenVector);
    1084      961176 :         setscalar(RealEigenMatrix, RealEigenMatrix);
    1085      961029 :         setscalar(MooseEnum, MooseEnum);
    1086      533601 :         setscalar(MultiMooseEnum, MultiMooseEnum);
    1087      499766 :         setscalar(RealTensorValue, RealTensorValue);
    1088      499727 :         setscalar(ExecFlagEnum, ExecFlagEnum);
    1089      442068 :         setscalar(ReporterName, string);
    1090      441131 :         setscalar(ReporterValueName, string);
    1091      441069 :         setscalar(ParsedFunctionExpression, string);
    1092             : 
    1093             :         // vector types
    1094      440140 :         setvector(bool, bool);
    1095      439070 :         setvector(Real, double);
    1096      387697 :         setvector(int, int);
    1097      386428 :         setvector(long, int);
    1098      386392 :         setvector(unsigned int, int);
    1099             : 
    1100             : // We need to be able to parse 8-byte unsigned types when
    1101             : // libmesh is configured --with-dof-id-bytes=8.  Officially,
    1102             : // libmesh uses uint64_t in that scenario, which is usually
    1103             : // equivalent to 'unsigned long long'.  Note that 'long long'
    1104             : // has been around since C99 so most C++ compilers support it,
    1105             : // but presumably uint64_t is the "most standard" way to get a
    1106             : // 64-bit unsigned type, so we'll stick with that here.
    1107             : #if LIBMESH_DOF_ID_BYTES == 8
    1108      377090 :         setvector(uint64_t, int);
    1109             : #endif
    1110             : 
    1111      376100 :         setvector(SubdomainID, int);
    1112      373874 :         setvector(BoundaryID, int);
    1113      373712 :         setvector(RealVectorValue, RealVectorValue);
    1114      373653 :         setvector(Point, Point);
    1115      364989 :         setvector(MooseEnum, MooseEnum);
    1116      364937 :         setvector(MultiMooseEnum, MultiMooseEnum);
    1117             : 
    1118      364919 :         setvector(string, string);
    1119      306053 :         setvector(FileName, string);
    1120      297763 :         setvector(FileNameNoExtension, string);
    1121      297763 :         setvector(RelativeFileName, string);
    1122      297763 :         setvector(DataFileName, string);
    1123      297763 :         setvector(MeshFileName, string);
    1124      297735 :         setvector(MatrixFileName, string);
    1125      297735 :         setvector(SubdomainName, string);
    1126      254897 :         setvector(BoundaryName, string);
    1127      127254 :         setvector(NonlinearVariableName, string);
    1128      126372 :         setvector(LinearVariableName, string);
    1129      126372 :         setvector(SolverVariableName, string);
    1130      126372 :         setvector(AuxVariableName, string);
    1131      115825 :         setvector(FunctionName, string);
    1132      113692 :         setvector(ConvergenceName, string);
    1133      113180 :         setvector(MeshDivisionName, string);
    1134      113167 :         setvector(UserObjectName, string);
    1135      113167 :         setvector(IndicatorName, string);
    1136      113167 :         setvector(MarkerName, string);
    1137      113104 :         setvector(MultiAppName, string);
    1138      112942 :         setvector(PostprocessorName, PostprocessorName);
    1139      110544 :         setvector(VectorPostprocessorName, string);
    1140      110544 :         setvector(OutputName, string);
    1141      101812 :         setvector(MaterialPropertyName, string);
    1142      101369 :         setvector(MooseFunctorName, string);
    1143       98170 :         setvector(MaterialName, string);
    1144       98170 :         setvector(DistributionName, string);
    1145       98170 :         setvector(SamplerName, string);
    1146       98170 :         setvector(TagName, string);
    1147       94818 :         setvector(VariableName, VariableName);
    1148       17989 :         setvector(MeshGeneratorName, string);
    1149       16443 :         setvector(ExtraElementIDName, string);
    1150       15645 :         setvector(ReporterName, string);
    1151       14471 :         setvector(CLIArgString, string);
    1152       12594 :         setvector(ComponentName, string);
    1153       12594 :         setvector(PhysicsName, string);
    1154       12480 :         setvector(PositionsName, string);
    1155       11978 :         setvector(TimesName, string);
    1156       11978 :         setvector(ReporterValueName, string);
    1157        9118 :         setvector(ExecutorName, string);
    1158        9118 :         setvector(NonlinearSystemName, string);
    1159        8854 :         setvector(LinearSystemName, string);
    1160        7553 :         setvector(SolverSystemName, string);
    1161             : #ifdef MOOSE_MFEM_ENABLED
    1162        3980 :         setvector(MFEMScalarCoefficientName, string);
    1163        3922 :         setvector(MFEMVectorCoefficientName, string);
    1164        3912 :         setvector(MFEMMatrixCoefficientName, string);
    1165             : #endif
    1166             : 
    1167             :         // map types
    1168        6142 :         setmap(string, unsigned int);
    1169        6142 :         setmap(string, Real);
    1170        6082 :         setmap(string, string);
    1171        5715 :         setmap(unsigned int, unsigned int);
    1172        5694 :         setmap(unsigned long, unsigned int);
    1173        5673 :         setmap(unsigned long long, unsigned int);
    1174             : 
    1175             :         // Double indexed types
    1176        5652 :         setvectorvector(Real);
    1177        3594 :         setvectorvector(int);
    1178        3427 :         setvectorvector(long);
    1179        3414 :         setvectorvector(unsigned int);
    1180        3179 :         setvectorvector(unsigned long long);
    1181             : 
    1182             : // See vector type explanation
    1183             : #if LIBMESH_DOF_ID_BYTES == 8
    1184        3179 :         setvectorvector(uint64_t);
    1185             : #endif
    1186             : 
    1187        3038 :         setvectorvector(SubdomainID);
    1188        2768 :         setvectorvector(BoundaryID);
    1189        2709 :         setvectorvector(Point);
    1190        2594 :         setvectorvector(string);
    1191        2034 :         setvectorvector(FileName);
    1192        2021 :         setvectorvector(FileNameNoExtension);
    1193        2008 :         setvectorvector(DataFileName);
    1194        2008 :         setvectorvector(MeshFileName);
    1195        1995 :         setvectorvector(MatrixFileName);
    1196        1995 :         setvectorvector(SubdomainName);
    1197        1738 :         setvectorvector(BoundaryName);
    1198        1666 :         setvectorvector(VariableName);
    1199        1666 :         setvectorvector(NonlinearVariableName);
    1200        1658 :         setvectorvector(LinearVariableName);
    1201        1658 :         setvectorvector(SolverVariableName);
    1202        1658 :         setvectorvector(AuxVariableName);
    1203        1658 :         setvectorvector(FunctionName);
    1204        1645 :         setvectorvector(ConvergenceName);
    1205        1645 :         setvectorvector(UserObjectName);
    1206        1632 :         setvectorvector(IndicatorName);
    1207        1619 :         setvectorvector(MarkerName);
    1208        1606 :         setvectorvector(MultiAppName);
    1209        1593 :         setvectorvector(PostprocessorName);
    1210        1580 :         setvectorvector(VectorPostprocessorName);
    1211        1567 :         setvectorvector(MarkerName);
    1212        1567 :         setvectorvector(OutputName);
    1213        1539 :         setvectorvector(MaterialPropertyName);
    1214        1526 :         setvectorvector(MooseFunctorName);
    1215        1467 :         setvectorvector(MaterialName);
    1216        1467 :         setvectorvector(DistributionName);
    1217        1467 :         setvectorvector(SamplerName);
    1218        1467 :         setvectorvector(TagName);
    1219             : #ifdef MOOSE_MFEM_ENABLED
    1220         418 :         setvectorvector(MFEMScalarCoefficientName);
    1221         418 :         setvectorvector(MFEMVectorCoefficientName);
    1222         418 :         setvectorvector(MFEMMatrixCoefficientName);
    1223             : #endif
    1224             : 
    1225             :         // Triple indexed types
    1226         622 :         setvectorvectorvector(Real);
    1227         458 :         setvectorvectorvector(int);
    1228         445 :         setvectorvectorvector(long);
    1229         432 :         setvectorvectorvector(unsigned int);
    1230         419 :         setvectorvectorvector(unsigned long long);
    1231             : 
    1232             : // See vector type explanation
    1233             : #if LIBMESH_DOF_ID_BYTES == 8
    1234         419 :         setvectorvectorvector(uint64_t);
    1235             : #endif
    1236             : 
    1237         406 :         setvectorvectorvector(SubdomainID);
    1238         393 :         setvectorvectorvector(BoundaryID);
    1239         380 :         setvectorvectorvector(string);
    1240         234 :         setvectorvectorvector(FileName);
    1241         221 :         setvectorvectorvector(FileNameNoExtension);
    1242         208 :         setvectorvectorvector(DataFileName);
    1243         208 :         setvectorvectorvector(MeshFileName);
    1244         195 :         setvectorvectorvector(MatrixFileName);
    1245         195 :         setvectorvectorvector(SubdomainName);
    1246         182 :         setvectorvectorvector(BoundaryName);
    1247         169 :         setvectorvectorvector(VariableName);
    1248         169 :         setvectorvectorvector(NonlinearVariableName);
    1249         169 :         setvectorvectorvector(LinearVariableName);
    1250         169 :         setvectorvectorvector(AuxVariableName);
    1251         169 :         setvectorvectorvector(FunctionName);
    1252         156 :         setvectorvectorvector(UserObjectName);
    1253         143 :         setvectorvectorvector(IndicatorName);
    1254         130 :         setvectorvectorvector(MarkerName);
    1255         117 :         setvectorvectorvector(MultiAppName);
    1256         104 :         setvectorvectorvector(PostprocessorName);
    1257          91 :         setvectorvectorvector(VectorPostprocessorName);
    1258          78 :         setvectorvectorvector(MarkerName);
    1259          78 :         setvectorvectorvector(OutputName);
    1260          65 :         setvectorvectorvector(MaterialPropertyName);
    1261          52 :         setvectorvectorvector(MooseFunctorName);
    1262          39 :         setvectorvectorvector(MaterialName);
    1263          26 :         setvectorvectorvector(DistributionName);
    1264          13 :         setvectorvectorvector(SamplerName);
    1265             :         else
    1266             :         {
    1267           0 :           mooseError("unsupported type '", par->type(), "' for input parameter '", full_name, "'");
    1268             :         }
    1269             : 
    1270             : #undef setscalarValueType
    1271             : #undef setscalar
    1272             : #undef setvector
    1273             : #undef setvectorvectorvector
    1274             : #undef setvectorvector
    1275             : #undef setmap
    1276     2663554 :         break;
    1277             :       }
    1278   117249702 :     }
    1279             : 
    1280    57206314 :     if (!found)
    1281             :     {
    1282             :       /**
    1283             :        * Special case handling
    1284             :        *   if the parameter wasn't found in the input file or the cli object the logic in this
    1285             :        * branch will execute
    1286             :        */
    1287             : 
    1288             :       // In the case where we have OutFileName but it wasn't actually found in the input filename,
    1289             :       // we will populate it with the actual parsed filename which is available here in the
    1290             :       // parser.
    1291             : 
    1292             :       InputParameters::Parameter<OutFileBase> * scalar_p =
    1293    54542682 :           dynamic_cast<InputParameters::Parameter<OutFileBase> *>(MooseUtils::get(it.second));
    1294    54542682 :       if (scalar_p)
    1295             :       {
    1296           0 :         std::string input_file_name = getPrimaryFileName();
    1297             :         mooseAssert(input_file_name != "", "Input Filename is nullptr");
    1298           0 :         size_t pos = input_file_name.find_last_of('.');
    1299             :         mooseAssert(pos != std::string::npos, "Unable to determine suffix of input file name");
    1300           0 :         scalar_p->set() = input_file_name.substr(0, pos) + "_out";
    1301           0 :         p.set_attributes(it.first, false);
    1302           0 :       }
    1303             :     }
    1304             :   }
    1305             : 
    1306             :   // All of the parameters for this object have been extracted.  See if there are any errors
    1307     2274361 :   if (!error_stream.str().empty())
    1308          12 :     mooseError(_errmsg + error_stream.str());
    1309             : 
    1310             :   // Here we will see if there are any auto build vectors that need to be created
    1311             :   std::map<std::string, std::pair<std::string, std::string>> auto_build_vectors =
    1312     2274349 :       p.getAutoBuildVectors();
    1313     2274351 :   for (const auto & it : auto_build_vectors)
    1314             :   {
    1315             :     // We'll autogenerate values iff the requested vector is not valid but both the base and
    1316             :     // number
    1317             :     // are valid
    1318           2 :     const std::string & base_name = it.second.first;
    1319           2 :     const std::string & num_repeat = it.second.second;
    1320             : 
    1321           2 :     if (!p.isParamValid(it.first) && p.isParamValid(base_name) && p.isParamValid(num_repeat))
    1322             :     {
    1323           2 :       unsigned int vec_size = p.get<unsigned int>(num_repeat);
    1324           2 :       const std::string & name = p.get<std::string>(base_name);
    1325             : 
    1326           2 :       std::vector<VariableName> variable_names(vec_size);
    1327           6 :       for (unsigned int i = 0; i < vec_size; ++i)
    1328             :       {
    1329           4 :         std::ostringstream oss;
    1330           4 :         oss << name << i;
    1331           4 :         variable_names[i] = oss.str();
    1332           4 :       }
    1333             : 
    1334             :       // Finally set the autogenerated vector into the InputParameters object
    1335           2 :       p.set<std::vector<VariableName>>(it.first) = variable_names;
    1336           2 :     }
    1337             :   }
    1338     2274349 : }
    1339             : 
    1340             : template <typename T>
    1341             : bool
    1342           0 : toBool(const std::string & /*s*/, T & /*val*/)
    1343             : {
    1344           0 :   return false;
    1345             : }
    1346             : 
    1347             : template <>
    1348             : bool
    1349          75 : toBool<bool>(const std::string & s, bool & val)
    1350             : {
    1351          75 :   return hit::toBool(s, &val);
    1352             : }
    1353             : 
    1354             : template <typename T, typename Base>
    1355             : void
    1356     1665401 : Builder::setScalarParameter(const std::string & full_name,
    1357             :                             const std::string & short_name,
    1358             :                             InputParameters::Parameter<T> * param,
    1359             :                             bool in_global,
    1360             :                             GlobalParamsAction * global_block)
    1361             : {
    1362             :   try
    1363             :   {
    1364     1665401 :     param->set() = root()->param<Base>(full_name);
    1365             :   }
    1366        7106 :   catch (hit::Error & err)
    1367             :   {
    1368        3553 :     auto strval = root()->param<std::string>(full_name);
    1369             : 
    1370             :     // handle the case where the user put a number inside quotes
    1371        3553 :     auto & t = typeid(T);
    1372        8222 :     if (t == typeid(int) || t == typeid(unsigned int) || t == typeid(SubdomainID) ||
    1373        8222 :         t == typeid(BoundaryID) || t == typeid(double))
    1374             :     {
    1375             :       try
    1376             :       {
    1377        3478 :         param->set() = MooseUtils::convert<T>(strval, true);
    1378             :       }
    1379           8 :       catch (std::invalid_argument & /*e*/)
    1380             :       {
    1381           4 :         const std::string format_type = (t == typeid(double)) ? "float" : "integer";
    1382           4 :         _errmsg += hit::errormsg(root()->find(full_name),
    1383             :                                  "invalid ",
    1384             :                                  format_type,
    1385             :                                  " syntax for parameter: ",
    1386             :                                  full_name,
    1387             :                                  "=",
    1388             :                                  strval) +
    1389             :                    "\n";
    1390           4 :       }
    1391             :     }
    1392          75 :     else if (t == typeid(bool))
    1393             :     {
    1394          75 :       bool isbool = toBool(strval, param->set());
    1395          75 :       if (!isbool)
    1396           0 :         _errmsg += hit::errormsg(root()->find(full_name),
    1397             :                                  "invalid boolean syntax for parameter: ",
    1398             :                                  full_name,
    1399             :                                  "=",
    1400             :                                  strval) +
    1401             :                    "\n";
    1402             :     }
    1403             :     else
    1404           0 :       throw;
    1405        3553 :   }
    1406             : 
    1407     1665401 :   if (in_global)
    1408             :   {
    1409        8910 :     global_block->remove(short_name);
    1410        8910 :     global_block->setScalarParam<T>(short_name) = param->get();
    1411             :   }
    1412     1665401 : }
    1413             : 
    1414             : template <typename T, typename UP_T, typename Base>
    1415             : void
    1416      414432 : Builder::setScalarValueTypeParameter(const std::string & full_name,
    1417             :                                      const std::string & short_name,
    1418             :                                      InputParameters::Parameter<T> * param,
    1419             :                                      bool in_global,
    1420             :                                      GlobalParamsAction * global_block)
    1421             : {
    1422      414432 :   setScalarParameter<T, Base>(full_name, short_name, param, in_global, global_block);
    1423             : 
    1424             :   // If this is a range checked param, we need to make sure that the value falls within the
    1425             :   // requested range
    1426             :   mooseAssert(_current_params, "Current params is nullptr");
    1427             : 
    1428      414432 :   _current_params->rangeCheck<T, UP_T>(full_name, short_name, param, *_current_error_stream);
    1429      414432 : }
    1430             : 
    1431             : template <typename T, typename Base>
    1432             : void
    1433      342927 : Builder::setVectorParameter(const std::string & full_name,
    1434             :                             const std::string & short_name,
    1435             :                             InputParameters::Parameter<std::vector<T>> * param,
    1436             :                             bool in_global,
    1437             :                             GlobalParamsAction * global_block)
    1438             : {
    1439      342927 :   std::vector<T> vec;
    1440      342927 :   if (root()->find(full_name))
    1441             :   {
    1442             :     try
    1443             :     {
    1444      342927 :       auto tmp = root()->param<std::vector<Base>>(full_name);
    1445      870694 :       for (auto val : tmp)
    1446      527767 :         vec.push_back(val);
    1447      342927 :     }
    1448           0 :     catch (hit::Error & err)
    1449             :     {
    1450           0 :       _errmsg += hit::errormsg(root()->find(full_name), err.what()) + "\n";
    1451           0 :       return;
    1452             :     }
    1453             :   }
    1454             : 
    1455      342927 :   param->set() = vec;
    1456             : 
    1457      342927 :   if (in_global)
    1458             :   {
    1459        1832 :     global_block->remove(short_name);
    1460        1832 :     global_block->setVectorParam<T>(short_name).resize(param->get().size());
    1461        4238 :     for (unsigned int i = 0; i < vec.size(); ++i)
    1462        2406 :       global_block->setVectorParam<T>(short_name)[i] = param->get()[i];
    1463             :   }
    1464      342927 : }
    1465             : 
    1466             : template <typename KeyType, typename MappedType>
    1467             : void
    1468         490 : Builder::setMapParameter(const std::string & full_name,
    1469             :                          const std::string & short_name,
    1470             :                          InputParameters::Parameter<std::map<KeyType, MappedType>> * param,
    1471             :                          bool in_global,
    1472             :                          GlobalParamsAction * global_block)
    1473             : {
    1474         490 :   std::map<KeyType, MappedType> the_map;
    1475         490 :   if (root()->find(full_name))
    1476             :   {
    1477             :     try
    1478             :     {
    1479         490 :       const auto & string_vec = root()->param<std::vector<std::string>>(full_name);
    1480         490 :       auto it = string_vec.begin();
    1481        2510 :       while (it != string_vec.end())
    1482             :       {
    1483        1079 :         const auto & string_key = *it;
    1484        1079 :         ++it;
    1485        1079 :         if (it == string_vec.end())
    1486             :         {
    1487           4 :           _errmsg +=
    1488             :               hit::errormsg(root()->find(full_name),
    1489             :                             "odd number of entries in string vector for map parameter: ",
    1490             :                             full_name,
    1491             :                             ". There must be "
    1492             :                             "an even number or else you will end up with a key without a value!") +
    1493             :               "\n";
    1494           8 :           return;
    1495             :         }
    1496        1075 :         const auto & string_value = *it;
    1497        1075 :         ++it;
    1498             : 
    1499        1075 :         std::pair<KeyType, MappedType> pr;
    1500             :         // key
    1501             :         try
    1502             :         {
    1503        1075 :           pr.first = MooseUtils::convert<KeyType>(string_key, true);
    1504             :         }
    1505           0 :         catch (std::invalid_argument & /*e*/)
    1506             :         {
    1507           0 :           _errmsg += hit::errormsg(root()->find(full_name),
    1508             :                                    "invalid ",
    1509             :                                    demangle(typeid(KeyType).name()),
    1510             :                                    " syntax for map parameter ",
    1511             :                                    full_name,
    1512             :                                    " key: ",
    1513             :                                    string_key) +
    1514             :                      "\n";
    1515           0 :           return;
    1516             :         }
    1517             :         // value
    1518             :         try
    1519             :         {
    1520        1075 :           pr.second = MooseUtils::convert<MappedType>(string_value, true);
    1521             :         }
    1522           4 :         catch (std::invalid_argument & /*e*/)
    1523             :         {
    1524           4 :           _errmsg += hit::errormsg(root()->find(full_name),
    1525             :                                    "invalid ",
    1526             :                                    demangle(typeid(MappedType).name()),
    1527             :                                    " syntax for map parameter ",
    1528             :                                    full_name,
    1529             :                                    " value: ",
    1530             :                                    string_value) +
    1531             :                      "\n";
    1532           4 :           return;
    1533             :         }
    1534             : 
    1535        1071 :         auto insert_pr = the_map.insert(std::move(pr));
    1536        1071 :         if (!insert_pr.second)
    1537             :         {
    1538           0 :           _errmsg += hit::errormsg(root()->find(full_name),
    1539             :                                    "Duplicate map entry for map parameter: ",
    1540             :                                    full_name,
    1541             :                                    ". The key ",
    1542             :                                    string_key,
    1543             :                                    " appears multiple times.") +
    1544             :                      "\n";
    1545           0 :           return;
    1546             :         }
    1547             :       }
    1548         490 :     }
    1549           0 :     catch (hit::Error & err)
    1550             :     {
    1551           0 :       _errmsg += hit::errormsg(root()->find(full_name), err.what()) + "\n";
    1552           0 :       return;
    1553             :     }
    1554             :   }
    1555             : 
    1556         482 :   param->set() = the_map;
    1557             : 
    1558         482 :   if (in_global)
    1559             :   {
    1560           0 :     global_block->remove(short_name);
    1561           0 :     auto & global_map = global_block->setParam<std::map<KeyType, MappedType>>(short_name);
    1562           0 :     for (const auto & pair : the_map)
    1563           0 :       global_map.insert(pair);
    1564             :   }
    1565         490 : }
    1566             : 
    1567             : template <typename T>
    1568             : void
    1569        4915 : Builder::setDoubleIndexParameter(const std::string & full_name,
    1570             :                                  const std::string & short_name,
    1571             :                                  InputParameters::Parameter<std::vector<std::vector<T>>> * param,
    1572             :                                  bool in_global,
    1573             :                                  GlobalParamsAction * global_block)
    1574             : {
    1575        4915 :   auto & value = param->set();
    1576             : 
    1577             :   // Get the full string assigned to the variable full_name
    1578        4915 :   const auto value_string = MooseUtils::trim(root()->param<std::string>(full_name));
    1579             : 
    1580             :   // split vector at delim ;
    1581             :   // NOTE: the substrings are _not_ of type T yet
    1582             :   // The zero length here is intentional, as we want something like:
    1583             :   // "abc; 123;" -> ["abc", "123", ""]
    1584        4915 :   std::vector<std::string> outer_string_vectors;
    1585             :   // With split, we will get a single entry if the string value is empty. However,
    1586             :   // that should represent an empty vector<vector>. Therefore, only split if we have values.
    1587        4915 :   if (!value_string.empty())
    1588        4895 :     outer_string_vectors = MooseUtils::split(value_string, ";");
    1589             : 
    1590        4915 :   const auto outer_vector_size = outer_string_vectors.size();
    1591        4915 :   value.resize(outer_vector_size);
    1592             : 
    1593       13785 :   for (const auto j : index_range(outer_string_vectors))
    1594        8870 :     if (!MooseUtils::tokenizeAndConvert<T>(outer_string_vectors[j], value[j]))
    1595             :     {
    1596           0 :       _errmsg +=
    1597             :           hit::errormsg(root()->find(full_name), "invalid format for parameter ", full_name) + "\n";
    1598           0 :       return;
    1599             :     }
    1600             : 
    1601        4915 :   if (in_global)
    1602             :   {
    1603           0 :     global_block->remove(short_name);
    1604           0 :     global_block->setDoubleIndexParam<T>(short_name).resize(outer_vector_size);
    1605           0 :     for (const auto j : make_range(outer_vector_size))
    1606             :     {
    1607           0 :       global_block->setDoubleIndexParam<T>(short_name)[j].resize(value[j].size());
    1608           0 :       for (const auto i : index_range(value[j]))
    1609           0 :         global_block->setDoubleIndexParam<T>(short_name)[j][i] = value[j][i];
    1610             :     }
    1611             :   }
    1612        4915 : }
    1613             : 
    1614             : template <typename T>
    1615             : void
    1616         622 : Builder::setTripleIndexParameter(
    1617             :     const std::string & full_name,
    1618             :     const std::string & short_name,
    1619             :     InputParameters::Parameter<std::vector<std::vector<std::vector<T>>>> * param,
    1620             :     bool in_global,
    1621             :     GlobalParamsAction * global_block)
    1622             : {
    1623             :   // Get the full string assigned to the variable full_name
    1624         622 :   const std::string buffer_raw = root()->param<std::string>(full_name);
    1625             :   // In case the parameter is empty
    1626         622 :   if (buffer_raw.find_first_not_of(' ', 0) == std::string::npos)
    1627           0 :     return;
    1628             : 
    1629             :   // Add a space between neighboring delim's, before the first delim if nothing is ahead of it, and
    1630             :   // after the last delim if nothing is behind it.
    1631         622 :   std::string buffer;
    1632         622 :   buffer.push_back(buffer_raw[0]);
    1633         622 :   if (buffer[0] == '|' || buffer[0] == ';')
    1634          39 :     buffer = ' ' + buffer;
    1635       78323 :   for (std::string::size_type i = 1; i < buffer_raw.size(); i++)
    1636             :   {
    1637       80520 :     if ((buffer_raw[i - 1] == '|' || buffer_raw[i - 1] == ';') &&
    1638        2819 :         (buffer_raw[i] == '|' || buffer_raw[i] == ';'))
    1639          91 :       buffer.push_back(' ');
    1640       77701 :     buffer.push_back(buffer_raw[i]);
    1641             :   }
    1642         622 :   if (buffer.back() == '|' || buffer.back() == ';')
    1643          17 :     buffer.push_back(' ');
    1644             : 
    1645             :   // split vector at delim | to get a series of 2D subvectors
    1646         622 :   std::vector<std::string> first_tokenized_vector;
    1647         622 :   std::vector<std::vector<std::string>> second_tokenized_vector;
    1648         622 :   MooseUtils::tokenize(buffer, first_tokenized_vector, 1, "|");
    1649         622 :   param->set().resize(first_tokenized_vector.size());
    1650         622 :   second_tokenized_vector.resize(first_tokenized_vector.size());
    1651        2079 :   for (unsigned j = 0; j < first_tokenized_vector.size(); ++j)
    1652             :   {
    1653             :     // Identify empty subvector first
    1654        1457 :     if (first_tokenized_vector[j].find_first_not_of(' ', 0) == std::string::npos)
    1655             :     {
    1656          82 :       param->set()[j].resize(0);
    1657          82 :       continue;
    1658             :     }
    1659             :     // split each 2D subvector at delim ; to get 1D sub-subvectors
    1660             :     // NOTE: the 1D sub-subvectors are _not_ of type T yet
    1661        1375 :     MooseUtils::tokenize(first_tokenized_vector[j], second_tokenized_vector[j], 1, ";");
    1662        1375 :     param->set()[j].resize(second_tokenized_vector[j].size());
    1663        4751 :     for (unsigned k = 0; k < second_tokenized_vector[j].size(); ++k)
    1664        3376 :       if (!MooseUtils::tokenizeAndConvert<T>(second_tokenized_vector[j][k], param->set()[j][k]))
    1665             :       {
    1666           0 :         _errmsg +=
    1667             :             hit::errormsg(root()->find(full_name), "invalid format for parameter ", full_name) +
    1668             :             "\n";
    1669           0 :         return;
    1670             :       }
    1671             :   }
    1672             : 
    1673         622 :   if (in_global)
    1674             :   {
    1675          13 :     global_block->remove(short_name);
    1676          13 :     global_block->setTripleIndexParam<T>(short_name).resize(first_tokenized_vector.size());
    1677          52 :     for (unsigned j = 0; j < first_tokenized_vector.size(); ++j)
    1678             :     {
    1679          39 :       global_block->setTripleIndexParam<T>(short_name)[j].resize(second_tokenized_vector[j].size());
    1680         130 :       for (unsigned k = 0; k < second_tokenized_vector[j].size(); ++k)
    1681             :       {
    1682          91 :         global_block->setTripleIndexParam<T>(short_name)[j][k].resize(param->get()[j][k].size());
    1683         273 :         for (unsigned int i = 0; i < param->get()[j][k].size(); ++i)
    1684         182 :           global_block->setTripleIndexParam<T>(short_name)[j][k][i] = param->get()[j][k][i];
    1685             :       }
    1686             :     }
    1687             :   }
    1688         622 : }
    1689             : 
    1690             : template <typename T>
    1691             : void
    1692       27792 : Builder::setScalarComponentParameter(const std::string & full_name,
    1693             :                                      const std::string & short_name,
    1694             :                                      InputParameters::Parameter<T> * param,
    1695             :                                      bool in_global,
    1696             :                                      GlobalParamsAction * global_block)
    1697             : {
    1698       27792 :   std::vector<double> vec;
    1699             :   try
    1700             :   {
    1701       27792 :     vec = root()->param<std::vector<double>>(full_name);
    1702             :   }
    1703           0 :   catch (hit::Error & err)
    1704             :   {
    1705           0 :     _errmsg += hit::errormsg(root()->find(full_name), err.what()) + "\n";
    1706           0 :     return;
    1707             :   }
    1708             : 
    1709       27792 :   if (vec.size() != LIBMESH_DIM)
    1710             :   {
    1711           0 :     _errmsg += hit::errormsg(root()->find(full_name),
    1712             :                              "wrong number of values in scalar component parameter ",
    1713             :                              full_name,
    1714             :                              ": ",
    1715             :                              short_name,
    1716             :                              " was given ",
    1717             :                              vec.size(),
    1718             :                              " components but should have ",
    1719             :                              LIBMESH_DIM) +
    1720             :                "\n";
    1721           0 :     return;
    1722             :   }
    1723             : 
    1724       27792 :   T value;
    1725      111168 :   for (unsigned int i = 0; i < vec.size(); ++i)
    1726       83376 :     value(i) = Real(vec[i]);
    1727             : 
    1728       27792 :   param->set() = value;
    1729       27792 :   if (in_global)
    1730             :   {
    1731           0 :     global_block->remove(short_name);
    1732           0 :     global_block->setScalarParam<T>(short_name) = value;
    1733             :   }
    1734       27792 : }
    1735             : 
    1736             : template <typename T>
    1737             : void
    1738        8723 : Builder::setVectorComponentParameter(const std::string & full_name,
    1739             :                                      const std::string & short_name,
    1740             :                                      InputParameters::Parameter<std::vector<T>> * param,
    1741             :                                      bool in_global,
    1742             :                                      GlobalParamsAction * global_block)
    1743             : {
    1744        8723 :   std::vector<double> vec;
    1745             :   try
    1746             :   {
    1747        8723 :     vec = root()->param<std::vector<double>>(full_name);
    1748             :   }
    1749           0 :   catch (hit::Error & err)
    1750             :   {
    1751           0 :     _errmsg += hit::errormsg(root()->find(full_name), err.what()) + "\n";
    1752           0 :     return;
    1753             :   }
    1754             : 
    1755        8723 :   if (vec.size() % LIBMESH_DIM)
    1756             :   {
    1757           4 :     _errmsg += hit::errormsg(root()->find(full_name),
    1758             :                              "wrong number of values in vector component parameter ",
    1759             :                              full_name,
    1760             :                              ": size ",
    1761             :                              vec.size(),
    1762             :                              " is not a multiple of ",
    1763             :                              LIBMESH_DIM) +
    1764             :                "\n";
    1765           4 :     return;
    1766             :   }
    1767             : 
    1768        8719 :   std::vector<T> values;
    1769       30538 :   for (unsigned int i = 0; i < vec.size() / LIBMESH_DIM; ++i)
    1770             :   {
    1771       21819 :     T value;
    1772       87276 :     for (int j = 0; j < LIBMESH_DIM; ++j)
    1773       65457 :       value(j) = Real(vec[i * LIBMESH_DIM + j]);
    1774       21819 :     values.push_back(value);
    1775             :   }
    1776             : 
    1777        8719 :   param->set() = values;
    1778             : 
    1779        8719 :   if (in_global)
    1780             :   {
    1781           0 :     global_block->remove(short_name);
    1782           0 :     global_block->setVectorParam<T>(short_name).resize(vec.size(), values[0]);
    1783           0 :     for (unsigned int i = 0; i < vec.size() / LIBMESH_DIM; ++i)
    1784           0 :       global_block->setVectorParam<T>(short_name)[i] = values[0];
    1785             :   }
    1786        8723 : }
    1787             : 
    1788             : template <typename T>
    1789             : void
    1790         115 : Builder::setVectorVectorComponentParameter(
    1791             :     const std::string & full_name,
    1792             :     const std::string & short_name,
    1793             :     InputParameters::Parameter<std::vector<std::vector<T>>> * param,
    1794             :     bool in_global,
    1795             :     GlobalParamsAction * global_block)
    1796             : {
    1797             :   // Get the full string assigned to the variable full_name
    1798         115 :   std::string buffer = root()->param<std::string>(full_name);
    1799             : 
    1800             :   // split vector at delim ;
    1801             :   // NOTE: the substrings are _not_ of type T yet
    1802         115 :   std::vector<std::string> first_tokenized_vector;
    1803         115 :   MooseUtils::tokenize(buffer, first_tokenized_vector, 1, ";");
    1804         115 :   param->set().resize(first_tokenized_vector.size());
    1805             : 
    1806             :   // get a vector<vector<double>> first
    1807         115 :   std::vector<std::vector<double>> vecvec(first_tokenized_vector.size());
    1808         345 :   for (unsigned j = 0; j < vecvec.size(); ++j)
    1809         230 :     if (!MooseUtils::tokenizeAndConvert<double>(first_tokenized_vector[j], vecvec[j]))
    1810             :     {
    1811           0 :       _errmsg +=
    1812             :           hit::errormsg(root()->find(full_name), "invalid format for parameter ", full_name) + "\n";
    1813           0 :       return;
    1814             :     }
    1815             : 
    1816         345 :   for (const auto & vec : vecvec)
    1817         230 :     if (vec.size() % LIBMESH_DIM)
    1818             :     {
    1819           0 :       _errmsg +=
    1820             :           hit::errormsg(root()->find(full_name),
    1821             :                         "wrong number of values in double-indexed vector component parameter ",
    1822             :                         full_name,
    1823             :                         ": size of subcomponent ",
    1824             :                         vec.size(),
    1825             :                         " is not a multiple of ",
    1826             :                         LIBMESH_DIM) +
    1827             :           "\n";
    1828           0 :       return;
    1829             :     }
    1830             : 
    1831             :   // convert vector<vector<double>> to vector<vector<T>>
    1832         115 :   std::vector<std::vector<T>> values(vecvec.size());
    1833         345 :   for (unsigned int id_vec = 0; id_vec < vecvec.size(); ++id_vec)
    1834         805 :     for (unsigned int i = 0; i < vecvec[id_vec].size() / LIBMESH_DIM; ++i)
    1835             :     {
    1836         575 :       T value;
    1837        2300 :       for (int j = 0; j < LIBMESH_DIM; ++j)
    1838        1725 :         value(j) = Real(vecvec[id_vec][i * LIBMESH_DIM + j]);
    1839         575 :       values[id_vec].push_back(value);
    1840             :     }
    1841             : 
    1842         115 :   param->set() = values;
    1843             : 
    1844         115 :   if (in_global)
    1845             :   {
    1846         115 :     global_block->remove(short_name);
    1847         115 :     global_block->setDoubleIndexParam<T>(short_name).resize(vecvec.size());
    1848         345 :     for (unsigned j = 0; j < vecvec.size(); ++j)
    1849             :     {
    1850         230 :       global_block->setDoubleIndexParam<T>(short_name)[j].resize(param->get()[j].size() /
    1851             :                                                                  LIBMESH_DIM);
    1852         345 :       for (unsigned int i = 0; i < param->get()[j].size() / LIBMESH_DIM; ++i)
    1853         115 :         global_block->setDoubleIndexParam<T>(short_name)[j][i] = values[j][i];
    1854             :     }
    1855             :   }
    1856         115 : }
    1857             : 
    1858             : template <>
    1859             : void
    1860       19847 : Builder::setScalarParameter<RealVectorValue, RealVectorValue>(
    1861             :     const std::string & full_name,
    1862             :     const std::string & short_name,
    1863             :     InputParameters::Parameter<RealVectorValue> * param,
    1864             :     bool in_global,
    1865             :     GlobalParamsAction * global_block)
    1866             : {
    1867       19847 :   setScalarComponentParameter(full_name, short_name, param, in_global, global_block);
    1868       19847 : }
    1869             : 
    1870             : template <>
    1871             : void
    1872        7945 : Builder::setScalarParameter<Point, Point>(const std::string & full_name,
    1873             :                                           const std::string & short_name,
    1874             :                                           InputParameters::Parameter<Point> * param,
    1875             :                                           bool in_global,
    1876             :                                           GlobalParamsAction * global_block)
    1877             : {
    1878        7945 :   setScalarComponentParameter(full_name, short_name, param, in_global, global_block);
    1879        7945 : }
    1880             : 
    1881             : template <>
    1882             : void
    1883        1969 : Builder::setScalarParameter<RealEigenVector, RealEigenVector>(
    1884             :     const std::string & full_name,
    1885             :     const std::string & short_name,
    1886             :     InputParameters::Parameter<RealEigenVector> * param,
    1887             :     bool in_global,
    1888             :     GlobalParamsAction * global_block)
    1889             : {
    1890        1969 :   std::vector<double> vec;
    1891             :   try
    1892             :   {
    1893        1969 :     vec = root()->param<std::vector<double>>(full_name);
    1894             :   }
    1895           0 :   catch (hit::Error & err)
    1896             :   {
    1897           0 :     _errmsg += hit::errormsg(root()->find(full_name), err.what()) + "\n";
    1898           0 :     return;
    1899           0 :   }
    1900             : 
    1901        1969 :   RealEigenVector value(vec.size());
    1902        6336 :   for (unsigned int i = 0; i < vec.size(); ++i)
    1903        4367 :     value(i) = Real(vec[i]);
    1904             : 
    1905        1969 :   param->set() = value;
    1906        1969 :   if (in_global)
    1907             :   {
    1908           0 :     global_block->remove(short_name);
    1909           0 :     global_block->setScalarParam<RealEigenVector>(short_name) = value;
    1910             :   }
    1911        1969 : }
    1912             : 
    1913             : template <>
    1914             : void
    1915         147 : Builder::setScalarParameter<RealEigenMatrix, RealEigenMatrix>(
    1916             :     const std::string & full_name,
    1917             :     const std::string & short_name,
    1918             :     InputParameters::Parameter<RealEigenMatrix> * param,
    1919             :     bool in_global,
    1920             :     GlobalParamsAction * global_block)
    1921             : {
    1922             :   // Get the full string assigned to the variable full_name
    1923         147 :   std::string buffer = root()->param<std::string>(full_name);
    1924             : 
    1925             :   // split vector at delim ;
    1926             :   // NOTE: the substrings are _not_ of type T yet
    1927         147 :   std::vector<std::string> first_tokenized_vector;
    1928         147 :   MooseUtils::tokenize(buffer, first_tokenized_vector, 1, ";");
    1929             : 
    1930         147 :   std::vector<std::vector<Real>> values(first_tokenized_vector.size());
    1931             : 
    1932         441 :   for (unsigned j = 0; j < first_tokenized_vector.size(); ++j)
    1933             :   {
    1934         294 :     if (!MooseUtils::tokenizeAndConvert<Real>(first_tokenized_vector[j], values[j]))
    1935             :     {
    1936             :       _errmsg +=
    1937           0 :           hit::errormsg(root()->find(full_name), "invalid format for parameter ", full_name) + "\n";
    1938           0 :       return;
    1939             :     }
    1940         294 :     if (j != 0 && values[j].size() != values[0].size())
    1941             :     {
    1942             :       _errmsg +=
    1943           0 :           hit::errormsg(root()->find(full_name), "invalid format for parameter ", full_name) + "\n";
    1944           0 :       return;
    1945             :     }
    1946             :   }
    1947             : 
    1948         147 :   RealEigenMatrix value(values.size(), values[0].size());
    1949         441 :   for (unsigned int i = 0; i < values.size(); ++i)
    1950         882 :     for (unsigned int j = 0; j < values[i].size(); ++j)
    1951         588 :       value(i, j) = values[i][j];
    1952             : 
    1953         147 :   param->set() = value;
    1954         147 :   if (in_global)
    1955             :   {
    1956           0 :     global_block->remove(short_name);
    1957           0 :     global_block->setScalarParam<RealEigenMatrix>(short_name) = value;
    1958             :   }
    1959         147 : }
    1960             : 
    1961             : template <>
    1962             : void
    1963      427428 : Builder::setScalarParameter<MooseEnum, MooseEnum>(const std::string & full_name,
    1964             :                                                   const std::string & short_name,
    1965             :                                                   InputParameters::Parameter<MooseEnum> * param,
    1966             :                                                   bool in_global,
    1967             :                                                   GlobalParamsAction * global_block)
    1968             : {
    1969      427428 :   MooseEnum current_param = param->get();
    1970             : 
    1971      427428 :   std::string value = root()->param<std::string>(full_name);
    1972             : 
    1973      427428 :   param->set() = value;
    1974      427416 :   if (in_global)
    1975             :   {
    1976       47894 :     global_block->remove(short_name);
    1977       47894 :     global_block->setScalarParam<MooseEnum>(short_name) = current_param;
    1978             :   }
    1979      427416 : }
    1980             : 
    1981             : template <>
    1982             : void
    1983       33835 : Builder::setScalarParameter<MultiMooseEnum, MultiMooseEnum>(
    1984             :     const std::string & full_name,
    1985             :     const std::string & short_name,
    1986             :     InputParameters::Parameter<MultiMooseEnum> * param,
    1987             :     bool in_global,
    1988             :     GlobalParamsAction * global_block)
    1989             : {
    1990       33835 :   MultiMooseEnum current_param = param->get();
    1991             : 
    1992       33835 :   auto vec = root()->param<std::vector<std::string>>(full_name);
    1993             : 
    1994       33835 :   std::string raw_values;
    1995       98553 :   for (unsigned int i = 0; i < vec.size(); ++i)
    1996       64718 :     raw_values += ' ' + vec[i];
    1997             : 
    1998       33835 :   param->set() = raw_values;
    1999             : 
    2000       33835 :   if (in_global)
    2001             :   {
    2002           0 :     global_block->remove(short_name);
    2003           0 :     global_block->setScalarParam<MultiMooseEnum>(short_name) = current_param;
    2004             :   }
    2005       33835 : }
    2006             : 
    2007             : template <>
    2008             : void
    2009       57659 : Builder::setScalarParameter<ExecFlagEnum, ExecFlagEnum>(
    2010             :     const std::string & full_name,
    2011             :     const std::string & short_name,
    2012             :     InputParameters::Parameter<ExecFlagEnum> * param,
    2013             :     bool in_global,
    2014             :     GlobalParamsAction * global_block)
    2015             : {
    2016       57659 :   ExecFlagEnum current_param = param->get();
    2017       57659 :   auto vec = root()->param<std::vector<std::string>>(full_name);
    2018             : 
    2019       57659 :   std::string raw_values;
    2020      133118 :   for (unsigned int i = 0; i < vec.size(); ++i)
    2021       75459 :     raw_values += ' ' + vec[i];
    2022             : 
    2023       57659 :   param->set() = raw_values;
    2024             : 
    2025       57659 :   if (in_global)
    2026             :   {
    2027         110 :     global_block->remove(short_name);
    2028         110 :     global_block->setScalarParam<ExecFlagEnum>(short_name) = current_param;
    2029             :   }
    2030       57659 : }
    2031             : 
    2032             : template <>
    2033             : void
    2034          39 : Builder::setScalarParameter<RealTensorValue, RealTensorValue>(
    2035             :     const std::string & full_name,
    2036             :     const std::string & short_name,
    2037             :     InputParameters::Parameter<RealTensorValue> * param,
    2038             :     bool in_global,
    2039             :     GlobalParamsAction * global_block)
    2040             : {
    2041          39 :   auto vec = root()->param<std::vector<double>>(full_name);
    2042          39 :   if (vec.size() != LIBMESH_DIM * LIBMESH_DIM)
    2043             :   {
    2044           0 :     _errmsg += hit::errormsg(root()->find(full_name),
    2045             :                              "invalid RealTensorValue parameter ",
    2046             :                              full_name,
    2047             :                              ": size is ",
    2048             :                              vec.size(),
    2049             :                              " but should be ",
    2050           0 :                              LIBMESH_DIM * LIBMESH_DIM) +
    2051           0 :                "\n";
    2052           0 :     return;
    2053             :   }
    2054             : 
    2055          39 :   RealTensorValue value;
    2056         156 :   for (int i = 0; i < LIBMESH_DIM; ++i)
    2057         468 :     for (int j = 0; j < LIBMESH_DIM; ++j)
    2058         351 :       value(i, j) = Real(vec[i * LIBMESH_DIM + j]);
    2059             : 
    2060          39 :   param->set() = value;
    2061          39 :   if (in_global)
    2062             :   {
    2063           0 :     global_block->remove(short_name);
    2064           0 :     global_block->setScalarParam<RealTensorValue>(short_name) = value;
    2065             :   }
    2066          39 : }
    2067             : 
    2068             : // Specialization for coupling a Real value where a postprocessor would be needed in MOOSE
    2069             : template <>
    2070             : void
    2071        8227 : Builder::setScalarParameter<PostprocessorName, PostprocessorName>(
    2072             :     const std::string & full_name,
    2073             :     const std::string & short_name,
    2074             :     InputParameters::Parameter<PostprocessorName> * param,
    2075             :     bool in_global,
    2076             :     GlobalParamsAction * global_block)
    2077             : {
    2078        8227 :   PostprocessorName pps_name = root()->param<std::string>(full_name);
    2079        8227 :   param->set() = pps_name;
    2080             : 
    2081        8227 :   if (in_global)
    2082             :   {
    2083           0 :     global_block->remove(short_name);
    2084           0 :     global_block->setScalarParam<PostprocessorName>(short_name) = pps_name;
    2085             :   }
    2086        8227 : }
    2087             : 
    2088             : template <>
    2089             : void
    2090         937 : Builder::setScalarParameter<ReporterName, std::string>(
    2091             :     const std::string & full_name,
    2092             :     const std::string & /*short_name*/,
    2093             :     InputParameters::Parameter<ReporterName> * param,
    2094             :     bool /*in_global*/,
    2095             :     GlobalParamsAction * /*global_block*/)
    2096             : {
    2097             :   std::vector<std::string> names =
    2098         937 :       MooseUtils::rsplit(root()->param<std::string>(full_name), "/", 2);
    2099         937 :   if (names.size() != 2)
    2100           8 :     _errmsg += hit::errormsg(root()->find(full_name),
    2101             :                              "The supplied name ReporterName '",
    2102             :                              full_name,
    2103           4 :                              "' must contain the '/' delimiter.");
    2104             :   else
    2105         933 :     param->set() = ReporterName(names[0], names[1]);
    2106         937 : }
    2107             : 
    2108             : template <>
    2109             : void
    2110          59 : Builder::setVectorParameter<RealVectorValue, RealVectorValue>(
    2111             :     const std::string & full_name,
    2112             :     const std::string & short_name,
    2113             :     InputParameters::Parameter<std::vector<RealVectorValue>> * param,
    2114             :     bool in_global,
    2115             :     GlobalParamsAction * global_block)
    2116             : {
    2117          59 :   setVectorComponentParameter(full_name, short_name, param, in_global, global_block);
    2118          59 : }
    2119             : 
    2120             : template <>
    2121             : void
    2122        8664 : Builder::setVectorParameter<Point, Point>(const std::string & full_name,
    2123             :                                           const std::string & short_name,
    2124             :                                           InputParameters::Parameter<std::vector<Point>> * param,
    2125             :                                           bool in_global,
    2126             :                                           GlobalParamsAction * global_block)
    2127             : {
    2128        8664 :   setVectorComponentParameter(full_name, short_name, param, in_global, global_block);
    2129        8664 : }
    2130             : 
    2131             : template <>
    2132             : void
    2133          52 : Builder::setVectorParameter<MooseEnum, MooseEnum>(
    2134             :     const std::string & full_name,
    2135             :     const std::string & short_name,
    2136             :     InputParameters::Parameter<std::vector<MooseEnum>> * param,
    2137             :     bool in_global,
    2138             :     GlobalParamsAction * global_block)
    2139             : {
    2140          52 :   std::vector<MooseEnum> enum_values = param->get();
    2141          52 :   std::vector<std::string> values(enum_values.size());
    2142         104 :   for (unsigned int i = 0; i < values.size(); ++i)
    2143          52 :     values[i] = static_cast<std::string>(enum_values[i]);
    2144             : 
    2145             :   /**
    2146             :    * With MOOSE Enums we need a default object so it should have been passed in the param pointer.
    2147             :    * We are only going to use the first item in the vector (values[0]) and ignore the rest.
    2148             :    */
    2149          52 :   std::vector<std::string> vec;
    2150          52 :   if (root()->find(full_name))
    2151             :   {
    2152          52 :     vec = root()->param<std::vector<std::string>>(full_name);
    2153          52 :     param->set().resize(vec.size(), enum_values[0]);
    2154             :   }
    2155             : 
    2156         156 :   for (unsigned int i = 0; i < vec.size(); ++i)
    2157         104 :     param->set()[i] = vec[i];
    2158             : 
    2159          52 :   if (in_global)
    2160             :   {
    2161           0 :     global_block->remove(short_name);
    2162           0 :     global_block->setVectorParam<MooseEnum>(short_name).resize(vec.size(), enum_values[0]);
    2163           0 :     for (unsigned int i = 0; i < vec.size(); ++i)
    2164           0 :       global_block->setVectorParam<MooseEnum>(short_name)[i] = values[0];
    2165             :   }
    2166          52 : }
    2167             : 
    2168             : template <>
    2169             : void
    2170          18 : Builder::setVectorParameter<MultiMooseEnum, MultiMooseEnum>(
    2171             :     const std::string & full_name,
    2172             :     const std::string & short_name,
    2173             :     InputParameters::Parameter<std::vector<MultiMooseEnum>> * param,
    2174             :     bool in_global,
    2175             :     GlobalParamsAction * global_block)
    2176             : {
    2177          18 :   const std::vector<MultiMooseEnum> & enum_values = param->get();
    2178             : 
    2179             :   // Get the full string assigned to the variable full_name
    2180          18 :   std::string buffer = root()->param<std::string>(full_name);
    2181             : 
    2182          18 :   std::vector<std::string> first_tokenized_vector = MooseUtils::split(buffer, ";");
    2183          86 :   for (const auto & i : first_tokenized_vector)
    2184          72 :     if (MooseUtils::trim(i) == "")
    2185           4 :       mooseError("In " + full_name + ", one entry in the vector is empty.  This is not allowed.");
    2186             : 
    2187          14 :   param->set().resize(first_tokenized_vector.size(), enum_values[0]);
    2188             : 
    2189          14 :   std::vector<std::vector<std::string>> vecvec(first_tokenized_vector.size());
    2190          74 :   for (const auto i : index_range(vecvec))
    2191             :   {
    2192          64 :     MooseUtils::tokenize<std::string>(first_tokenized_vector[i], vecvec[i], 1, " ");
    2193          64 :     param->set()[i] = vecvec[i];
    2194             :   }
    2195             : 
    2196          10 :   if (in_global)
    2197             :   {
    2198           0 :     global_block->remove(short_name);
    2199           0 :     global_block->setVectorParam<MultiMooseEnum>(short_name).resize(vecvec.size(), enum_values[0]);
    2200           0 :     for (unsigned int i = 0; i < vecvec.size(); ++i)
    2201           0 :       global_block->setVectorParam<MultiMooseEnum>(short_name)[i] = vecvec[i];
    2202             :   }
    2203          10 : }
    2204             : 
    2205             : template <>
    2206             : void
    2207        2398 : Builder::setVectorParameter<PostprocessorName, PostprocessorName>(
    2208             :     const std::string & full_name,
    2209             :     const std::string & short_name,
    2210             :     InputParameters::Parameter<std::vector<PostprocessorName>> * param,
    2211             :     bool in_global,
    2212             :     GlobalParamsAction * global_block)
    2213             : {
    2214        2398 :   std::vector<std::string> pps_names = root()->param<std::vector<std::string>>(full_name);
    2215        2398 :   unsigned int n = pps_names.size();
    2216        2398 :   param->set().resize(n);
    2217             : 
    2218        5990 :   for (unsigned int j = 0; j < n; ++j)
    2219        3592 :     param->set()[j] = pps_names[j];
    2220             : 
    2221        2398 :   if (in_global)
    2222             :   {
    2223           0 :     global_block->remove(short_name);
    2224           0 :     global_block->setVectorParam<PostprocessorName>(short_name).resize(n, "");
    2225           0 :     for (unsigned int j = 0; j < n; ++j)
    2226           0 :       global_block->setVectorParam<PostprocessorName>(short_name)[j] = pps_names[j];
    2227             :   }
    2228        2398 : }
    2229             : 
    2230             : /**
    2231             :  * Specialization for coupling vectors. This routine handles default values and auto generated
    2232             :  * VariableValue vectors.
    2233             :  */
    2234             : template <>
    2235             : void
    2236       76829 : Builder::setVectorParameter<VariableName, VariableName>(
    2237             :     const std::string & full_name,
    2238             :     const std::string & short_name,
    2239             :     InputParameters::Parameter<std::vector<VariableName>> * param,
    2240             :     bool /*in_global*/,
    2241             :     GlobalParamsAction * /*global_block*/)
    2242             : {
    2243       76829 :   auto vec = root()->param<std::vector<std::string>>(full_name);
    2244       76829 :   auto strval = root()->param<std::string>(full_name);
    2245       76829 :   std::vector<VariableName> var_names(vec.size());
    2246             : 
    2247       76829 :   bool has_var_names = false;
    2248      163213 :   for (unsigned int i = 0; i < vec.size(); ++i)
    2249             :   {
    2250       86384 :     VariableName var_name = vec[i];
    2251             : 
    2252             :     Real real_value;
    2253       86384 :     std::istringstream ss(var_name);
    2254             : 
    2255             :     // If we are able to convert this value into a Real, then set a default coupled value
    2256             :     // NOTE: parameter must be either all default or no defaults
    2257       86384 :     if (ss >> real_value && ss.eof())
    2258         983 :       _current_params->defaultCoupledValue(short_name, real_value, i);
    2259             :     else
    2260             :     {
    2261       85401 :       var_names[i] = var_name;
    2262       85401 :       has_var_names = true;
    2263             :     }
    2264       86384 :   }
    2265             : 
    2266       76829 :   if (has_var_names)
    2267             :   {
    2268       76369 :     param->set().resize(vec.size());
    2269             : 
    2270      161766 :     for (unsigned int i = 0; i < vec.size(); ++i)
    2271       85401 :       if (var_names[i] == "")
    2272             :       {
    2273           8 :         _errmsg += hit::errormsg(root()->find(full_name),
    2274             :                                  "invalid value for ",
    2275             :                                  full_name,
    2276             :                                  ":\n"
    2277             :                                  "    MOOSE does not currently support a coupled vector where "
    2278             :                                  "some parameters are ",
    2279           8 :                                  "reals and others are variables") +
    2280           4 :                    "\n";
    2281           4 :         return;
    2282             :       }
    2283             :       else
    2284       85397 :         param->set()[i] = var_names[i];
    2285             :   }
    2286       76837 : }
    2287             : 
    2288             : template <>
    2289             : void
    2290        1174 : Builder::setVectorParameter<ReporterName, std::string>(
    2291             :     const std::string & full_name,
    2292             :     const std::string & /*short_name*/,
    2293             :     InputParameters::Parameter<std::vector<ReporterName>> * param,
    2294             :     bool /*in_global*/,
    2295             :     GlobalParamsAction * /*global_block*/)
    2296             : {
    2297        1174 :   auto rnames = root()->param<std::vector<std::string>>(full_name);
    2298        1174 :   param->set().resize(rnames.size());
    2299             : 
    2300        3346 :   for (unsigned int i = 0; i < rnames.size(); ++i)
    2301             :   {
    2302        2172 :     std::vector<std::string> names = MooseUtils::rsplit(rnames[i], "/", 2);
    2303        2172 :     if (names.size() != 2)
    2304           0 :       _errmsg += hit::errormsg(root()->find(full_name),
    2305             :                                "The supplied name ReporterName '",
    2306           0 :                                rnames[i],
    2307           0 :                                "' must contain the '/' delimiter.");
    2308             :     else
    2309        2172 :       param->set()[i] = ReporterName(names[0], names[1]);
    2310        2172 :   }
    2311        1174 : }
    2312             : 
    2313             : template <>
    2314             : void
    2315        1877 : Builder::setVectorParameter<CLIArgString, std::string>(
    2316             :     const std::string & full_name,
    2317             :     const std::string & /*short_name*/,
    2318             :     InputParameters::Parameter<std::vector<CLIArgString>> * param,
    2319             :     bool /*in_global*/,
    2320             :     GlobalParamsAction * /*global_block*/)
    2321             : {
    2322             :   // Parsed as a vector of string, the vectors parameters are being cut
    2323        1877 :   auto rnames = root()->param<std::vector<std::string>>(full_name);
    2324        1877 :   param->set().resize(rnames.size()); // slightly oversized if vectors have been split
    2325             : 
    2326             :   // Skip empty parameter
    2327        1877 :   if (rnames.empty())
    2328           4 :     return;
    2329             : 
    2330             :   // Re-assemble vector parameters
    2331        1873 :   unsigned int i_param = 0;
    2332        1873 :   bool vector_param_detected = false;
    2333        5212 :   for (unsigned int i = 0; i < rnames.size(); ++i)
    2334             :   {
    2335             :     // Look for a quote, both types
    2336             :     std::vector<std::string> double_split =
    2337        3339 :         MooseUtils::rsplit(rnames[i], "\"", std::numeric_limits<std::size_t>::max());
    2338             :     std::vector<std::string> single_split =
    2339        3339 :         MooseUtils::rsplit(rnames[i], "\'", std::numeric_limits<std::size_t>::max());
    2340        3339 :     if (double_split.size() + single_split.size() >= 3)
    2341             :       // Either entering or exiting a vector parameter (>3 is entering another vector)
    2342             :       // Even and >2 number of quotes means both finished and started another vector parameter
    2343        1607 :       if ((double_split.size() + single_split.size()) % 2 == 1)
    2344         234 :         vector_param_detected = !vector_param_detected;
    2345             : 
    2346             :     // We're building a vector parameters, just append the text, rebuild the spaces
    2347        3339 :     if (vector_param_detected)
    2348         390 :       param->set()[i_param] += rnames[i] + ' ';
    2349             :     else
    2350             :     {
    2351        2949 :       param->set()[i_param] += rnames[i];
    2352        2949 :       i_param++;
    2353             :     }
    2354        3339 :   }
    2355             :   // Use actual size after re-forming vector parameters
    2356        1873 :   param->set().resize(i_param);
    2357        1877 : }
    2358             : 
    2359             : template <>
    2360             : void
    2361         115 : Builder::setDoubleIndexParameter<Point>(
    2362             :     const std::string & full_name,
    2363             :     const std::string & short_name,
    2364             :     InputParameters::Parameter<std::vector<std::vector<Point>>> * param,
    2365             :     bool in_global,
    2366             :     GlobalParamsAction * global_block)
    2367             : {
    2368         115 :   setVectorVectorComponentParameter(full_name, short_name, param, in_global, global_block);
    2369         115 : }
    2370             : 
    2371             : } // end of namespace Moose

Generated by: LCOV version 1.14