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