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