www.mooseframework.org
TimeStepMaterial.C
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 #include "TimeStepMaterial.h"
11 
12 registerMooseObject("PhaseFieldApp", TimeStepMaterial);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<Material>();
19  params.addParam<MaterialPropertyName>(
20  "prop_dt", "dt", "Material property to store the current dt");
21  params.addParam<MaterialPropertyName>(
22  "prop_time", "time", "Material property to store the current time");
23  params.addParam<MaterialPropertyName>(
24  "prop_time_step", "time_step", "Material property to store the current time step number");
25  return params;
26 }
27 
28 TimeStepMaterial::TimeStepMaterial(const InputParameters & parameters)
29  : Material(parameters),
30  _prop_dt(declareProperty<Real>(getParam<MaterialPropertyName>("prop_dt"))),
31  _prop_time(declareProperty<Real>(getParam<MaterialPropertyName>("prop_time"))),
32  _prop_time_step(declareProperty<Real>(getParam<MaterialPropertyName>("prop_time_step")))
33 {
34 }
35 
36 void
38 {
39  _prop_dt[_qp] = _fe_problem.dt();
40  _prop_time[_qp] = _fe_problem.time();
41  _prop_time_step[_qp] = _fe_problem.timeStep();
42 }
TimeStepMaterial::_prop_time_step
MaterialProperty< Real > & _prop_time_step
Definition: TimeStepMaterial.h:32
registerMooseObject
registerMooseObject("PhaseFieldApp", TimeStepMaterial)
TimeStepMaterial::computeQpProperties
virtual void computeQpProperties()
Definition: TimeStepMaterial.C:37
TimeStepMaterial::TimeStepMaterial
TimeStepMaterial(const InputParameters &parameters)
Definition: TimeStepMaterial.C:28
validParams< TimeStepMaterial >
InputParameters validParams< TimeStepMaterial >()
Definition: TimeStepMaterial.C:16
TimeStepMaterial::_prop_time
MaterialProperty< Real > & _prop_time
Definition: TimeStepMaterial.h:31
TimeStepMaterial.h
TimeStepMaterial::_prop_dt
MaterialProperty< Real > & _prop_dt
Definition: TimeStepMaterial.h:30
TimeStepMaterial
Store current time, dt, and time step number in material properties.
Definition: TimeStepMaterial.h:22