https://mooseframework.inl.gov
ADFluxFromGradientMaterial.C
Go to the documentation of this file.
2 
4 
7 {
9 
10  params.addClassDescription("Computes a flux vector material property based on the gradient of a "
11  "coupled variable and a scalar diffusivity.");
12 
13  // Required name for the output flux property
14  params.addRequiredParam<MaterialPropertyName>("flux", "Name of the flux material property");
15 
16  // Coupled variable whose gradient is used
17  params.addRequiredCoupledVar("u", "Variable used to compute the flux");
18 
19  // Optional name for the diffusivity material property (default: 'diffusivity')
20  params.addParam<MaterialPropertyName>(
21  "diffusivity", "diffusivity", "The diffusivity material property name");
22 
23  return params;
24 }
25 
27  : Material(parameters),
28  _grad_u(adCoupledGradient("u")),
29  _diffusivity(getADMaterialProperty<Real>("diffusivity")),
30  _flux(declareADProperty<RealVectorValue>("flux"))
31 {
32 }
33 
34 void
36 {
38 }
registerMooseObject("MooseApp", ADFluxFromGradientMaterial)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
ADMaterialProperty< RealVectorValue > & _flux
Material property storing the flux vector.
unsigned int _qp
Definition: MaterialBase.h:333
static InputParameters validParams()
Definition: Material.C:14
static InputParameters validParams()
Material computing a diffusive flux from the gradient of a coupled variable.
const ADMaterialProperty< Real > & _diffusivity
Diffusivity.
Materials compute MaterialProperties.
Definition: Material.h:34
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
virtual void computeQpProperties() override
Users must override this method.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
ADFluxFromGradientMaterial(const InputParameters &parameters)
const ADVariableGradient & _grad_u
Gradient of the coupled variable.