www.mooseframework.org
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
DT2 Class Reference

An adaptive timestepper that compares the solution obtained from a single step of size dt with two steps of size dt/2 and adjusts the next timestep accordingly. More...

#include <DT2.h>

Inheritance diagram for DT2:
[legend]

Public Member Functions

 DT2 (const InputParameters &parameters)
 
virtual void preExecute () override
 
virtual void preSolve () override
 
virtual void step () override
 Take a time step. More...
 
virtual void rejectStep () override
 This gets called when time step is rejected. More...
 
virtual bool converged () override
 If the time step converged. More...
 
virtual void init ()
 Initialize the time stepper. More...
 
virtual void postSolve ()
 
virtual void postExecute ()
 
virtual void preStep ()
 
virtual void postStep ()
 
void computeStep ()
 Called before a new step is started. More...
 
virtual bool constrainStep (Real &dt)
 Called after computeStep() is called. More...
 
virtual void acceptStep ()
 This gets called when time step is accepted. More...
 
Real getCurrentDT ()
 Get the current_dt. More...
 
virtual void forceTimeStep (Real dt)
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp ()
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled ()
 Return the enabled status of the object. More...
 
template<typename... Args>
void mooseError (Args &&...args) const
 
template<typename... Args>
void mooseWarning (Args &&...args) const
 
template<typename... Args>
void mooseDeprecated (Args &&...args) const
 
template<typename... Args>
void mooseInfo (Args &&...args) const
 
void addSyncTime (Real sync_time)
 Add a sync time. More...
 
void addSyncTime (const std::set< Real > &times)
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Member Functions

virtual Real computeInitialDT () override
 Called to compute _current_dt for the first timestep. More...
 
virtual Real computeDT () override
 Called to compute _current_dt for a normal step. More...
 
virtual Real computeFailedDT ()
 Called to compute _current_dt after a solve has failed. More...
 
template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 

Protected Attributes

NumericVector< Number > * _u_diff
 
NumericVector< Number > * _u1
 
NumericVector< Number > * _u2
 
NumericVector< Number > * _u_saved
 
NumericVector< Number > * _u_older_saved
 
NumericVector< Number > * _aux1
 
NumericVector< Number > * _aux_saved
 
NumericVector< Number > * _aux_older_saved
 
Real _error
 global relative time discretization error estimate More...
 
Real _e_tol
 error tolerance More...
 
Real _e_max
 maximal error More...
 
Real _max_increase
 maximum increase ratio More...
 
FEProblemBase_fe_problem
 
Transient_executioner
 Reference to transient executioner. More...
 
Real & _time
 Values from executioner. More...
 
Real & _time_old
 
int & _t_step
 
Real & _dt
 
Real & _dt_min
 
Real & _dt_max
 
Real & _end_time
 
std::set< Real > & _sync_times
 
Real & _timestep_tolerance
 
bool & _verbose
 should detailed diagnostic output be printed More...
 
bool _converged
 Whether or not the previous solve converged. More...
 
bool _reset_dt
 If true then the next dt will be computed by computeInitialDT() More...
 
bool _has_reset_dt
 True if dt has been reset. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 

Detailed Description

An adaptive timestepper that compares the solution obtained from a single step of size dt with two steps of size dt/2 and adjusts the next timestep accordingly.

Definition at line 38 of file DT2.h.

Constructor & Destructor Documentation

DT2::DT2 ( const InputParameters parameters)

Definition at line 45 of file DT2.C.

46  : TimeStepper(parameters),
47  _u_diff(NULL),
48  _u1(NULL),
49  _u2(NULL),
50  _u_saved(NULL),
51  _u_older_saved(NULL),
52  _aux1(NULL),
53  _aux_saved(NULL),
54  _aux_older_saved(NULL),
55  _error(0.),
56  _e_tol(getParam<Real>("e_tol")),
57  _e_max(getParam<Real>("e_max")),
58  _max_increase(getParam<Real>("max_increase"))
59 {
60 }
NumericVector< Number > * _aux_older_saved
Definition: DT2.h:57
NumericVector< Number > * _aux_saved
Definition: DT2.h:57
NumericVector< Number > * _aux1
Definition: DT2.h:57
Real _error
global relative time discretization error estimate
Definition: DT2.h:60
NumericVector< Number > * _u_diff
Definition: DT2.h:55
NumericVector< Number > * _u_older_saved
Definition: DT2.h:56
Real _max_increase
maximum increase ratio
Definition: DT2.h:66
NumericVector< Number > * _u1
Definition: DT2.h:55
TimeStepper(const InputParameters &parameters)
Definition: TimeStepper.C:33
Real _e_tol
error tolerance
Definition: DT2.h:62
NumericVector< Number > * _u_saved
Definition: DT2.h:56
Real _e_max
maximal error
Definition: DT2.h:64
NumericVector< Number > * _u2
Definition: DT2.h:55

Member Function Documentation

void TimeStepper::acceptStep ( )
virtualinherited

This gets called when time step is accepted.

Reimplemented in IterationAdaptiveDT.

Definition at line 165 of file TimeStepper.C.

Referenced by IterationAdaptiveDT::acceptStep(), and TimeStepper::postStep().

166 {
167  // If there are sync times at or before the current time, delete them
168  while (!_sync_times.empty() && _time + _timestep_tolerance >= *_sync_times.begin())
169  {
170  _sync_times.erase(_sync_times.begin());
171  }
172 }
Real & _timestep_tolerance
Definition: TimeStepper.h:138
std::set< Real > & _sync_times
Definition: TimeStepper.h:136
Real & _time
Values from executioner.
Definition: TimeStepper.h:129
void TimeStepper::addSyncTime ( Real  sync_time)
inherited

Add a sync time.

Referenced by TimeStepper::getCurrentDT().

void TimeStepper::addSyncTime ( const std::set< Real > &  times)
inherited
Real DT2::computeDT ( )
overrideprotectedvirtual

Called to compute _current_dt for a normal step.

Note that this does not return. The TimeStepper's job here is to fill in _current_dt.

Implements TimeStepper.

Definition at line 210 of file DT2.C.

