29 #include "libmesh/equation_systems.h" 40 "use_displaced",
false,
"Enable/disable the use of the displaced mesh for outputting");
46 "time_step_interval > 0",
47 "The interval (number of time steps) at which output occurs. " 48 "Unless explicitly set, the default value of this parameter is set " 49 "to infinity if the wall_time_interval is explicitly set.");
52 "The interval (number of time steps) at which output occurs",
53 "Deprecated, use time_step_interval");
54 params.
deprecateParam(
"interval",
"time_step_interval",
"02/01/2025");
56 "min_simulation_time_interval", 0.0,
"The minimum simulation time between output steps");
58 "The minimum simulation time between output steps",
59 "Deprecated, use min_simulation_time_interval");
60 params.
deprecateParam(
"minimum_time_interval",
"min_simulation_time_interval",
"02/01/2025");
63 "The target simulation time interval (in seconds) at which to output");
66 "The target wall time interval (in seconds) at which to output");
68 "sync_times", {},
"Times at which the output and solution is forced to occur");
71 "Times object providing the times at which the output and solution is forced to occur");
72 params.
addParam<
bool>(
"sync_only",
false,
"Only export results at sync times");
73 params.
addParam<
Real>(
"start_time",
"Time at which this output object begins to operate");
74 params.
addParam<
Real>(
"end_time",
"Time at which this output object stop operating");
75 params.
addParam<
int>(
"start_step",
"Time step at which this output object begins to operate");
76 params.
addParam<
int>(
"end_step",
"Time step at which this output object stop operating");
78 "time_tolerance", 1e-14,
"Time tolerance utilized checking start and end times");
80 "output_limiting_function",
81 "Piecewise base function that sets sync_times",
82 "Replaced by using the Times system with the sync_times_objects parameter");
97 "sync_only start_time end_time " 98 "start_step end_step min_simulation_time_interval " 99 "simulation_time_interval wall_time_interval",
100 "Timing and frequency of output");
131 _transient(_problem_ptr->isTransient()),
132 _use_displaced(getParam<bool>(
"use_displaced")),
137 _time(_problem_ptr->time()),
138 _time_old(_problem_ptr->timeOld()),
139 _t_step(_problem_ptr->timeStep()),
140 _dt(_problem_ptr->dt()),
141 _dt_old(_problem_ptr->dtOld()),
143 _time_step_interval_set_by_addparam(parameters.isParamSetByAddParam(
"time_step_interval")),
148 (parameters.isParamSetByUser(
"wall_time_interval") && _time_step_interval_set_by_addparam)
149 ?
std::numeric_limits<unsigned
int>::
max()
150 : getParam<unsigned
int>(
"time_step_interval")),
151 _min_simulation_time_interval(getParam<
Real>(
"min_simulation_time_interval")),
152 _simulation_time_interval(getParam<
Real>(
"simulation_time_interval")),
153 _wall_time_interval(getParam<
Real>(
"wall_time_interval")),
154 _sync_times(
std::set<
Real>(getParam<
std::vector<
Real>>(
"sync_times").begin(),
155 getParam<
std::vector<
Real>>(
"sync_times").end())),
156 _sync_times_object(isParamValid(
"sync_times_object")
157 ? static_cast<
Times *>(&_problem_ptr->getUserObject<
Times>(
158 getParam<TimesName>(
"sync_times_object")))
160 _start_time(isParamValid(
"start_time") ? getParam<
Real>(
"start_time")
161 :
std::numeric_limits<
Real>::lowest()),
162 _end_time(isParamValid(
"end_time") ? getParam<
Real>(
"end_time")
164 _start_step(isParamValid(
"start_step") ? getParam<
int>(
"start_step")
165 :
std::numeric_limits<
int>::lowest()),
166 _end_step(isParamValid(
"end_step") ? getParam<
int>(
"end_step")
168 _t_tol(getParam<
Real>(
"time_tolerance")),
169 _sync_only(getParam<bool>(
"sync_only")),
172 _advanced_execute_on(_execute_on, parameters),
173 _last_output_simulation_time(declareRestartableData<
Real>(
"last_output_simulation_time",
174 std::numeric_limits<
Real>::lowest())),
175 _last_output_wall_time(
std::chrono::steady_clock::now())
189 ": Parameter 'use_displaced' ignored, there is no displaced problem in your simulation.");
203 const ExecFlagEnum & add = getParam<ExecFlagEnum>(
"additional_execute_on");
204 for (
auto & me : add)
212 if (pwb_olf ==
nullptr)
213 mooseError(
"Function muse have a piecewise base!");
224 "Only one method of specifying sync times is supported at a time");
255 if (!(on_interval_or_exec_final || signal_received))
270 TIME_SECTION(
"outputStep", 2,
"Outputting Step");
305 mooseError(
"The provided sync times object has changing time values. Only static time " 306 "values are supported since time steppers take sync times from the output " 307 "warehouse which determines its sync times at output construction time.");
320 const auto now = std::chrono::steady_clock::now();
407 mooseError(
"The output object ",
name(),
" is not an AdvancedOutput, use isAdvanced() to check.");
Real & _time_old
The old time.
const MultiMooseEnum & executeOn() const
Get the current 'execute_on' selections for display.
const ExecFlagType EXEC_FAILED
Function base which provides a piecewise approximation to a specified (x,y) point data set...
Base class for function objects.
A MultiMooseEnum object to hold "execute_on" flags.
virtual Real dtOld()
Get old time step size.
A class for creating restricted objects.
ExecFlagEnum _execute_on
The common Execution types; this is used as the default execution type for everything except system i...
const ExecFlagType EXEC_FORCED
OutputOnWarehouse _advanced_execute_on
Storage for the individual component execute flags.
virtual bool onInterval()
Returns true if the output interval is satisfied.
virtual Real dt()
Get the current time step size.
Real & _dt_old
Old time step delta.
const Function & getFunction(const std::string &name) const
Get a function with a given name.
const ExecFlagType EXEC_NONE
Real _start_time
Start outputting time.
static ExecFlagEnum getDefaultExecFlagEnum()
Return an ExecFlagEnum object with the available execution flags for Output objects.
Times objects are under the hood Reporters, but limited to a vector of Real.
const Parallel::Communicator & comm() const
const std::set< Real > getUniqueTimes() const
Getter for a set of the full times.
bool isParamValid(const std::string &name) const
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
Add additional execute_on flags to the list of possible flags.
int & _t_step
The current time step.
bool _transient
Transient flag (true = transient)
const Parallel::Communicator & _communicator
virtual Real domain(const int i) const
const ExecFlagType EXEC_TIMESTEP_END
Real _wall_time_since_last_output
time in seconds since last output
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual const std::string & name() const
Get the name of the class.
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
auto max(const L &left, const R &right)
virtual void solveSetup()
A method called just prior to the solve, this is used by PetscOutput to perform the necessary setup a...
Output(const InputParameters ¶meters)
Class constructor.
ExecFlagEnum getDefaultExecFlagEnum()
Return the default ExecFlagEnum for MOOSE.
virtual EquationSystems & es() override
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
virtual bool shouldOutput()
Handles logic for determining if a step should be output.
int _start_step
Start outputting at this time step.
Real & _last_output_simulation_time
last simulation time an output has occured
bool contains(const std::string &value) const
Contains methods for seeing if a value is in the MultiMooseEnum.
virtual Real timeOld()
Get the old output time.
Interface for notifications that the mesh has changed.
EquationSystems * _es_ptr
Reference the the libMesh::EquationSystems object that contains the data.
Every object that can be built by the factory should be derived from this class.
const bool _time_step_interval_set_by_addparam
Whether time step interval is set by AddParam.
ExecFlagType _current_execute_flag
Current execute on flag.
virtual void outputStep(const ExecFlagType &type)
A single call to this function should output all the necessary data for a single timestep.
virtual Real functionSize() const
Interface to allow object to consume Reporter values.
int _end_step
End outputting at this time step.
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
bool _allow_output
Flag for disabling output.
virtual void output()=0
Overload this function with the desired output activities.
const std::string & type() const
Get the type of this class.
A helper warehouse class for storing the "execute_on" settings for the various output types...
std::string getDocString() const
Generate a documentation string for the "execute_on" parameter.
const Times *const _sync_times_object
Sync times object for this outputter.
bool _sync_only
Flag for only executing at sync times.
MooseApp & _app
The MOOSE application this is associated with.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Real _wall_time_interval
Target wall time between outputs in seconds.
static InputParameters validParams()
Interface for objects interacting with the PerfGraph.
unsigned int _time_step_interval
The output time step interval.
bool _use_displaced
Flag for using displaced mesh.
virtual Real time()
Get the output time.
bool _is_advanced
Flag for advanced output testing.
std::set< Real > _sync_times
Sync times for this outputter.
void setWallTimeIntervalFromCommandLineParam()
Function to set the wall time interval based on value of command line parameter (used for testing onl...
bool isAdvanced()
Returns true if this object is an AdvancedOutput object.
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
bool isParamSetByUser(const std::string &nm) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
std::chrono::time_point< std::chrono::steady_clock > _last_output_wall_time
last wall time an output has occured
Real _t_tol
Time checking tolerance.
Class for containing MooseEnum item information.
void max(const T &r, T &o, Request &req) const
void push_back(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
virtual MooseMesh & mesh() override
MooseMesh * _mesh_ptr
A convenience pointer to the current mesh (reference or displaced depending on "use_displaced") ...
int interrupt_signal_number
Used by the signal handler to determine if we should write a checkpoint file out at any point during ...
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
static InputParameters validParams()
virtual const OutputOnWarehouse & advancedExecuteOn() const
Returns the advanced 'execute_on' settings.
virtual int timeStep()
Get the current time step.
bool isRecovering() const
Whether or not this is a "recover" calculation.
const ExecFlagType EXEC_FINAL
static InputParameters validParams()
Interface for objects that need to use functions.
Real & _time
The current time for output purposes.
void ErrorVector unsigned int
Real & _dt
Time step delta.
const Real _min_simulation_time_interval
Minimum simulation time between outputs.
Interface class for classes which interact with Postprocessors.
const ExecFlagType EXEC_INITIAL