Parses MOOSE input using HIT/WASP. More...
#include <Builder.h>
Public Types | |
enum | SyntaxFormatterType { INPUT_FILE, YAML } |
Public Member Functions | |
Builder (MooseApp &app, ActionWarehouse &action_wh, Parser &parser) | |
virtual | ~Builder () |
std::string | getPrimaryFileName (bool stripLeadingPath=true) const |
Return the primary (first) filename that was parsed. More... | |
void | build () |
Parse an input file (or text string if provided) consisting of hit syntax and setup objects in the MOOSE derived application. More... | |
void | extractParams (const hit::Node *const section_node, InputParameters &p) |
Attempt to extract values from input starting with the section in input in section_node based on the contents of the passed InputParameters p . More... | |
void | extractParams (const std::string &prefix, InputParameters &p) |
Attempt to extract values from input starting with the section in input defined by the fullpath prefix based on the contents of the passed InputParameters p . More... | |
void | initSyntaxFormatter (SyntaxFormatterType type, bool dump_mode) |
Creates a syntax formatter for printing. More... | |
void | buildFullTree (const std::string &search_string) |
Use MOOSE Factories to construct a full parse tree for documentation or echoing input. More... | |
void | buildJsonSyntaxTree (JsonSyntaxTree &tree) const |
Use MOOSE Factories to construct a parameter tree for documentation or echoing input. More... | |
void | walk (const std::string &fullpath, const std::string &nodepath, hit::Node *n) |
void | errorCheck (const libMesh::Parallel::Communicator &comm, bool warn_unused, bool err_unused) |
std::vector< std::string > | listValidParams (std::string §ion_name) |
Static Public Member Functions | |
static InputParameters | validParams () |
Parameters that are processed directly by the Parser and are valid anywhere in the input. More... | |
Public Attributes | |
const ConsoleStream | _console |
An instance of helper class to write streams to the Console objects. More... | |
Private Member Functions | |
bool | isGlobal (const hit::Node &node) const |
const hit::Node * | queryGlobalParamsNode () const |
Get the [GlobalParams] section node if it exists. More... | |
void | walkRaw (std::string fullpath, std::string nodepath, hit::Node *n) |
Private Attributes | |
MooseApp & | _app |
The MooseApp this Parser is part of. More... | |
Factory & | _factory |
The Factory associated with that MooseApp. More... | |
ActionWarehouse & | _action_wh |
Action warehouse that will be filled by actions. More... | |
ActionFactory & | _action_factory |
The Factory that builds actions. More... | |
Syntax & | _syntax |
Reference to an object that defines input file syntax. More... | |
Parser & | _parser |
The front parser. More... | |
hit::Node & | _root |
The root node from the Parser. More... | |
std::unique_ptr< SyntaxTree > | _syntax_formatter |
Object for holding the syntax parse tree. More... | |
std::set< std::string > | _extracted_vars |
The set of all variables extracted from the input file. More... | |
std::vector< std::string > | _secs_need_first |
The sections that we need to execute first (read during the final walk) More... | |
std::vector< hit::ErrorMessage > | _errors |
The errors accumulated during the walk. More... | |
std::map< std::string, std::string > | _deprecated_params |
Deprecation warnings (object type/param name) -> (message) More... | |
std::optional< const hit::Node * > | _global_params_node |
The hit Node for the [GlobalParams] block, if any If set (could be null), it means we have searched for it. More... | |
Enumerator | |
---|---|
INPUT_FILE | |
YAML |
Definition at line 59 of file Builder.h.
Moose::Builder::Builder | ( | MooseApp & | app, |
ActionWarehouse & | action_wh, | ||
Parser & | parser | ||
) |
Definition at line 105 of file Builder.C.
void Moose::Builder::build | ( | ) |
Parse an input file (or text string if provided) consisting of hit syntax and setup objects in the MOOSE derived application.
Definition at line 300 of file Builder.C.
Referenced by MooseApp::setupOptions().
void Moose::Builder::buildFullTree | ( | const std::string & | search_string | ) |
Use MOOSE Factories to construct a full parse tree for documentation or echoing input.
If the task is nullptr that means we need to figure out which task goes with this syntax for the purpose of building the Moose Object part of the tree. We will figure this out by asking the ActionFactory for the registration info.
We need to see if this action is inherited from MooseObjectAction. If it is, then we will loop over all the Objects in MOOSE's Factory object to print them out if they have associated bases matching the current task.
Now that we know that this is a MooseObjectAction we need to see if it has been restricted in any way by the user.
Definition at line 579 of file Builder.C.
Referenced by MooseApp::setupOptions().
void Moose::Builder::buildJsonSyntaxTree | ( | JsonSyntaxTree & | tree | ) | const |
Use MOOSE Factories to construct a parameter tree for documentation or echoing input.
If the task is nullptr that means we need to figure out which task goes with this syntax for the purpose of building the Moose Object part of the tree. We will figure this out by asking the ActionFactory for the registration info.
We need to see if this action is inherited from MooseObjectAction. If it is, then we will loop over all the Objects in MOOSE's Factory object to print them out if they have associated bases matching the current task.
Definition at line 419 of file Builder.C.
Referenced by MooseApp::setupOptions().
void Moose::Builder::errorCheck | ( | const libMesh::Parallel::Communicator & | comm, |
bool | warn_unused, | ||
bool | err_unused | ||
) |
Definition at line 361 of file Builder.C.
Referenced by MeshOnlyAction::act(), and MooseApp::errorCheck().
void Moose::Builder::extractParams | ( | const hit::Node *const | section_node, |
InputParameters & | p | ||
) |
Attempt to extract values from input starting with the section in input in section_node
based on the contents of the passed InputParameters p
.
If section_node
is not provided, only the global parameters will be checked
Definition at line 666 of file Builder.C.
Referenced by CreateProblemDefaultAction::act(), SetupMeshAction::act(), extractParams(), and walkRaw().
void Moose::Builder::extractParams | ( | const std::string & | prefix, |
InputParameters & | p | ||
) |
Attempt to extract values from input starting with the section in input defined by the fullpath prefix
based on the contents of the passed InputParameters p
.
Definition at line 819 of file Builder.C.
std::string Moose::Builder::getPrimaryFileName | ( | bool | stripLeadingPath = true | ) | const |
Return the primary (first) filename that was parsed.
Definition at line 179 of file Builder.C.
Referenced by MeshOnlyAction::act(), extractParams(), and MooseApp::getFileName().
void Moose::Builder::initSyntaxFormatter | ( | SyntaxFormatterType | type, |
bool | dump_mode | ||
) |
Creates a syntax formatter for printing.
Definition at line 402 of file Builder.C.
Referenced by MooseApp::setupOptions().
|
private |
node
exists within the [GlobalParams] block Definition at line 826 of file Builder.C.
Referenced by extractParams().
std::vector< std::string > Moose::Builder::listValidParams | ( | std::string & | section_name | ) |
Definition at line 142 of file Builder.C.
Referenced by Moose::UnusedWalker::walk().
|
private |
Get the [GlobalParams] section node if it exists.
We need to separate this so that we can call extractParams() before calling build()
Definition at line 833 of file Builder.C.
Referenced by extractParams(), and isGlobal().
|
static |
Parameters that are processed directly by the Parser and are valid anywhere in the input.
Add the "active" and "inactive" parameters so that all blocks in the input file can selectively create lists of active/inactive sub-blocks.
Definition at line 121 of file Builder.C.
Referenced by JsonSyntaxTree::addGlobal(), MooseServer::getAllValidParameters(), and Action::validParams().
void Moose::Builder::walk | ( | const std::string & | fullpath, |
const std::string & | nodepath, | ||
hit::Node * | n | ||
) |
Definition at line 289 of file Builder.C.
|
private |
Definition at line 186 of file Builder.C.
Referenced by build(), and walk().
|
private |
The Factory that builds actions.
Definition at line 139 of file Builder.h.
Referenced by buildFullTree(), buildJsonSyntaxTree(), listValidParams(), and walkRaw().
|
private |
|
private |
The MooseApp this Parser is part of.
Definition at line 133 of file Builder.h.
Referenced by errorCheck().
|
inherited |
An instance of helper class to write streams to the Console objects.
Definition at line 31 of file ConsoleStreamInterface.h.
Referenced by IterationAdaptiveDT::acceptStep(), MeshOnlyAction::act(), SetupDebugAction::act(), MaterialOutputAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), PerfGraph::addToExecutionList(), SimplePredictor::apply(), SystemBase::applyScalingFactors(), MultiApp::backup(), FEProblemBase::backupMultiApps(), CoarsenedPiecewiseLinear::buildCoarsenedGrid(), DefaultSteadyStateConvergence::checkConvergence(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), MeshDiagnosticsGenerator::checkElementVolumes(), FEProblemBase::checkExceptionAndStopSolve(), SolverSystem::checkInvalidSolution(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonMatchingEdges(), MeshDiagnosticsGenerator::checkNonPlanarSides(), FEProblemBase::checkProblemIntegrity(), ReferenceResidualConvergence::checkRelativeConvergence(), MeshDiagnosticsGenerator::checkSidesetsOrientation(), MeshDiagnosticsGenerator::checkWatertightNodesets(), MeshDiagnosticsGenerator::checkWatertightSidesets(), IterationAdaptiveDT::computeAdaptiveDT(), TransientBase::computeConstrainedDT(), DefaultMultiAppFixedPointConvergence::computeCustomConvergencePostprocessor(), NonlinearSystemBase::computeDamping(), FixedPointIterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInitialDT(), IterationAdaptiveDT::computeInterpolationDT(), LinearSystem::computeLinearSystemTags(), FEProblemBase::computeLinearSystemTags(), NonlinearSystemBase::computeScaling(), Problem::console(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), MultiApp::createApp(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MFEMSteady::execute(), MessageFromInput::execute(), SteadyBase::execute(), Eigenvalue::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MeshGeneratorSystem::executeMeshGenerators(), ElementQualityChecker::finalize(), SidesetAroundSubdomainUpdater::finalize(), FEProblemBase::finishMultiAppStep(), MeshRepairGenerator::fixOverlappingNodes(), CoarsenBlockGenerator::generate(), MeshGenerator::generateInternal(), VariableCondensationPreconditioner::getDofToCondense(), InversePowerMethod::init(), NonlinearEigen::init(), FEProblemBase::initialAdaptMesh(), DefaultMultiAppFixedPointConvergence::initialize(), EigenExecutionerBase::inversePowerIteration(), FEProblemBase::joinAndFinalize(), TransientBase::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), FEProblemBase::logAdd(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseBase::mooseDeprecated(), MooseBase::mooseInfo(), MooseBase::mooseWarning(), MooseBase::mooseWarningNonPrefixed(), ReferenceResidualConvergence::nonlinearConvergenceSetup(), ReporterDebugOutput::output(), PerfGraphOutput::output(), SolutionInvalidityOutput::output(), MaterialPropertyDebugOutput::output(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), PseudoTimestep::outputPseudoTimestep(), Console::outputReporters(), DefaultMultiAppFixedPointConvergence::outputResidualNorm(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), AB2PredictorCorrector::postSolve(), ActionWarehouse::printActionDependencySets(), BlockRestrictionDebugOutput::printBlockRestrictionMap(), SolutionInvalidity::printDebug(), EigenExecutionerBase::printEigenvalue(), SecantSolve::printFixedPointConvergenceHistory(), SteffensenSolve::printFixedPointConvergenceHistory(), PicardSolve::printFixedPointConvergenceHistory(), FixedPointSolve::printFixedPointConvergenceReason(), PerfGraphLivePrint::printLiveMessage(), MaterialPropertyDebugOutput::printMaterialMap(), PerfGraphLivePrint::printStats(), NEML2Action::printSummary(), AutomaticMortarGeneration::projectPrimaryNodesSinglePair(), AutomaticMortarGeneration::projectSecondaryNodesSinglePair(), CoarsenBlockGenerator::recursiveCoarsen(), SolutionTimeAdaptiveDT::rejectStep(), MultiApp::restore(), FEProblemBase::restoreMultiApps(), FEProblemBase::restoreSolutions(), NonlinearSystemBase::setInitialSolution(), MooseApp::setupOptions(), Checkpoint::shouldOutput(), SubProblem::showFunctorRequestors(), SubProblem::showFunctors(), FullSolveMultiApp::showStatusMessage(), EigenProblem::solve(), FEProblemSolve::solve(), NonlinearSystem::solve(), FixedPointSolve::solve(), LinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), LStableDirk4::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), FixedPointSolve::solveStep(), PerfGraphLivePrint::start(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), MFEMTransient::takeStep(), TransientBase::takeStep(), TerminateChainControl::terminate(), Convergence::verboseOutput(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().
|
private |
Deprecation warnings (object type/param name) -> (message)
Definition at line 160 of file Builder.h.
Referenced by build(), and extractParams().
|
private |
The errors accumulated during the walk.
Definition at line 157 of file Builder.h.
Referenced by build(), extractParams(), and walkRaw().
|
private |
The set of all variables extracted from the input file.
Definition at line 151 of file Builder.h.
Referenced by build(), errorCheck(), and extractParams().
|
private |
The Factory associated with that MooseApp.
Definition at line 135 of file Builder.h.
Referenced by buildFullTree(), and buildJsonSyntaxTree().
|
mutableprivate |
The hit Node for the [GlobalParams] block, if any If set (could be null), it means we have searched for it.
Definition at line 164 of file Builder.h.
Referenced by queryGlobalParamsNode().
|
private |
The front parser.
Definition at line 143 of file Builder.h.
Referenced by build(), errorCheck(), and getPrimaryFileName().
|
private |
The root node from the Parser.
Definition at line 145 of file Builder.h.
Referenced by build(), errorCheck(), extractParams(), and queryGlobalParamsNode().
|
private |
|
private |
Reference to an object that defines input file syntax.
Definition at line 141 of file Builder.h.
Referenced by build(), buildFullTree(), buildJsonSyntaxTree(), listValidParams(), queryGlobalParamsNode(), and walkRaw().
|
private |
Object for holding the syntax parse tree.
Definition at line 148 of file Builder.h.
Referenced by buildFullTree(), and initSyntaxFormatter().