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