211 {
212  Real curr_dt = getCurrentDT();
213  Real new_dt =
214  curr_dt * std::pow(_e_tol / _error,
216  if (new_dt / curr_dt > _max_increase)
217  new_dt = curr_dt * _max_increase;
218 
219  return new_dt;
220 }
Real _error
global relative time discretization error estimate
Definition: DT2.h:60
TimeIntegrator * getTimeIntegrator()
NonlinearSystemBase & getNonlinearSystemBase()
Real _max_increase
maximum increase ratio
Definition: DT2.h:66
FEProblemBase & _fe_problem
Definition: TimeStepper.h:124
Real _e_tol
error tolerance
Definition: DT2.h:62
virtual int order()=0
Real getCurrentDT()
Get the current_dt.
Definition: TimeStepper.h:89
Real TimeStepper::computeFailedDT ( )
protectedvirtualinherited

Called to compute _current_dt after a solve has failed.

Note that this does not return. The TimeStepper's job here is to fill in _current_dt.

Reimplemented in IterationAdaptiveDT, and TimeSequenceStepperBase.

Definition at line 188 of file TimeStepper.C.

Referenced by TimeStepper::computeStep(), and TimeStepper::getCurrentDT().

189 {
190  if (_dt <= _dt_min)
191  mooseError("Solve failed and timestep already at or below dtmin, cannot continue!");
192 
193  // cut the time step in a half
194  if (0.5 * _dt >= _dt_min)
195  return 0.5 * _dt;
196  else // (0.5 * _current_dt < _dt_min)
197  return _dt_min;
198 }
Real & _dt_min
Definition: TimeStepper.h:133
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
Real & _dt
Definition: TimeStepper.h:132
Real DT2::computeInitialDT ( )
overrideprotectedvirtual

Called to compute _current_dt for the first timestep.

Note that this does not return. The TimeStepper's job here is to fill in _current_dt.

Implements TimeStepper.

Definition at line 204 of file DT2.C.

205 {
206  return getParam<Real>("dt");
207 }
void TimeStepper::computeStep ( )
inherited

Called before a new step is started.

This is when the actual computation of the current DT will be done. Because of that this MUST be called only once per step!

After calling this function use getCurrentDT() to get the DT that was computed.

Definition at line 73 of file TimeStepper.C.

Referenced by TimeStepper::postStep().

74 {
75  if (_t_step < 2 || (_reset_dt && !_has_reset_dt))
76  {
77  _has_reset_dt = true;
78 
79  if (converged())
81  else
83  }
84  else
85  {
86  if (converged())
88  else
90  }
91 }
virtual Real computeInitialDT()=0
Called to compute _current_dt for the first timestep.
virtual Real computeFailedDT()
Called to compute _current_dt after a solve has failed.
Definition: TimeStepper.C:188
Real & _current_dt
Size of the current time step as computed by the Stepper. Note that the actual dt that was taken migh...
Definition: TimeStepper.h:154
virtual Real computeDT()=0
Called to compute _current_dt for a normal step.
bool _has_reset_dt
True if dt has been reset.
Definition: TimeStepper.h:150
virtual bool converged()
If the time step converged.
Definition: TimeStepper.C:182
int & _t_step
Definition: TimeStepper.h:131
bool _reset_dt
If true then the next dt will be computed by computeInitialDT()
Definition: TimeStepper.h:147
bool TimeStepper::constrainStep ( Real &  dt)
virtualinherited

Called after computeStep() is called.

Returns
true if any type of sync point was hit, false otherwise

Reimplemented in IterationAdaptiveDT.

Definition at line 94 of file TimeStepper.C.

Referenced by IterationAdaptiveDT::constrainStep(), and TimeStepper::postStep().

95 {
96  bool at_sync_point = false;
97 
98  std::ostringstream diag;
99 
100  // Don't let the time step size exceed maximum time step size
101  if (dt > _dt_max)
102  {
103  dt = _dt_max;
104  diag << "Limiting dt to dtmax: " << std::setw(9) << std::setprecision(6) << std::setfill('0')
105  << std::showpoint << std::left << _dt_max << std::endl;
106  }
107 
108  // Don't allow time step size to be smaller than minimum time step size
109  if (dt < _dt_min)
110  {
111  dt = _dt_min;
112  diag << "Increasing dt to dtmin: " << std::setw(9) << std::setprecision(6) << std::setfill('0')
113  << std::showpoint << std::left << _dt_min << std::endl;
114  }
115 
116  // Don't let time go beyond simulation end time (unless we're doing a half transient)
117  if (_time + dt > _end_time && !_app.halfTransient())
118  {
119  dt = _end_time - _time;
120  diag << "Limiting dt for end_time: " << std::setw(9) << std::setprecision(6)
121  << std::setfill('0') << std::showpoint << std::left << _end_time << " dt: " << std::setw(9)
122  << std::setprecision(6) << std::setfill('0') << std::showpoint << std::left << dt
123  << std::endl;
124  }
125 
126  // Adjust to a sync time if supplied
127  if (!_sync_times.empty() && _time + dt + _timestep_tolerance >= (*_sync_times.begin()))
128  {
129  dt = *_sync_times.begin() - _time;
130  diag << "Limiting dt for sync_time: " << std::setw(9) << std::setprecision(6)
131  << std::setfill('0') << std::showpoint << std::left << *_sync_times.begin()
132  << " dt: " << std::setw(9) << std::setprecision(6) << std::setfill('0') << std::showpoint
133  << std::left << dt << std::endl;
134 
135  if (dt <= 0.0)
136  {
137  _console << diag.str();
138  mooseError("Adjusting to sync_time resulted in a non-positive time step. dt: ",
139  dt,
140  " sync_time: ",
141  *_sync_times.begin(),
142  " time: ",
143  _time);
144  }
145 
146  at_sync_point = true;
147  }
148 
149  if (_verbose)
150  {
151  _console << diag.str();
152  }
153 
154  return at_sync_point;
155 }
Real & _timestep_tolerance
Definition: TimeStepper.h:138
bool halfTransient()
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:339
std::set< Real > & _sync_times
Definition: TimeStepper.h:136
Real & _end_time
Definition: TimeStepper.h:135
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
Real & _dt_min
Definition: TimeStepper.h:133
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
Real & _dt_max
Definition: TimeStepper.h:134
bool & _verbose
should detailed diagnostic output be printed
Definition: TimeStepper.h:141
Real & _time
Values from executioner.
Definition: TimeStepper.h:129
bool DT2::converged ( )
overridevirtual

If the time step converged.

Returns
true if converged, otherwise false

Reimplemented from TimeStepper.

Definition at line 251 of file DT2.C.

252 {
253  if (!_converged)
254  return false;
255 
256  if (_error < _e_max)
257  return true;
258  else
259  return false;
260 }
Real _error
global relative time discretization error estimate
Definition: DT2.h:60
bool _converged
Whether or not the previous solve converged.
Definition: TimeStepper.h:144
Real _e_max
maximal error
Definition: DT2.h:64
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)

Definition at line 224 of file Restartable.h.

