www.mooseframework.org
ComputeElasticityTensorBase.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 #include "Function.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Material>();
16  params.addParam<FunctionName>(
17  "elasticity_tensor_prefactor",
18  "Optional function to use as a scalar prefactor on the elasticity tensor.");
19  params.addParam<std::string>("base_name",
20  "Optional parameter that allows the user to define "
21  "multiple mechanics material systems on the same "
22  "block, i.e. for multiple phases");
23  return params;
24 }
25 
27  : DerivativeMaterialInterface<Material>(parameters),
28  GuaranteeProvider(this),
29  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
30  _elasticity_tensor_name(_base_name + "elasticity_tensor"),
31  _elasticity_tensor(declareProperty<RankFourTensor>(_elasticity_tensor_name)),
32  _prefactor_function(isParamValid("elasticity_tensor_prefactor")
33  ? &getFunction("elasticity_tensor_prefactor")
34  : NULL)
35 {
36 }
37 
38 void
40 {
42 
43  // Multiply by prefactor
45  _elasticity_tensor[_qp] *= _prefactor_function->value(_t, _q_point[_qp]);
46 }
Add-on class that provides the functionality to issue guarantees for declared material properties...
InputParameters validParams< ComputeElasticityTensorBase >()
Function *const _prefactor_function
prefactor function to multiply the elasticity tensor with
ComputeElasticityTensorBase(const InputParameters &parameters)
virtual void computeQpElasticityTensor()=0
MaterialProperty< RankFourTensor > & _elasticity_tensor