www.mooseframework.org
Output.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 // MOOSE includes
13 #include "MooseObject.h"
14 #include "Restartable.h"
15 #include "MeshChangedInterface.h"
16 #include "SetupInterface.h"
17 #include "AdvancedOutputUtils.h"
18 #include "PerfGraphInterface.h"
19 
20 // Forward declarations
21 class Output;
22 class MooseMesh;
23 
24 // libMesh forward declarations
25 namespace libMesh
26 {
27 class EquationSystems;
28 }
29 
30 template <>
32 
41 class Output : public MooseObject,
42  public Restartable,
43  public MeshChangedInterface,
44  public SetupInterface,
45  public PerfGraphInterface
46 {
47 public:
57 
65  virtual Real time();
66 
73  virtual Real timeOld();
74 
78  virtual Real dt();
79 
83  virtual Real dtOld();
84 
88  virtual int timeStep();
89 
93  const unsigned int & interval() const;
94 
98  const MultiMooseEnum & executeOn() const;
99 
103  bool isAdvanced();
104 
110  virtual const OutputOnWarehouse & advancedExecuteOn() const;
111 
116 
121  void allowOutput(bool state) { _allow_output = state; }
122 
126  static void addDeprecatedInputParameters(InputParameters & params);
127 
134  virtual void outputStep(const ExecFlagType & type);
135 
136 protected:
140  virtual void output(const ExecFlagType & type) = 0;
141 
146  virtual void solveSetup();
147 
152  virtual bool shouldOutput(const ExecFlagType & type);
153 
158  virtual bool onInterval();
159 
164  virtual void initialSetup();
165 
168 
171 
174 
176  EquationSystems * _es_ptr;
177 
180 
182  bool _sequence;
183 
186 
188  Real & _time;
189 
191  Real & _time_old;
192 
194  int & _t_step;
195 
197  Real & _dt;
198 
200  Real & _dt_old;
201 
203  unsigned int _num;
204 
206  const unsigned int _interval;
207 
209  std::set<Real> _sync_times;
210 
213 
215  Real _end_time;
216 
219 
222 
224  Real _t_tol;
225 
228 
231 
234 
237 
239  // This is here rather than in AdvancedOutput to allow generic
240  // access to this data from the Console object for displaying
241  // the output settings.
243 
246 
247  friend class OutputWarehouse;
248 };
249 
bool _sequence
Flag for forcing call to outputSetup() with every call to output() (restartable)
Definition: Output.h:182
Real & _time_old
The old time.
Definition: Output.h:191
const MultiMooseEnum & executeOn() const
Get the current &#39;execute_on&#39; selections for display.
Definition: Output.C:265
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:24
virtual Real dtOld()
Get old time step size.
Definition: Output.C:250
A class for creating restricted objects.
Definition: Restartable.h:29
ExecFlagEnum _execute_on
The common Execution types; this is used as the default execution type for everything except system i...
Definition: Output.h:185
OutputOnWarehouse _advanced_execute_on
Storage for the individual component execute flags.
Definition: Output.h:242
virtual bool onInterval()
Returns true if the output interval is satisfied.
Definition: Output.C:199
virtual void initialSetup()
Initialization method.
Definition: Output.C:154
virtual Real dt()
Get the current time step size.
Definition: Output.C:241
Real & _dt_old
Old time step delta.
Definition: Output.h:200
virtual void output(const ExecFlagType &type)=0
Overload this function with the desired output activities.
virtual bool shouldOutput(const ExecFlagType &type)
Handles logic for determining if a step should be output.
Definition: Output.C:188
const unsigned int & interval() const
Get the output interval.
Real _start_time
Start outputting time.
Definition: Output.h:212
static ExecFlagEnum getDefaultExecFlagEnum()
Return an ExecFlagEnum object with the available execution flags for Output objects.
Definition: Output.C:77
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
unsigned int _num
The number of outputs written.
Definition: Output.h:203
int & _t_step
The current time step.
Definition: Output.h:194
bool _transient
Transient flag (true = transient)
Definition: Output.h:170
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
static void addDeprecatedInputParameters(InputParameters &params)
A static helper for injecting deprecated parameters.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
unsigned int PerfID
Definition: MooseTypes.h:163
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:160
Output(const InputParameters &parameters)
Class constructor.
Definition: Output.C:84
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:53
Based class for output objects.
Definition: Output.h:41
int _start_step
Start outputting at this time step.
Definition: Output.h:218
bool _initialized
True if init() has been called.
Definition: Output.h:230
const unsigned int _interval
The output time step interval.
Definition: Output.h:206
virtual Real timeOld()
Get the old output time.
Definition: Output.C:232
Interface for notifications that the mesh has changed.
EquationSystems * _es_ptr
Reference the the libMesh::EquationSystems object that contains the data.
Definition: Output.h:176
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
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:165
int _end_step
End outputting at this time step.
Definition: Output.h:221
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Definition: Output.h:167
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
bool _allow_output
Flag for disabling output.
Definition: Output.h:233
A helper warehouse class for storing the "execute_on" settings for the various output types...
void allowOutput(bool state)
Method for controlling the allow output state.
Definition: Output.h:121
bool _sync_only
Flag for only executing at sync times.
Definition: Output.h:227
InputParameters validParams< Output >()
Definition: Output.C:29
PerfID _output_step_timer
Timers.
Definition: Output.h:245
Class for storing and utilizing output objects.
Interface for objects that needs transient capabilities.
bool _use_displaced
Flag for using displaced mesh.
Definition: Output.h:173
virtual Real time()
Get the output time.
Definition: Output.C:223
bool _is_advanced
Flag for advanced output testing.
Definition: Output.h:236
std::set< Real > _sync_times
Sync times for this outputter.
Definition: Output.h:209
bool isAdvanced()
Returns true if this object is an AdvancedOutput object.
Definition: Output.C:271
Real _t_tol
Time checking tolerance.
Definition: Output.h:224
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
Real _end_time
End outputting time.
Definition: Output.h:215
MooseMesh * _mesh_ptr
A convenience pointer to the current mesh (reference or displaced depending on "use_displaced") ...
Definition: Output.h:179
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
virtual const OutputOnWarehouse & advancedExecuteOn() const
Returns the advanced &#39;execute_on&#39; settings.
Definition: Output.C:277
virtual int timeStep()
Get the current time step.
Definition: Output.C:259
Real & _time
The current time for output purposes.
Definition: Output.h:188
Real & _dt
Time step delta.
Definition: Output.h:197