225 {
226  return declareRestartableDataWithContext<T>(data_name, NULL);
227 }
template<typename T >
T & Restartable::declareRestartableData ( std::string  data_name,
const T &  init_value 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data

Definition at line 231 of file Restartable.h.

232 {
233  return declareRestartableDataWithContext<T>(data_name, init_value, NULL);
234 }
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable".

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
contextContext pointer that will be passed to the load and store functions

Definition at line 238 of file Restartable.h.

239 {
241  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
242 
243  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
244  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
245 
247 
248  return data_ptr->get();
249 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
template<typename T >
T & Restartable::declareRestartableDataWithContext ( std::string  data_name,
const T &  init_value,
void *  context 
)
protectedinherited

Declare a piece of data as "restartable" and initialize it.

This means that in the event of a restart this piece of data will be restored back to its previous value.

NOTE: This returns a reference! Make sure you store it in a reference!

Parameters
data_nameThe name of the data (usually just use the same name as the member variable)
init_valueThe initial value of the data
contextContext pointer that will be passed to the load and store functions

Definition at line 253 of file Restartable.h.

256 {
258  mooseError("No valid SubProblem found for ", _restartable_system_name, "/", _restartable_name);
259 
260  std::string full_name = _restartable_system_name + "/" + _restartable_name + "/" + data_name;
261  RestartableData<T> * data_ptr = new RestartableData<T>(full_name, context);
262 
263  data_ptr->set() = init_value;
264 
266 
267  return data_ptr->get();
268 }
std::string _restartable_system_name
The system name this object is in.
Definition: Restartable.h:202
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string _restartable_name
The name of the object.
Definition: Restartable.h:196
void registerRestartableDataOnSubProblem(std::string name, RestartableDataValue *data, THREAD_ID tid)
Helper function so we don&#39;t have to include SubProblem in the header.
Definition: Restartable.C:49
Concrete definition of a parameter value for a specified type.
SubProblem * _restartable_subproblem
Pointer to the SubProblem class.
Definition: Restartable.h:208
THREAD_ID _restartable_tid
The thread ID for this object.
Definition: Restartable.h:205
virtual bool MooseObject::enabled ( )
inlinevirtualinherited

Return the enabled status of the object.

Reimplemented in EigenKernel.

Definition at line 77 of file MooseObject.h.

Referenced by EigenKernel::enabled().

77 { return _enabled; }
const bool & _enabled
Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.
Definition: MooseObject.h:117
void TimeStepper::forceTimeStep ( Real  dt)
virtualinherited

Definition at line 201 of file TimeStepper.C.

Referenced by TimeStepper::getCurrentDT().

202 {
203  _current_dt = dt;
204 }
Real & _current_dt
Size of the current time step as computed by the Stepper. Note that the actual dt that was taken migh...
Definition: TimeStepper.h:154
Real TimeStepper::getCurrentDT ( )
inlineinherited

Get the current_dt.

Definition at line 89 of file TimeStepper.h.

Referenced by ConstantDT::computeDT(), LogConstantDT::computeDT(), SolutionTimeAdaptiveDT::computeDT(), computeDT(), and step().

89 { return _current_dt; }
Real & _current_dt
Size of the current time step as computed by the Stepper. Note that the actual dt that was taken migh...
Definition: TimeStepper.h:154
MooseApp& MooseObject::getMooseApp ( )
inlineinherited

Get the MooseApp this object is associated with.

Definition at line 72 of file MooseObject.h.

Referenced by RestartableDataIO::createBackup(), RestartableDataIO::deserializeRestartableData(), Resurrector::restartRestartableData(), and RestartableDataIO::restoreBackup().

72 { return _app; }
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename T >
const T & MooseObject::getParam ( const std::string &  name) const
inherited

Retrieve a parameter for the object.

Parameters
nameThe name of the parameter
Returns
The value of the parameter

Definition at line 122 of file MooseObject.h.

Referenced by FEProblemBase::addMaterial(), ConstraintWarehouse::addObject(), BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromXandY(), EigenKernel::EigenKernel(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), TimeSequenceStepper::init(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), Console::initialSetup(), AdvancedOutput::initialSetup(), SideSetsBetweenSubdomains::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), SideSetsAroundSubdomain::modify(), RenameBlock::modify(), MooseObject::parameters(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), TimePeriod::TimePeriod(), and VectorOfPostprocessors::VectorOfPostprocessors().

123 {
124  return InputParameters::getParamHelper(name, _pars, static_cast<T *>(0));
125 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
static const T & getParamHelper(const std::string &name, const InputParameters &pars, const T *the_type)
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
void TimeStepper::init ( )
virtualinherited

Initialize the time stepper.

Called at the very beginning of Executioner::execute()

Reimplemented in IterationAdaptiveDT, CSVTimeSequenceStepper, TimeSequenceStepperBase, TimeSequenceStepper, and FunctionDT.

Definition at line 60 of file TimeStepper.C.

61 {
62 }
bool MooseObject::isParamValid ( const std::string &  name) const
inlineinherited

Test if the supplied parameter is valid.

Parameters
nameThe name of the parameter to test

Definition at line 67 of file MooseObject.h.

Referenced by BicubicSplineFunction::BicubicSplineFunction(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), GeneratedMesh::buildMesh(), LibmeshPartitioner::clone(), OversampleOutput::cloneMesh(), CSVReader::CSVReader(), MultiAppNearestNodeTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), MultiAppNearestNodeTransfer::getLocalNodes(), MultiAppNearestNodeTransfer::getNearestNode(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), AdvancedOutput::initExecutionTypes(), BlockRestrictable::initializeBlockRestrictable(), BoundaryRestrictable::initializeBoundaryRestrictable(), SolutionAux::initialSetup(), MooseParsedVectorFunction::initialSetup(), Console::initialSetup(), Receiver::initialSetup(), SolutionFunction::initialSetup(), MooseParsedGradFunction::initialSetup(), MooseParsedFunction::initialSetup(), AdvancedOutput::initialSetup(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), IterationAdaptiveDT::IterationAdaptiveDT(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), BreakBoundaryOnSubdomain::modify(), MeshExtruder::modify(), MeshSideSet::modify(), AssignElementSubdomainID::modify(), RenameBlock::modify(), ParsedSubdomainMeshModifier::modify(), SubdomainBoundingBox::modify(), EigenExecutionerBase::normalizeSolution(), Output::Output(), Exodus::outputSetup(), PetscOutput::PetscOutput(), Piecewise::Piecewise(), SolutionUserObject::readExodusII(), RenameBlock::RenameBlock(), Piecewise::setData(), SolutionUserObject::SolutionUserObject(), and TimePeriod::TimePeriod().

67 { return _pars.isParamValid(name); }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
template<typename... Args>
void MooseObject::mooseDeprecated ( Args &&...  args) const
inlineinherited
template<typename... Args>
void MooseObject::mooseError ( Args &&...  args) const
inlineinherited

Definition at line 80 of file MooseObject.h.

Referenced by FEProblemBase::addInitialCondition(), DiracKernel::addPointWithValidId(), FEProblemBase::addPostprocessor(), MooseMesh::addQuadratureNode(), FEProblemBase::addVectorPostprocessor(), Output::advancedExecuteOn(), AnnularMesh::AnnularMesh(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), Function::average(), Axisymmetric2D3DSolutionFunction::Axisymmetric2D3DSolutionFunction(), BicubicSplineFunction::BicubicSplineFunction(), BoundingValueElementDamper::BoundingValueElementDamper(), BoundingValueNodalDamper::BoundingValueNodalDamper(), BoundsAux::BoundsAux(), MooseMesh::buildCoarseningMap(), Piecewise::buildFromFile(), Piecewise::buildFromXandY(), Piecewise::buildFromXY(), TiledMesh::buildMesh(), GeneratedMesh::buildMesh(), ImageMesh::buildMesh3D(), MooseMesh::buildRefinementMap(), EigenExecutionerBase::chebyshev(), FEProblemBase::checkCoordinateSystems(), FEProblemBase::checkDependMaterialsHelper(), FEProblemBase::checkDisplacementOrders(), Material::checkExecutionStage(), Steady::checkIntegrity(), EigenExecutionerBase::checkIntegrity(), SubProblem::checkMatProps(), FEProblemBase::checkProblemIntegrity(), Material::checkStatefulSanity(), FEProblemBase::checkUserObjects(), LibmeshPartitioner::clone(), CompositeFunction::CompositeFunction(), ElementLpNormAux::compute(), ElementH1ErrorFunctionAux::compute(), TimeSequenceStepperBase::computeFailedDT(), IterationAdaptiveDT::computeFailedDT(), TimeStepper::computeFailedDT(), FEProblemBase::computeResidual(), Material::computeSubdomainProperties(), PenetrationAux::computeValue(), TimeStepper::constrainStep(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), DebugResidualAux::DebugResidualAux(), BicubicSplineFunction::derivative(), DGKernel::DGKernel(), SolutionUserObject::discontinuousPointValue(), SolutionUserObject::discontinuousPointValueGradient(), FEProblemBase::duplicateVariableCheck(), EigenProblem::EigenProblem(), Eigenvalues::Eigenvalues(), ElementalVariableValue::ElementalVariableValue(), MooseMesh::errorIfDistributedMesh(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), PerflogDumper::execute(), NodalValueSampler::execute(), MultiAppPostprocessorTransfer::execute(), DiscreteElementUserObject::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), FindValueOnLine::execute(), MultiAppInterpolationTransfer::execute(), TimeExtremeValue::execute(), LeastSquaresFit::execute(), FEProblemBase::executeControls(), FileOutput::FileOutput(), MultiApp::fillPositions(), VerifyElementUniqueID::finalize(), VerifyNodalUniqueID::finalize(), DiscreteElementUserObject::finalize(), MemoryUsage::finalize(), PointSamplerBase::finalize(), Transfer::find_sys(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), FunctionDT::FunctionDT(), FunctionScalarAux::FunctionScalarAux(), FunctionScalarIC::FunctionScalarIC(), GapValueAux::GapValueAux(), GeneratedMesh::GeneratedMesh(), GenericConstantMaterial::GenericConstantMaterial(), GenericFunctionMaterial::GenericFunctionMaterial(), MooseMesh::getBoundaryID(), MultiApp::getBoundingBox(), MooseMesh::getCoarseningMap(), FEProblemBase::getCoordSystem(), PiecewiseConstant::getDirection(), FEProblemBase::getDistribution(), MultiApp::getExecutioner(), FEProblemBase::getFunction(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), GeneratedMesh::getMaxInDimension(), AnnularMesh::getMaxInDimension(), FEProblemBase::getMaxQps(), FEProblemBase::getMaxShapeFunctions(), GeneratedMesh::getMinInDimension(), AnnularMesh::getMinInDimension(), MooseMesh::getMortarInterface(), MooseMesh::getMortarInterfaceByName(), MooseMesh::getNodeBlockIds(), MooseMesh::getNodeList(), FEProblemBase::getNonlinearSystem(), MooseMesh::getPairedBoundaryMapping(), ImageMesh::GetPixelInfo(), MaterialStdVectorAux::getRealValue(), MooseMesh::getRefinementMap(), FEProblemBase::getSampler(), DisplacedProblem::getScalarVariable(), FEProblemBase::getScalarVariable(), MooseMesh::getSubdomainBoundaryIds(), MooseMesh::getSubdomainID(), DisplacedProblem::getSystem(), FEProblemBase::getSystem(), FEProblemBase::getUserObjectBase(), NumVars::getValue(), PerformanceData::getValue(), Residual::getValue(), FindValueOnLine::getValueAtPoint(), DisplacedProblem::getVariable(), FEProblemBase::getVariable(), MultiApp::globalAppToLocal(), MooseParsedVectorFunction::gradient(), AdvancedOutput::hasOutputHelper(), CSVTimeSequenceStepper::init(), IterationAdaptiveDT::init(), EigenExecutionerBase::init(), MooseMesh::init(), FEProblemBase::init(), NumPicardIterations::initialize(), FullSolveMultiApp::initialSetup(), SolutionAux::initialSetup(), Axisymmetric2D3DSolutionFunction::initialSetup(), Exodus::initialSetup(), SolutionFunction::initialSetup(), SolutionUserObject::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initShowHideLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), EigenExecutionerBase::inversePowerIteration(), InversePowerMethod::InversePowerMethod(), IterationAdaptiveDT::IterationAdaptiveDT(), KernelBase::KernelBase(), LeastSquaresFit::LeastSquaresFit(), LibmeshPartitioner::LibmeshPartitioner(), LinearCombinationFunction::LinearCombinationFunction(), LinearCombinationPostprocessor::LinearCombinationPostprocessor(), LinearNodalConstraint::LinearNodalConstraint(), LineMaterialSamplerBase< T >::LineMaterialSamplerBase(), MaterialRealTensorValueAux::MaterialRealTensorValueAux(), MaterialRealVectorValueAux::MaterialRealVectorValueAux(), MaterialStdVectorRealGradientAux::MaterialStdVectorRealGradientAux(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), SubProblem::meshChanged(), MeshExtruder::MeshExtruder(), SideSetsFromNormals::modify(), SideSetsFromPoints::modify(), AddExtraNodeset::modify(), MeshExtruder::modify(), AssignElementSubdomainID::modify(), AddAllSideSetsByNormals::modify(), ElementDeleterBase::modify(), ParsedSubdomainMeshModifier::modify(), RenameBlock::modify(), ImageSubdomain::modify(), BoundingBoxNodeSet::modify(), OrientedSubdomainBoundingBox::modify(), AddSideSetsFromBoundingBox::modify(), SubdomainBoundingBox::modify(), MultiAppMeshFunctionTransfer::MultiAppMeshFunctionTransfer(), MultiAppPostprocessorTransfer::MultiAppPostprocessorTransfer(), NearestNodeDistanceAux::NearestNodeDistanceAux(), NearestNodeValueAux::NearestNodeValueAux(), NodalBC::NodalBC(), NodalConstraint::NodalConstraint(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalVariableValue::NodalVariableValue(), NumDOFs::NumDOFs(), NumNonlinearIterations::NumNonlinearIterations(), VTKOutput::output(), XDA::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), Console::outputVectorPostprocessors(), AdvancedOutput::outputVectorPostprocessors(), PiecewiseBilinear::parse(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PatternedMesh::PatternedMesh(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), Piecewise::Piecewise(), PiecewiseBilinear::PiecewiseBilinear(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), PiecewiseMultilinear::PiecewiseMultilinear(), SolutionUserObject::pointValueGradientWrapper(), SolutionUserObject::pointValueWrapper(), LStableDirk2::postStep(), LStableDirk3::postStep(), ImplicitMidpoint::postStep(), ExplicitTVDRK2::postStep(), AStableDirk4::postStep(), LStableDirk4::postStep(), ExplicitRK2::postStep(), Predictor::Predictor(), SolutionUserObject::readExodusII(), SolutionUserObject::readXda(), RelativeSolutionDifferenceNorm::RelativeSolutionDifferenceNorm(), RenameBlock::RenameBlock(), ScalarComponentIC::ScalarComponentIC(), BicubicSplineFunction::secondDerivative(), FEProblemBase::setCoordSystem(), Piecewise::setData(), EigenProblem::setEigenproblemType(), Sampler::setNumberOfRequiedRandomSeeds(), Split::setup(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), SideSetsFromNormals::SideSetsFromNormals(), SideSetsFromPoints::SideSetsFromPoints(), SolutionUserObject::SolutionUserObject(), FullSolveMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), NodalUserObject::subdomainSetup(), GeneralUserObject::subdomainSetup(), Constraint::subdomainSetup(), Console::systemInfoFlags(), Terminator::Terminator(), TestSetupPostprocessorDataActionFunction::TestSetupPostprocessorDataActionFunction(), DiscreteElementUserObject::threadJoin(), GeneralUserObject::threadJoin(), Function::timeDerivative(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), MultiAppCopyTransfer::transfer(), MultiAppMeshFunctionTransfer::transferVariable(), Transient::Transient(), TransientMultiApp::TransientMultiApp(), EqualValueBoundaryConstraint::updateConstrainedNodes(), SolutionUserObject::updateExodusBracketingTimeIndices(), Axisymmetric2D3DSolutionFunction::value(), ValueRangeMarker::ValueRangeMarker(), ValueThresholdMarker::ValueThresholdMarker(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), VectorOfPostprocessors::VectorOfPostprocessors(), VectorPostprocessorFunction::VectorPostprocessorFunction(), MooseParsedGradFunction::vectorValue(), MooseParsedFunction::vectorValue(), and VolumeHistogram::VolumeHistogram().

