Line data Source code
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 "TimeStepMaterial.h" 11 : 12 : registerMooseObject("PhaseFieldApp", TimeStepMaterial); 13 : 14 : InputParameters 15 31 : TimeStepMaterial::validParams() 16 : { 17 31 : InputParameters params = Material::validParams(); 18 31 : params.addClassDescription("Provide various time stepping quantities as material properties."); 19 62 : params.addParam<MaterialPropertyName>( 20 : "prop_dt", "dt", "Material property to store the current dt"); 21 62 : params.addParam<MaterialPropertyName>( 22 : "prop_time", "time", "Material property to store the current time"); 23 62 : params.addParam<MaterialPropertyName>( 24 : "prop_time_step", "time_step", "Material property to store the current time step number"); 25 31 : return params; 26 0 : } 27 : 28 24 : TimeStepMaterial::TimeStepMaterial(const InputParameters & parameters) 29 : : Material(parameters), 30 24 : _prop_dt(declareProperty<Real>(getParam<MaterialPropertyName>("prop_dt"))), 31 48 : _prop_time(declareProperty<Real>(getParam<MaterialPropertyName>("prop_time"))), 32 72 : _prop_time_step(declareProperty<Real>(getParam<MaterialPropertyName>("prop_time_step"))) 33 : { 34 24 : } 35 : 36 : void 37 70 : TimeStepMaterial::computeQpProperties() 38 : { 39 70 : _prop_dt[_qp] = _fe_problem.dt(); 40 70 : _prop_time[_qp] = _fe_problem.time(); 41 70 : _prop_time_step[_qp] = _fe_problem.timeStep(); 42 70 : }