https://mooseframework.inl.gov
Loading...
Searching...
No Matches
GenericConstantRankTwoTensor.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
15template <bool is_ad>
18{
21 "Object for declaring a constant rank two tensor as a material property.");
22 params.addRequiredParam<std::vector<Real>>(
23 "tensor_values", "Vector of values defining the constant rank two tensor");
24 params.addRequiredParam<MaterialPropertyName>(
25 "tensor_name", "Name of the tensor material property to be created");
26 params.set<MooseEnum>("constant_on") = "SUBDOMAIN";
27 return params;
28}
29
30template <bool is_ad>
32 const InputParameters & parameters)
33 : Material(parameters),
34 _prop(
35 declareGenericProperty<RankTwoTensor, is_ad>(getParam<MaterialPropertyName>("tensor_name")))
36{
37 _tensor.fillFromInputVector(getParam<std::vector<Real>>("tensor_values"));
38}
39
40template <bool is_ad>
41void
46
47template <bool is_ad>
48void
53
registerMooseObject("MooseApp", GenericConstantRankTwoTensor)
Declares a constant material property of type RankTwoTensor.
GenericConstantRankTwoTensorTempl(const InputParameters &parameters)
virtual void initQpStatefulProperties() override
Initialize stateful properties at quadrature points.
virtual void computeQpProperties() override
Users must override this method.
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...
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.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Materials compute MaterialProperties.
Definition Material.h:36
static InputParameters validParams()
Definition Material.C:14
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition MooseBase.h:406
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
void fillFromInputVector(const std::vector< T > &input, FillMethod fill_method=autodetect)
The smart mutator that determines how to fill the second order tensor based on the size of the input ...