81  {
82  std::ostringstream oss;
83  moose::internal::mooseStreamAll(oss, std::forward<Args>(args)...);
84  std::string msg = oss.str();
85  callMooseErrorRaw(msg, &_app);
86  }
void mooseStreamAll(std::ostringstream &ss)
Definition: MooseError.C:78
void callMooseErrorRaw(std::string &msg, MooseApp *app)
Definition: MooseObject.C:45
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
template<typename... Args>
void MooseObject::mooseInfo ( Args &&...  args) const
inlineinherited

Definition at line 101 of file MooseObject.h.

102  {
103  moose::internal::mooseInfoStream(_console, std::forward<Args>(args)...);
104  }
void mooseInfoStream(S &oss, Args &&...args)
Definition: MooseError.h:145
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
template<typename... Args>
void MooseObject::mooseWarning ( Args &&...  args) const
inlineinherited
const std::string& MooseObject::name ( ) const
inlineinherited

Get the name of the object.

Returns
The name of the object

Definition at line 47 of file MooseObject.h.

Referenced by FEProblemBase::addDistribution(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), MooseMesh::addMortarInterface(), FEProblemBase::addMultiApp(), FEProblemBase::addPredictor(), FEProblemBase::addSampler(), FEProblemBase::addTransfer(), FEProblemBase::addUserObject(), Output::advancedExecuteOn(), MultiApp::appPostprocessorValue(), MultiApp::appProblem(), MultiApp::appProblemBase(), MultiApp::appUserObjectBase(), AStableDirk4::AStableDirk4(), Function::average(), FEProblemBase::checkDependMaterialsHelper(), Damper::checkMinDamping(), Material::checkStatefulSanity(), CompositeFunction::CompositeFunction(), Material::computeSubdomainProperties(), AuxKernel::coupledCallback(), AuxKernel::coupledDot(), AuxKernel::coupledDotDu(), MultiApp::createApp(), DGKernel::DGKernel(), AB2PredictorCorrector::estimateTimeError(), SolutionUserObject::evalMeshFunction(), SolutionUserObject::evalMeshFunctionGradient(), SolutionUserObject::evalMultiValuedMeshFunction(), SolutionUserObject::evalMultiValuedMeshFunctionGradient(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), PointValue::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), FileOutput::FileOutput(), MultiApp::fillPositions(), PointSamplerBase::finalize(), GeneralUserObject::GeneralUserObject(), MultiApp::getBoundingBox(), Control::getControllableParameterHelper(), Control::getControllableValue(), AuxKernel::getDependObjects(), MultiApp::getExecutioner(), OutputWarehouse::getFileNumbers(), SolutionUserObject::getLocalVarIndex(), AuxKernel::getMaterialProperty(), SubProblem::getMaterialPropertyBlockNames(), SubProblem::getMaterialPropertyBoundaryNames(), AuxKernel::getMaterialPropertyOld(), AuxKernel::getMaterialPropertyOlder(), OutputWarehouse::getOutput(), Transient::getTimeStepperName(), InitialCondition::getUserObject(), AuxKernel::getUserObject(), InitialCondition::getUserObjectByName(), AuxKernel::getUserObjectByName(), AdvancedOutput::hasOutputHelper(), FEProblemBase::init(), CSVReader::initialize(), MultiAppProjectionTransfer::initialSetup(), InitialCondition::initialSetup(), SolutionUserObject::initialSetup(), AdvancedOutput::initOutputList(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), Material::initStatefulProperties(), Function::integral(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), KernelBase::KernelBase(), LinearCombinationFunction::LinearCombinationFunction(), Marker::Marker(), MaterialDerivativeTestKernelBase< T >::MaterialDerivativeTestKernelBase(), MaterialVectorPostprocessor::MaterialVectorPostprocessor(), ElementDeleterBase::modify(), NodalBC::NodalBC(), NodalEqualValueConstraint::NodalEqualValueConstraint(), NodalKernel::NodalKernel(), NodalValueSampler::NodalValueSampler(), NodalVariableValue::NodalVariableValue(), DOFMapOutput::output(), AdvancedOutput::outputElementalVariables(), AdvancedOutput::outputInput(), AdvancedOutput::outputNodalVariables(), ConsoleUtils::outputOutputInformation(), Nemesis::outputPostprocessors(), Exodus::outputPostprocessors(), AdvancedOutput::outputPostprocessors(), AdvancedOutput::outputScalarVariables(), AdvancedOutput::outputSystemInformation(), AdvancedOutput::outputVectorPostprocessors(), MooseObject::parameters(), Executioner::parentOutputPositionChanged(), ParsedAddSideset::ParsedAddSideset(), ParsedAux::ParsedAux(), ParsedODEKernel::ParsedODEKernel(), ParsedSubdomainMeshModifier::ParsedSubdomainMeshModifier(), PointSamplerBase::PointSamplerBase(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), Material::resetQpProperties(), Sampler::Sampler(), ScalarComponentIC::ScalarComponentIC(), MooseMesh::setBoundaryName(), Control::setControllableValue(), OutputWarehouse::setFileNumbers(), MooseMesh::setSubdomainName(), Split::setup(), TransientMultiApp::setupApp(), SideValueSampler::SideValueSampler(), TransientMultiApp::solveStep(), UserObject::spatialValue(), SphericalAverage::SphericalAverage(), StitchedMesh::StitchedMesh(), Function::timeDerivative(), TransientMultiApp::TransientMultiApp(), MultiAppTransfer::variableIntegrityCheck(), VariableResidual::VariableResidual(), and AdvancedOutput::wantOutput().

