https://mooseframework.inl.gov
VectorFromComponentVariablesMaterial.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("Computes a vector material property from coupled variables");
21  params.addRequiredParam<MaterialPropertyName>(
22  "vector_prop_name", "The name to give the declared vector material property");
23  params.addRequiredCoupledVar("u", "x-component");
24  params.addCoupledVar("v", 0, "y-component");
25  params.addCoupledVar("w", 0, "z-component");
26  return params;
27 }
28 
29 template <bool is_ad>
31  const InputParameters & parameters)
32  : Material(parameters),
33  _vector(declareGenericProperty<RealVectorValue, is_ad>("vector_prop_name")),
34  _u(coupledGenericValue<is_ad>("u")),
35  _v(isCoupled("v") ? coupledGenericValue<is_ad>("v") : genericZeroValue<is_ad>()),
36  _w(isCoupled("w") ? coupledGenericValue<is_ad>("w") : genericZeroValue<is_ad>())
37 {
38 }
39 
40 template <bool is_ad>
41 void
43 {
44  _vector[_qp] = GenericRealVectorValue<is_ad>{_u[_qp], _v[_qp], _w[_qp]};
45 }
46 
VectorFromComponentVariablesMaterialTempl(const InputParameters &parameters)
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...
static InputParameters validParams()
Definition: Material.C:14
Moose::GenericType< RealVectorValue, is_ad > GenericRealVectorValue
Definition: MooseTypes.h:652
registerMooseObject("MooseApp", VectorFromComponentVariablesMaterial)
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
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.
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...
Computes a vector material property from coupled variables.
virtual void computeQpProperties() override
Users must override this method.