https://mooseframework.inl.gov
CoupledGradientMaterial.C
Go to the documentation of this file.
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 
11 
14 
15 template <bool is_ad>
18 {
20  params.addClassDescription("Creates a gradient material equal to the gradient of the coupled "
21  "variable times a scalar material property.");
22  params.addRequiredParam<MaterialPropertyName>(
23  "grad_mat_prop",
24  "Name of gradient material property equal to the gradient of the coupled variable gradient "
25  "times the scalar.");
26  params.deprecateParam("grad_mat_prop", "gradient_material_name", "12/12/25");
27  params.addParam<MaterialPropertyName>(
28  "scalar_property_factor",
29  1.0,
30  "Scalar material property acting as a factor in the output gradient material property.");
31  params.addRequiredCoupledVar("u", "The coupled variable to take the gradient of");
32  params.deprecateCoupledVar("u", "coupled_variable", "12/12/25");
33  return params;
34 }
35 
36 template <bool is_ad>
38  const InputParameters & parameters)
39  : Material(parameters),
40  _grad_mat_prop(declareGenericProperty<RealVectorValue, is_ad>("grad_mat_prop")),
41  _scalar_property_factor(getGenericMaterialProperty<Real, is_ad>("scalar_property_factor")),
42  _grad_u(coupledGenericGradient<is_ad>("u"))
43 {
44 }
45 
46 template <bool is_ad>
47 void
49 {
50  _grad_mat_prop[_qp] = _grad_u[_qp] * _scalar_property_factor[_qp];
51 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
A material that creates a gradient material equal to the gradient of the coupled variable times a sca...
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...
static InputParameters validParams()
Definition: Material.C:14
void deprecateParam(const std::string &old_name, const std::string &new_name, const std::string &removal_date)
virtual void computeQpProperties() override
Users must override this method.
void deprecateCoupledVar(const std::string &old_name, const std::string &new_name, const std::string &removal_date)
static InputParameters validParams()
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("MooseApp", CoupledGradientMaterial)
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...
CoupledGradientMaterialTempl(const InputParameters &parameters)