47 { return _name; }
const std::string & _name
The name of this object, reference to value stored in InputParameters.
Definition: MooseObject.h:114
const InputParameters& MooseObject::parameters ( ) const
inlineinherited
virtual void TimeStepper::postExecute ( )
inlinevirtualinherited

Definition at line 45 of file TimeStepper.h.

45 {}
virtual void TimeStepper::postSolve ( )
inlinevirtualinherited

Definition at line 44 of file TimeStepper.h.

44 {}
virtual void TimeStepper::postStep ( )
inlinevirtualinherited

Reimplemented in FunctionDT.

Definition at line 47 of file TimeStepper.h.

47 {}
void DT2::preExecute ( )
overridevirtual

Reimplemented from TimeStepper.

Definition at line 63 of file DT2.C.

64 {
66  System & nl_sys = _fe_problem.getNonlinearSystemBase().system();
67  _u1 = &nl_sys.add_vector("u1", true, GHOSTED);
68  _u2 = &nl_sys.add_vector("u2", false, GHOSTED);
69  _u_diff = &nl_sys.add_vector("u_diff", false, GHOSTED);
70 
71  _u_saved = &nl_sys.add_vector("u_saved", false, GHOSTED);
72  _u_older_saved = &nl_sys.add_vector("u_older_saved", false, GHOSTED);
73 
74  TransientExplicitSystem & aux_sys = _fe_problem.getAuxiliarySystem().sys();
75  _aux1 = &aux_sys.add_vector("aux1", true, GHOSTED);
76  _aux_saved = &aux_sys.add_vector("aux_saved", false, GHOSTED);
77  _aux_older_saved = &aux_sys.add_vector("aux_older_saved", false, GHOSTED);
78 }
NumericVector< Number > * _aux_older_saved
Definition: DT2.h:57
NumericVector< Number > * _aux_saved
Definition: DT2.h:57
NumericVector< Number > * _aux1
Definition: DT2.h:57
NonlinearSystemBase & getNonlinearSystemBase()
virtual TransientExplicitSystem & sys()
NumericVector< Number > * _u_diff
Definition: DT2.h:55
NumericVector< Number > * _u_older_saved
Definition: DT2.h:56
FEProblemBase & _fe_problem
Definition: TimeStepper.h:124
NumericVector< Number > * _u1
Definition: DT2.h:55
AuxiliarySystem & getAuxiliarySystem()
NumericVector< Number > * _u_saved
Definition: DT2.h:56
virtual System & system() override
Get the reference to the libMesh system.
virtual void preExecute()
Definition: TimeStepper.C:65
NumericVector< Number > * _u2
Definition: DT2.h:55
void DT2::preSolve ( )
overridevirtual

