https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Output.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include <chrono>
13
14// MOOSE includes
15#include "MooseObject.h"
16#include "Restartable.h"
18#include "SetupInterface.h"
21#include "ReporterInterface.h"
22#include "AdvancedOutputUtils.h"
23#include "PerfGraphInterface.h"
24#include "FunctionInterface.h"
25
26class MooseMesh;
27class Times;
28
29// libMesh forward declarations
30namespace libMesh
31{
32class EquationSystems;
33}
34
43class Output : public MooseObject,
44 public Restartable,
46 public SetupInterface,
47 public FunctionInterface,
50 public ReporterInterface,
52{
53public:
55
65
73 virtual Real time();
74
81 virtual Real timeOld();
82
86 virtual Real dt();
87
91 virtual Real dtOld();
92
96 virtual int timeStep();
97
101 const unsigned int & interval() const;
102
106 const MultiMooseEnum & executeOn() const;
107
111 bool isAdvanced();
112
118 virtual const OutputOnWarehouse & advancedExecuteOn() const;
119
124
129 void allowOutput(bool state) { _allow_output = state; }
130
135
142 virtual void outputStep(const ExecFlagType & type);
143
144 const std::set<Real> & getSyncTimes() { return _sync_times; }
145
150 virtual bool supportsMaterialPropertyOutput() const { return false; }
151
152protected:
156 virtual void output() = 0;
157
162 virtual void solveSetup();
163
168 virtual bool shouldOutput();
169
174 virtual bool onInterval();
175
183
186
189
192
195
198
201
204
212
214 Real & _time;
215
217 Real & _time_old;
218
220 int & _t_step;
221
223 Real & _dt;
224
226 Real & _dt_old;
227
229 unsigned int _num;
230
233
236
239
242
244 std::set<Real> _sync_times;
245
248
251
254
257
260
262 Real _t_tol;
263
266
269
272
274 // This is here rather than in AdvancedOutput to allow generic
275 // access to this data from the Console object for displaying
276 // the output settings.
278
281
283 std::chrono::time_point<std::chrono::steady_clock> _last_output_wall_time;
284
287
288 friend class OutputWarehouse;
289};
A MultiMooseEnum object to hold "execute_on" flags.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Interface for objects that need to use functions.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Interface for notifications that the mesh has changed.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & type() const
Get the type of this class.
Definition MooseBase.h:93
Class for containing MooseEnum item information.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
A helper warehouse class for storing the "execute_on" settings for the various output types.
Class for storing and utilizing output objects.
Based class for output objects.
Definition Output.h:52
virtual Real dtOld()
Get old time step size.
Definition Output.C:378
bool _sequence
Flag for forcing call to outputSetup() with every call to output() (restartable)
Definition Output.h:200
Real _wall_time_since_last_output
time in seconds since last output
Definition Output.h:286
bool _sync_only
Flag for only executing at sync times.
Definition Output.h:265
int _start_step
Start outputting at this time step.
Definition Output.h:256
bool _allow_output
Flag for disabling output.
Definition Output.h:268
Real _wall_time_interval
Target wall time between outputs in seconds.
Definition Output.h:241
Real & _dt_old
Old time step delta.
Definition Output.h:226
ExecFlagEnum _execute_on
The common Execution types; this is used as the default execution type for everything except system i...
Definition Output.h:203
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Definition Output.h:185
const Real _min_simulation_time_interval
Minimum simulation time between outputs.
Definition Output.h:238
const Times *const _sync_times_object
Sync times object for this outputter.
Definition Output.h:247
void setWallTimeIntervalFromCommandLineParam()
Function to set the wall time interval based on value of command line parameter (used for testing onl...
Definition Output.C:336
static InputParameters validParams()
Definition Output.C:32
virtual int timeStep()
Get the current time step.
Definition Output.C:387
virtual const OutputOnWarehouse & advancedExecuteOn() const
Returns the advanced 'execute_on' settings.
Definition Output.C:405
virtual bool shouldOutput()
Handles logic for determining if a step should be output.
Definition Output.C:272
bool _is_advanced
Flag for advanced output testing.
Definition Output.h:271
const bool _time_step_interval_set_by_addparam
Whether time step interval is set by AddParam.
Definition Output.h:232
Real & _time_old
The old time.
Definition Output.h:217
const MultiMooseEnum & executeOn() const
Get the current 'execute_on' selections for display.
Definition Output.C:393
bool isAdvanced()
Returns true if this object is an AdvancedOutput object.
Definition Output.C:399
int & _t_step
The current time step.
Definition Output.h:220
ExecFlagType _current_execute_flag
Current execute on flag.
Definition Output.h:211
virtual Real timeOld()
Get the old output time.
Definition Output.C:360
virtual bool onInterval()
Returns true if the output interval is satisfied.
Definition Output.C:280
virtual void outputStep(const ExecFlagType &type)
A single call to this function should output all the necessary data for a single timestep.
Definition Output.C:229
bool _transient
Transient flag (true = transient)
Definition Output.h:188
virtual void solveSetup()
A method called just prior to the solve, this is used by PetscOutput to perform the necessary setup a...
Definition Output.C:224
unsigned int _num
The number of outputs written.
Definition Output.h:229
libMesh::EquationSystems * _es_ptr
Reference the the libMesh::EquationSystems object that contains the data.
Definition Output.h:194
const std::set< Real > & getSyncTimes()
Definition Output.h:144
Real & _time
The current time for output purposes.
Definition Output.h:214
Real _start_time
Start outputting time.
Definition Output.h:250
Real _t_tol
Time checking tolerance.
Definition Output.h:262
bool _use_displaced
Flag for using displaced mesh.
Definition Output.h:191
void allowOutput(bool state)
Method for controlling the allow output state.
Definition Output.h:129
Real & _dt
Time step delta.
Definition Output.h:223
virtual bool supportsMaterialPropertyOutput() const
A virtual function that stores whether output type supports material output.
Definition Output.h:150
Real _end_time
End outputting time.
Definition Output.h:253
virtual Real dt()
Get the current time step size.
Definition Output.C:369
const unsigned int & interval() const
Get the output interval.
static void addDeprecatedInputParameters(InputParameters &params)
A static helper for injecting deprecated parameters.
Real & _last_output_simulation_time
last simulation time an output has occured
Definition Output.h:280
std::set< Real > _sync_times
Sync times for this outputter.
Definition Output.h:244
int _end_step
End outputting at this time step.
Definition Output.h:259
virtual Real time()
Get the output time.
Definition Output.C:351
virtual void output()=0
Overload this function with the desired output activities.
MooseMesh * _mesh_ptr
A convenience pointer to the current mesh (reference or displaced depending on "use_displaced")
Definition Output.h:197
unsigned int _time_step_interval
The output time step interval.
Definition Output.h:235
std::chrono::time_point< std::chrono::steady_clock > _last_output_wall_time
last wall time an output has occured
Definition Output.h:283
static ExecFlagEnum getDefaultExecFlagEnum()
Return an ExecFlagEnum object with the available execution flags for Output objects.
Definition Output.C:104
OutputOnWarehouse _advanced_execute_on
Storage for the individual component execute flags.
Definition Output.h:277
Interface for objects interacting with the PerfGraph.
Interface class for classes which interact with Postprocessors.
Interface to allow object to consume Reporter values.
A class for creating restricted objects.
Definition Restartable.h:29
Times objects are under the hood Reporters, but limited to a vector of Real.
Definition Times.h:19
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...