www.mooseframework.org
ThermalFractureIntegral.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 "RankTwoTensor.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Material>();
16  params.addClassDescription(
17  "Calculates summation of the derivative of the eigenstrains with respect to temparture.");
18  params.addRequiredCoupledVar("temperature", "Coupled temperature");
19  params.addParam<std::vector<MaterialPropertyName>>(
20  "eigenstrain_names", "List of eigenstrains to be applied in this strain calculation");
21  return params;
22 }
23 
24 ThermalFractureIntegral::ThermalFractureIntegral(const InputParameters & parameters)
25  : DerivativeMaterialInterface<Material>(parameters),
26  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
27  _eigenstrain_names(getParam<std::vector<MaterialPropertyName>>("eigenstrain_names")),
28  _deigenstrain_dT(_eigenstrain_names.size()),
29  _total_deigenstrain_dT(declareProperty<RankTwoTensor>("total_deigenstrain_dT"))
30 {
31  // Get the materials containing the derivatives of the eigenstrains wrt temperature
32  VariableName temp_name = getVar("temperature", 0)->name();
33  if (_eigenstrain_names.size() == 0)
34  mooseWarning("No 'eigenstrain_names' specified for ThermalFractureIntegral when 'temperature' "
35  "is specified");
36 
37  for (unsigned int i = 0; i < _deigenstrain_dT.size(); ++i)
38  _deigenstrain_dT[i] = &getMaterialPropertyDerivative<RankTwoTensor>(
39  _base_name + _eigenstrain_names[i], temp_name);
40 }
41 
42 void
44 {
45  _total_deigenstrain_dT[_qp] = ((*_deigenstrain_dT[0])[_qp]);
46  for (unsigned int i = 1; i < _deigenstrain_dT.size(); ++i)
47  _total_deigenstrain_dT[_qp] += (*_deigenstrain_dT[i])[_qp];
48 }
MaterialProperty< RankTwoTensor > & _total_deigenstrain_dT
virtual void computeQpProperties() override
InputParameters validParams< ThermalFractureIntegral >()
const std::vector< MaterialPropertyName > _eigenstrain_names
ThermalFractureIntegral(const InputParameters &parameters)
std::vector< const MaterialProperty< RankTwoTensor > * > _deigenstrain_dT