Reimplemented from TimeStepper.

Definition at line 81 of file DT2.C.

82 {
84  TransientExplicitSystem & aux_sys = _fe_problem.getAuxiliarySystem().sys();
85 
86  // save solution vectors
87  *_u_saved = *nl_sys.currentSolution();
88  *_u_older_saved = nl_sys.solutionOlder();
89 
90  *_aux_saved = *aux_sys.current_local_solution;
91  *_aux_older_saved = *aux_sys.older_local_solution;
92 
93  _u_saved->close();
94  _u_older_saved->close();
95  _aux_saved->close();
96  _aux_older_saved->close();
97 }
NumericVector< Number > * _aux_older_saved
Definition: DT2.h:57
virtual const NumericVector< Number > *& currentSolution() override
The solution vector that is currently being operated on.
NumericVector< Number > * _aux_saved
Definition: DT2.h:57
NonlinearSystemBase & getNonlinearSystemBase()
virtual TransientExplicitSystem & sys()
NumericVector< Number > * _u_older_saved
Definition: DT2.h:56
Nonlinear system to be solved.
FEProblemBase & _fe_problem
Definition: TimeStepper.h:124
AuxiliarySystem & getAuxiliarySystem()
NumericVector< Number > * _u_saved
Definition: DT2.h:56
virtual NumericVector< Number > & solutionOlder()=0
virtual void TimeStepper::preStep ( )
inlinevirtualinherited

Definition at line 46 of file TimeStepper.h.

46 {}
void DT2::rejectStep ( )
overridevirtual

This gets called when time step is rejected.

Reimplemented from TimeStepper.

Definition at line 223 of file DT2.C.

