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.");
50 params.
addParam<
unsigned int>(
"interval",
51 "The interval (number of time steps) at which output occurs");
52 params.
deprecateParam(
"interval",
"time_step_interval",
"02/01/2025");
54 "min_simulation_time_interval", 0.0,
"The minimum simulation time between output steps");
56 "The minimum simulation time between output steps");
57 params.
deprecateParam(
"minimum_time_interval",
"min_simulation_time_interval",
"02/01/2025");
60 "The target simulation time interval (in seconds) at which to output");
64 "wall_time_interval > 0",
65 "The target wall time interval (in seconds) at which to output");
67 "sync_times", {},
"Times at which the output and solution is forced to occur");
70 "Times object providing the times at which the output and solution is forced to occur");
71 params.
addParam<
bool>(
"sync_only",
false,
"Only export results at sync times");
72 params.
addParam<
Real>(
"start_time",
"Time at which this output object begins to operate");
73 params.
addParam<
Real>(
"end_time",
"Time at which this output object stop operating");
74 params.
addParam<
int>(
"start_step",
"Time step at which this output object begins to operate");
75 params.
addParam<
int>(
"end_step",
"Time step at which this output object stop operating");
77 "time_tolerance", 1e-14,
"Time tolerance utilized checking start and end times");
79 "output_limiting_function",
80 "Piecewise base function that sets sync_times",
81 "Replaced by using the Times system with the sync_times_objects parameter");
96 "sync_only start_time end_time " 97 "start_step end_step min_simulation_time_interval " 98 "simulation_time_interval wall_time_interval",
99 "Timing and frequency of output");
130 _transient(_problem_ptr->isTransient()),
131 _use_displaced(getParam<bool>(
"use_displaced")),
136 _time(_problem_ptr->time()),
137 _time_old(_problem_ptr->timeOld()),
138 _t_step(_problem_ptr->timeStep()),
139 _dt(_problem_ptr->dt()),
140 _dt_old(_problem_ptr->dtOld()),
142 _time_step_interval_set_by_addparam(parameters.isParamSetByAddParam(
"time_step_interval")),
147 (parameters.isParamSetByUser(
"wall_time_interval") && _time_step_interval_set_by_addparam)
148 ?
std::numeric_limits<unsigned
int>::
max()
149 : getParam<unsigned
int>(
"time_step_interval")),
150 _min_simulation_time_interval(getParam<
Real>(
"min_simulation_time_interval")),
151 _simulation_time_interval(getParam<
Real>(
"simulation_time_interval")),
152 _wall_time_interval(getParam<
Real>(
"wall_time_interval")),
153 _sync_times(
std::set<
Real>(getParam<
std::vector<
Real>>(
"sync_times").begin(),
154 getParam<
std::vector<
Real>>(
"sync_times").end())),
155 _sync_times_object(isParamValid(
"sync_times_object")
156 ? static_cast<
Times *>(&_problem_ptr->getUserObject<
Times>(
157 getParam<TimesName>(
"sync_times_object")))
159 _start_time(isParamValid(
"start_time") ? getParam<
Real>(
"start_time")
160 :
std::numeric_limits<
Real>::lowest()),
161 _end_time(isParamValid(
"end_time") ? getParam<
Real>(
"end_time")
163 _start_step(isParamValid(
"start_step") ? getParam<
int>(
"start_step")
164 :
std::numeric_limits<
int>::lowest()),
165 _end_step(isParamValid(
"end_step") ? getParam<
int>(
"end_step")
167 _t_tol(getParam<
Real>(
"time_tolerance")),
168 _sync_only(getParam<bool>(
"sync_only")),
171 _advanced_execute_on(_execute_on, parameters),
172 _last_output_simulation_time(declareRestartableData<
Real>(
"last_output_simulation_time",
173 std::numeric_limits<
Real>::lowest())),
174 _last_output_wall_time(
std::chrono::steady_clock::now())
188 ": Parameter 'use_displaced' ignored, there is no displaced problem in your simulation.");
202 const ExecFlagEnum & add = getParam<ExecFlagEnum>(
"additional_execute_on");
203 for (
auto & me : add)
211 if (pwb_olf ==
nullptr)
212 mooseError(
"Function muse have a piecewise base!");
223 "Only one method of specifying sync times is supported at a time");
254 if (!(on_interval_or_exec_final || signal_received))
269 TIME_SECTION(
"outputStep", 2,
"Outputting Step");
304 mooseError(
"The provided sync times object has changing time values. Only static time " 305 "values are supported since time steppers take sync times from the output " 306 "warehouse which determines its sync times at output construction time.");
322 const auto now = std::chrono::steady_clock::now();
409 mooseError(
"The output object ",
name(),
" is not an AdvancedOutput, use isAdvanced() to check.");
Real & _time_old
The old time.
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
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.
void setAdditionalValue(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
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.
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
virtual Real timeOld()
Get the old output time.
Interface for notifications that the mesh has changed.
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.
virtual libMesh::EquationSystems & es() override
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.
bool isValueSet(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
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
libMesh::EquationSystems * _es_ptr
Reference the the libMesh::EquationSystems object that contains the data.
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...
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