56 std::map<std::string, Result>
subs;
63 str(
bool success_msg =
false,
const std::string &
indent =
"",
const std::string & subname =
"")
65 std::string s =
indent +
label(success_msg, subname) +
"\n";
66 for (
auto & entry :
subs)
67 s += entry.second.str(success_msg,
indent +
" ", entry.first);
75 void pass(
const std::string & msg,
bool overwrite =
false)
78 "cannot override nonconverged executioner result with a passing one");
86 void fail(
const std::string & msg)
112 for (
auto & entry :
subs)
113 if (!entry.second.convergedAll())
119 std::string
label(
bool success_msg,
const std::string & subname =
"")
121 std::string state_str =
122 success_msg || !
converged ? (std::string(
"(") + (
converged ?
"pass" :
"FAIL") +
")") :
"";
123 return subname + (subname.empty() ?
"" :
":") +
_name + state_str +
virtual void execute() override final
Pure virtual execute function MUST be overridden by children classes.
std::string indent(unsigned int spaces)
Create empty string for indenting.
std::string str(bool success_msg=false, const std::string &indent="", const std::string &subname="")
Prints a full recursive output of this result object - including all descendant's results...
Result exec()
This is the main function for executors - this is how executors should invoke child/sub executors - b...
std::string label(bool success_msg, const std::string &subname="")
Class that hold the whole problem being solved.
virtual bool lastSolveConverged() const override
Whether the executor and all its sub-executors passed / converged.
Result(const MooseObject *obj)
virtual const std::string & name() const
Get the name of the class.
void fail(const std::string &msg)
Marks the result as failing/unconverged with the given msg text describing detail about how things ra...
Result(const std::string &name)
void pass(const std::string &msg, bool overwrite=false)
Marks the result as passing/converged with the given msg text describing detail about how things ran...
bool record(const std::string &name, const Result &r)
Records results from sub/internal executors in a executor's result.
Result _result
Stores the result representing the outcome from the run function.
std::tuple< CheckState, std::string, std::string > Result
Result from a capability check: the state, the reason, and the documentation.
Result & newResult()
Executors need to return a Result object describing how execution went - rather than constructing Res...
Every object that can be built by the factory should be derived from this class.
bool converged
whether or not a executor ran its code successfully - only reports results from the executor itself...
ExecFlagType _begin_flag
The execute-on flag to associate with the beginning of this executor's execution. ...
Executioners are objects that do the actual work of solving your problem.
virtual Result run()=0
This function contains the primary execution implementation for a executor.
Executor(const InputParameters ¶meters)
Interface class for classes which interact with Postprocessors.
Class for containing MooseEnum item information.
static InputParameters validParams()
class infix_ostream_iterator if void
const InputParameters & parameters() const
Get the parameters of the object.
This object tracks the success/failure state of the executor system as execution proceeds in a simula...
std::map< std::string, Result > subs
Maps a name/label of a executor's internal/sub executors to the result object returned by running eac...
ExecFlagType _end_flag
The execute-on flag to associate with the end of this executor's execution.
bool convergedAll() const
Returns false if any single executor in the current hierarchy of results (i.e.
std::string reason
Optional message detailing why an executor passed or failed (i.e. failed to converge).
The Executor class directs the execution flow of simulations.