https://mooseframework.inl.gov
SimulationTimes.C
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 #include "SimulationTimes.h"
11 
13 
16 {
18  params.addClassDescription("Times simulated");
19 
20  // Times are known for all processes already
21  params.set<bool>("auto_broadcast") = false;
22  // Times history of a simulation is already one-way
23  params.set<bool>("auto_sort") = false;
24  // TIMESTEP_BEGIN is as early and as often as we need
25  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_BEGIN;
26 
27  return params;
28 }
29 
30 SimulationTimes::SimulationTimes(const InputParameters & parameters) : Times(parameters) {}
31 
32 void
34 {
35  // Initialize is by default what is called by execute()
36  _times.push_back(_fe_problem.time());
37  // if this is performed multiple times (fixed point iterations)
38  // it will be caught by our logic to make the vector hold unique times in finalize()
39 }
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:21
virtual Real & time() const
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Times objects are under the hood Reporters, but limited to a vector of Real.
Definition: Times.h:18
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
Definition: Times.C:14
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:35
static InputParameters validParams()
registerMooseObject("MooseApp", SimulationTimes)
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
Definition: UserObject.h:211
Times simulated, obtained from the problem.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
virtual void initialize() override
In charge of computing / loading the times, unless all that could be done there is done in the constr...
SimulationTimes(const InputParameters &parameters)
std::vector< Real > & _times
The vector holding the times.
Definition: Times.h:72