224 {
225  if (_error >= _e_max)
226  _console << "DT2Transient: Marking last solve not converged since |U2-U1|/max(|U2|,|U1|) = "
227  << _error << " >= e_max." << std::endl;
228 
230  System & nl_sys = nl.system();
231  TransientExplicitSystem & aux_sys = _fe_problem.getAuxiliarySystem().sys();
232 
233  // recover initial state
234  *nl_sys.current_local_solution = *_u_saved;
235  nl.solutionOld() = *_u_saved;
237 
238  *aux_sys.current_local_solution = *_aux_saved;
239  *aux_sys.old_local_solution = *_aux_saved;
240  *aux_sys.older_local_solution = *_aux_older_saved;
241 
242  nl_sys.solution->close();
243  nl.solutionOld().close();
244  nl.solutionOlder().close();
245  aux_sys.solution->close();
246  aux_sys.old_local_solution->close();
247  aux_sys.older_local_solution->close();
248 }
NumericVector< Number > * _aux_older_saved
Definition: DT2.h:57
NumericVector< Number > * _aux_saved
Definition: DT2.h:57
Real _error
global relative time discretization error estimate
Definition: DT2.h:60
NonlinearSystemBase & getNonlinearSystemBase()
virtual NumericVector< Number > & solutionOld()=0
virtual TransientExplicitSystem & sys()
NumericVector< Number > * _u_older_saved
Definition: DT2.h:56
NonlinearSystemBase * nl
Nonlinear system to be solved.
FEProblemBase & _fe_problem
Definition: TimeStepper.h:124
AuxiliarySystem & getAuxiliarySystem()
NumericVector< Number > * _u_saved
Definition: DT2.h:56
virtual System & system() override
Get the reference to the libMesh system.
Real _e_max
maximal error
Definition: DT2.h:64
virtual NumericVector< Number > & solutionOlder()=0
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
void DT2::step ( )
overridevirtual

Take a time step.

Reimplemented from TimeStepper.

Definition at line 100 of file DT2.C.

101 {
103  System & nl_sys = nl.system();
104  TransientExplicitSystem & aux_sys = _fe_problem.getAuxiliarySystem().sys();
105 
106  // solve the problem with full dt
107  _fe_problem.solve();
108  _converged = nl.converged();
109  if (_converged)
110  {
111  // save the solution (for time step with dt)
112  *_u1 = *nl.currentSolution();
113  _u1->close();
114  *_aux1 = *aux_sys.current_local_solution;
115  _aux1->close();
116 
117  // take two steps with dt/2
118  _console << "Taking two dt/2 time steps" << std::endl;
119 
120  // restore solutions to the original state
121  *nl_sys.current_local_solution = *_u_saved;
122  *aux_sys.current_local_solution = *_aux_saved;
123  nl_sys.current_local_solution->close();
124  aux_sys.current_local_solution->close();
125 
126  _dt = getCurrentDT() / 2; // cut the time step in half
127  _time = _time_old + _dt;
128 
129  // 1. step
132 
133  _console << " - 1. step" << std::endl;
135  nl.solve();
136  _converged = nl.converged();
137 
138  if (_converged)
139  {
140  nl_sys.update();
141 
144 
145  _time += _dt;
146  // 2. step
149 
150  _console << " - 2. step" << std::endl;
152  nl.solve();
153  _converged = nl.converged();
154  if (_converged)
155  {
156  nl_sys.update();
157 
158  *_u2 = *nl_sys.current_local_solution;
159  _u2->close();
160 
161  // compute error
162  *_u_diff = *_u2;
163  *_u_diff -= *_u1;
164  _u_diff->close();
165 
166  _error = (_u_diff->l2_norm() / std::max(_u1->l2_norm(), _u2->l2_norm())) / getCurrentDT();
167 
168  // restore _dt to its original value
169  _dt = getCurrentDT();
170  }
171  else
172  {
173  // solve failed, restore _time
174  _time = _time_old;
175  }
176  }
177  else
178  {
179  // solve failed, restore _time
180  _time = _time_old;
181  }
182 
183  if (!_converged)
184  {
185  *nl_sys.current_local_solution = *_u1;
186  nl.solutionOld() = *_u1;
187  nl.solutionOlder() = *_u_saved;
188 
189  *aux_sys.current_local_solution = *_aux1;
190  *aux_sys.old_local_solution = *_aux1;
191  *aux_sys.older_local_solution = *_aux_saved;
192 
193  nl_sys.current_local_solution->close();
194  nl.solutionOld().close();
195  nl.solutionOlder().close();
196  aux_sys.current_local_solution->close();
197  aux_sys.old_local_solution->close();
198  aux_sys.older_local_solution->close();
199  }
200  }
201 }
virtual const NumericVector< Number > *& currentSolution() override
The solution vector that is currently being operated on.
NumericVector< Number > * _aux_saved
Definition: DT2.h:57
NumericVector< Number > * _aux1
Definition: DT2.h:57
virtual bool converged()=0
Returns the convergence state.
Real _error
global relative time discretization error estimate
Definition: DT2.h:60
NonlinearSystemBase & getNonlinearSystemBase()
void setSolverDefaults(FEProblemBase &problem)
Definition: Moose.C:1233
virtual NumericVector< Number > & solutionOld()=0
Real & _time_old
Definition: TimeStepper.h:130
virtual TransientExplicitSystem & sys()
NumericVector< Number > * _u_diff
Definition: DT2.h:55
Object is evaluated at the end of every time step.
Definition: MooseTypes.h:100
NonlinearSystemBase * nl
Nonlinear system to be solved.
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
FEProblemBase & _fe_problem
Definition: TimeStepper.h:124
void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
NumericVector< Number > * _u1
Definition: DT2.h:55
AuxiliarySystem & getAuxiliarySystem()
virtual void solve() override=0
Solve the system (using libMesh magic)
bool _converged
Whether or not the previous solve converged.
Definition: TimeStepper.h:144
NumericVector< Number > * _u_saved
Definition: DT2.h:56
virtual System & system() override
Get the reference to the libMesh system.
virtual void onTimestepBegin() override
virtual NumericVector< Number > & solutionOlder()=0
Object is evaluated at the beginning of every time step.
Definition: MooseTypes.h:102
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void solve() override
Real & _dt
Definition: TimeStepper.h:132
Real getCurrentDT()
Get the current_dt.
Definition: TimeStepper.h:89
Real & _time
Values from executioner.
Definition: TimeStepper.h:129
NumericVector< Number > * _u2
Definition: DT2.h:55

Member Data Documentation

MooseApp& MooseObject::_app
protectedinherited

The MooseApp this object is associated with.

