https://mooseframework.inl.gov
TimeSequenceFromTimes.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 "TimeSequenceFromTimes.h"
11 #include "Times.h"
12 
14 
17 {
19  params.addRequiredParam<TimesName>(
20  "times", "The name of the Times object containing the times to hit during the simulation");
21  params.addClassDescription("Solves the Transient problem at a sequence of time points taken from "
22  "a specified Times object.");
23  return params;
24 }
25 
27  : TimeSequenceStepperBase(parameters),
28  _times(_fe_problem.getUserObject<Times>(getParam<TimesName>("times")))
29 {
30  // If they are available, initialize
31  const auto & times = _times.getTimes();
32  setupSequence(times);
33 }
34 
35 void
37 {
38  // Get the times again in case there are new ones
39  const auto & times = _times.getTimes();
40  setupSequence(times);
41 
43 }
TimeSequenceFromTimes(const InputParameters &parameters)
registerMooseObject("MooseApp", TimeSequenceFromTimes)
const std::vector< Real > & getTimes() const
Getter for the full times vector.
Definition: Times.C:102
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...
void step() override
Take a time step.
void setupSequence(const std::vector< Real > &times)
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
const Times & _times
A Times object that will provide the sequence of times to hit.
static InputParameters validParams()
Time sequence stepper that gets its sequence of times to hit from a times object. ...
Solves the PDEs at a sequence of given time points.
static InputParameters validParams()
virtual void step() override
Take a time step.
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...