www.mooseframework.org
TimeStepMaterial.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "TimeStepMaterial.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Material>();
15  params.addParam<MaterialPropertyName>(
16  "prop_dt", "dt", "Material property to store the current dt");
17  params.addParam<MaterialPropertyName>(
18  "prop_time", "time", "Material property to store the current time");
19  params.addParam<MaterialPropertyName>(
20  "prop_time_step", "time_step", "Material property to store the current time step number");
21  return params;
22 }
23 
24 TimeStepMaterial::TimeStepMaterial(const InputParameters & parameters)
25  : Material(parameters),
26  _prop_dt(declareProperty<Real>(getParam<MaterialPropertyName>("prop_dt"))),
27  _prop_time(declareProperty<Real>(getParam<MaterialPropertyName>("prop_time"))),
28  _prop_time_step(declareProperty<Real>(getParam<MaterialPropertyName>("prop_time_step")))
29 {
30 }
31 
32 void
34 {
35  _prop_dt[_qp] = _fe_problem.dt();
36  _prop_time[_qp] = _fe_problem.time();
37  _prop_time_step[_qp] = _fe_problem.timeStep();
38 }
MaterialProperty< Real > & _prop_dt
virtual void computeQpProperties()
MaterialProperty< Real > & _prop_time_step
InputParameters validParams< TimeStepMaterial >()
TimeStepMaterial(const InputParameters &parameters)
MaterialProperty< Real > & _prop_time