Definition at line 108 of file MooseObject.h.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector(), Executioner::addAttributeReporter(), FEProblemBase::addMaterial(), FEProblemBase::addMultiApp(), FEProblemBase::allowOutput(), AStableDirk4::AStableDirk4(), FileMesh::buildMesh(), FEProblemBase::checkNonlinearConvergence(), OversampleOutput::cloneMesh(), FEProblemBase::computeJacobian(), FEProblemBase::computeResidualType(), Console::Console(), TimeStepper::constrainStep(), MultiApp::createApp(), EigenExecutionerBase::EigenExecutionerBase(), EigenKernel::EigenKernel(), InversePowerMethod::execute(), NonlinearEigen::execute(), Transient::execute(), Steady::execute(), FileOutput::FileOutput(), FEProblemBase::forceOutput(), MooseObject::getMooseApp(), InversePowerMethod::init(), NonlinearEigen::init(), Transient::init(), Steady::init(), MooseMesh::init(), NumPicardIterations::initialize(), TimePeriod::initialSetup(), Console::initialSetup(), MultiApp::initialSetup(), FEProblemBase::initialSetup(), AdvancedOutput::initOutputList(), FEProblemBase::initPetscOutput(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), InversePowerMethod::InversePowerMethod(), MooseObject::mooseError(), MooseMesh::MooseMesh(), NonlinearEigen::NonlinearEigen(), Tecplot::output(), Exodus::output(), Nemesis::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Exodus::outputEmptyTimestep(), Console::outputInput(), Exodus::outputInput(), Exodus::outputNodalVariables(), OversampleOutput::outputStep(), Output::outputStep(), FEProblemBase::outputStep(), Console::outputSystemInformation(), MultiApp::parentOutputPositionChanged(), PerformanceData::PerformanceData(), PetscOutput::petscLinearOutput(), PetscOutput::petscNonlinearOutput(), SubProblem::registerRecoverableData(), SubProblem::registerRestartableData(), FEProblemBase::setRestartFile(), TransientMultiApp::setupApp(), TimeSequenceStepperBase::setupSequence(), Transient::setupTimeIntegrator(), TransientMultiApp::solveStep(), FEProblemBase::subdomainSetup(), TimeExtremeValue::TimeExtremeValue(), TimePeriod::TimePeriod(), FEProblemBase::timestepSetup(), Transient::Transient(), and Console::write().

NumericVector<Number>* DT2::_aux1
protected

Definition at line 57 of file DT2.h.

Referenced by preExecute(), and step().

NumericVector<Number> * DT2::_aux_older_saved
protected

Definition at line 57 of file DT2.h.

Referenced by preExecute(), preSolve(), and rejectStep().

NumericVector<Number> * DT2::_aux_saved
protected

Definition at line 57 of file DT2.h.

Referenced by preExecute(), preSolve(), rejectStep(), and step().

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 37 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), CreateProblemAction::act(), SetupRecoverFileBaseAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), FEProblemBase::advanceMultiApps(), SimplePredictor::apply(), FEProblemBase::backupMultiApps(), FEProblemBase::checkProblemIntegrity(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeResidualType(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), AB2PredictorCorrector::converged(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MultiAppPostprocessorTransfer::execute(), MultiAppPostprocessorInterpolationTransfer::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), MultiAppNearestNodeTransfer::execute(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), MultiAppVariableValueSampleTransfer::execute(), MultiAppUserObjectTransfer::execute(), MultiAppInterpolationTransfer::execute(), MultiAppMeshFunctionTransfer::execute(), MultiAppProjectionTransfer::execute(), MultiAppCopyTransfer::execute(), Steady::execute(), MultiAppDTKUserObjectTransfer::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MultiApp::globalAppToLocal(), InversePowerMethod::init(), NonlinearEigen::init(), Steady::init(), FEProblemBase::initialAdaptMesh(), FEProblemBase::initialSetup(), EigenExecutionerBase::inversePowerIteration(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseObject::mooseDeprecated(), MooseObject::mooseInfo(), MooseObject::mooseWarning(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), ActionWarehouse::printActionDependencySets(), EigenExecutionerBase::printEigenvalue(), MaterialPropertyDebugOutput::printMaterialMap(), SolutionTimeAdaptiveDT::rejectStep(), rejectStep(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), NonlinearSystem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), AStableDirk4::solve(), LStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), Transient::solveStep(), step(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), FEProblemBase::useFECache(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

bool TimeStepper::_converged
protectedinherited
Real& TimeStepper::_dt
protectedinherited
Real& TimeStepper::_dt_max
protectedinherited

Definition at line 134 of file TimeStepper.h.

Referenced by SolutionTimeAdaptiveDT::computeDT(), and TimeStepper::constrainStep().

Real& TimeStepper::_dt_min
protectedinherited
Real DT2::_e_max
protected

maximal error

Definition at line 64 of file DT2.h.

Referenced by converged(), and rejectStep().

Real DT2::_e_tol
protected

error tolerance

Definition at line 62 of file DT2.h.

Referenced by computeDT().

const bool& MooseObject::_enabled
protectedinherited

Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects.

Definition at line 117 of file MooseObject.h.

Referenced by MooseObject::enabled().

Real& TimeStepper::_end_time
protectedinherited

Definition at line 135 of file TimeStepper.h.

Referenced by TimeStepper::constrainStep().

Real DT2::_error
protected

global relative time discretization error estimate

Definition at line 60 of file DT2.h.

Referenced by computeDT(), converged(), rejectStep(), and step().

Transient& TimeStepper::_executioner
protectedinherited

Reference to transient executioner.

Definition at line 126 of file TimeStepper.h.

Referenced by IterationAdaptiveDT::acceptStep(), and TimeSequenceStepperBase::setupSequence().

FEProblemBase& TimeStepper::_fe_problem
protectedinherited
bool TimeStepper::_has_reset_dt
protectedinherited

True if dt has been reset.

Definition at line 150 of file TimeStepper.h.

Referenced by TimeStepper::computeStep().

Real DT2::_max_increase
protected

maximum increase ratio

Definition at line 66 of file DT2.h.

Referenced by computeDT().

const std::string& MooseObject::_name
protectedinherited
const InputParameters& MooseObject::_pars
protectedinherited
bool TimeStepper::_reset_dt
protectedinherited

If true then the next dt will be computed by computeInitialDT()

Definition at line 147 of file TimeStepper.h.

Referenced by TimeStepper::computeStep().

std::set<Real>& TimeStepper::_sync_times
protectedinherited
int& TimeStepper::_t_step
protectedinherited
Real& TimeStepper::_time
protectedinherited
Real& TimeStepper::_time_old
protectedinherited
Real& TimeStepper::_timestep_tolerance
protectedinherited
NumericVector<Number> * DT2::_u1
protected

Definition at line 55 of file DT2.h.

Referenced by preExecute(), and step().

NumericVector<Number> * DT2::_u2
protected

Definition at line 55 of file DT2.h.

Referenced by preExecute(), and step().

NumericVector<Number>* DT2::_u_diff
protected

Definition at line 55 of file DT2.h.

Referenced by preExecute(), and step().

NumericVector<Number> * DT2::_u_older_saved
protected

Definition at line 56 of file DT2.h.

Referenced by preExecute(), preSolve(), and rejectStep().

NumericVector<Number>* DT2::_u_saved
protected

Definition at line 56 of file DT2.h.

Referenced by preExecute(), preSolve(), rejectStep(), and step().

bool& TimeStepper::_verbose
protectedinherited

The documentation for this class was generated from the following files: