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 +
Executioners are objects that do the actual work of solving your problem.
Interface class for classes which interact with Postprocessors.
The Executor class directs the execution flow of simulations.
virtual void execute() override final
Pure virtual execute function MUST be overridden by children classes.
Result _result
Stores the result representing the outcome from the run function.
Result & newResult()
Executors need to return a Result object describing how execution went - rather than constructing Res...
virtual bool lastSolveConverged() const override
Whether the executor and all its sub-executors passed / converged.
static InputParameters validParams()
ExecFlagType _end_flag
The execute-on flag to associate with the end of this executor's execution.
ExecFlagType _begin_flag
The execute-on flag to associate with the beginning of this executor's execution.
Result exec()
This is the main function for executors - this is how executors should invoke child/sub executors - b...
virtual Result run()=0
This function contains the primary execution implementation for a executor.
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & name() const
Get the name of the class.
Class for containing MooseEnum item information.
Every object that can be built by the factory should be derived from this class.
Class that hold the whole problem being solved.
This object tracks the success/failure state of the executor system as execution proceeds in a simula...
Result(const MooseObject *obj)
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.
bool record(const std::string &name, const Result &r)
Records results from sub/internal executors in a executor's result.
std::string reason
Optional message detailing why an executor passed or failed (i.e. failed to converge).
void fail(const std::string &msg)
Marks the result as failing/unconverged with the given msg text describing detail about how things ra...
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.
std::string label(bool success_msg, const std::string &subname="")
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...
bool convergedAll() const
Returns false if any single executor in the current hierarchy of results (i.e.
Result(const std::string &name)
bool converged
whether or not a executor ran its code successfully - only reports results from the executor itself.