www.mooseframework.org
ComputeElasticityTensorBase.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "Function.h"
12 
14 
15 InputParameters
17 {
18  InputParameters params = Material::validParams();
19  params.addParam<FunctionName>(
20  "elasticity_tensor_prefactor",
21  "Optional function to use as a scalar prefactor on the elasticity tensor.");
22  params.addParam<std::string>("base_name",
23  "Optional parameter that allows the user to define "
24  "multiple mechanics material systems on the same "
25  "block, i.e. for multiple phases");
26  return params;
27 }
28 
30  : DerivativeMaterialInterface<Material>(parameters),
31  GuaranteeProvider(this),
32  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
33  _elasticity_tensor_name(_base_name + "elasticity_tensor"),
34  _elasticity_tensor(declareProperty<RankFourTensor>(_elasticity_tensor_name)),
35  _effective_stiffness(declareProperty<Real>(_base_name + "effective_stiffness")),
36  _prefactor_function(isParamValid("elasticity_tensor_prefactor")
37  ? &getFunction("elasticity_tensor_prefactor")
38  : nullptr)
39 {
40 }
41 
42 void
44 {
45  _effective_stiffness[_qp] = 0; // Currently overriden by ComputeIsotropicElasticityTensor
47 
48  // Multiply by prefactor
50  {
51  _elasticity_tensor[_qp] *= _prefactor_function->value(_t, _q_point[_qp]);
52  _effective_stiffness[_qp] *= std::sqrt(_prefactor_function->value(_t, _q_point[_qp]));
53  }
54 }
ComputeElasticityTensorBase::ComputeElasticityTensorBase
ComputeElasticityTensorBase(const InputParameters &parameters)
Definition: ComputeElasticityTensorBase.C:29
GuaranteeProvider
Add-on class that provides the functionality to issue guarantees for declared material properties.
Definition: GuaranteeProvider.h:25
ComputeElasticityTensorBase::computeQpProperties
virtual void computeQpProperties()
Definition: ComputeElasticityTensorBase.C:43
ComputeElasticityTensorBase::_effective_stiffness
MaterialProperty< Real > & _effective_stiffness
Definition: ComputeElasticityTensorBase.h:41
ComputeElasticityTensorBase
ComputeElasticityTensorBase the base class for computing elasticity tensors.
Definition: ComputeElasticityTensorBase.h:25
ComputeElasticityTensorBase::computeQpElasticityTensor
virtual void computeQpElasticityTensor()=0
validParams
InputParameters validParams()
ComputeElasticityTensorBase::_elasticity_tensor
MaterialProperty< RankFourTensor > & _elasticity_tensor
Definition: ComputeElasticityTensorBase.h:40
RankFourTensorTempl< Real >
defineLegacyParams
defineLegacyParams(ComputeElasticityTensorBase)
ComputeElasticityTensorBase::validParams
static InputParameters validParams()
Definition: ComputeElasticityTensorBase.C:16
ComputeElasticityTensorBase::_prefactor_function
const Function *const _prefactor_function
prefactor function to multiply the elasticity tensor with
Definition: ComputeElasticityTensorBase.h:44
ComputeElasticityTensorBase.h