19 params.addClassDescription(
"Output a simulation time progress bar on the console.");
21 params.addParam<
bool>(
22 "use_filename",
true,
"Put the input filename into the title of the progress bar");
23 params.addParam<
unsigned int>(
25 "Explicitly specify the bar width. If omitted the MOOSE_PPS_WIDTH environment variable or, " 26 "if not set, the terminal width is queried.");
32 _transient_executioner(dynamic_cast<
TransientBase *>(_app.getExecutioner())),
33 _use_filename(getParam<bool>(
"use_filename")),
34 _length(isParamValid(
"progress_bar_width") ? getParam<unsigned
int>(
"progress_bar_width")
54 std::string title =
name();
57 if (title.length() >=
_length - 1)
58 title = title.substr(0,
_length - 4) +
"...";
61 Moose::out <<
"+-" << title << std::string(
_length - 1 - title.length(),
'-') <<
"+\n";
64 Moose::out <<
'|' << std::string(progress,
'#') << std::string(
_length - progress,
'.') <<
"|\n";
67 Moose::out <<
'+' << std::string(
_length,
'-') <<
"+\n";
registerMooseObjectAliased("MooseApp", ProgressOutput, "Progress")
std::string getFileName(bool stripLeadingPath=true) const
Return the primary (first) filename that was parsed Note: When stripLeadingPath is false...
A MultiMooseEnum object to hold "execute_on" flags.
const unsigned int _length
total length of the progress bar
void output() override
Overload this function with the desired output activities.
Real getStartTime() const
Return the start time.
const ExecFlagType EXEC_TIMESTEP_END
virtual const std::string & name() const
Get the name of the class.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Output a simulation time progress bar on the console.
const TransientBase *const _transient_executioner
Based class for output objects.
static InputParameters validParams()
ExecFlagType _current_execute_flag
Current execute on flag.
virtual Real getTime() const
Get the current time.
ProgressOutput(const InputParameters ¶meters)
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
Real getEndTime() const
Get the end time.
const bool _use_filename
display input file name in the progress bar title
static InputParameters validParams()
void ErrorVector unsigned int
unsigned short getTermWidth(bool use_environment)
Returns the width of the terminal using sys/ioctl.