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