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 
16 {
18  params.addClassDescription("Provide various time stepping quantities as material properties.");
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 
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 {
42 }
MaterialProperty< Real > & _prop_dt
FEProblemBase & _fe_problem
virtual Real & time() const
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
unsigned int _qp
Store current time, dt, and time step number in material properties.
static InputParameters validParams()
virtual void computeQpProperties()
MaterialProperty< Real > & _prop_time_step
TimeStepMaterial(const InputParameters &parameters)
virtual int & timeStep() const
registerMooseObject("PhaseFieldApp", TimeStepMaterial)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
virtual Real & dt() const
MaterialProperty< Real > & _prop_time