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 "GBRelaxationStrainIncrement.h" 11 : #include "libmesh/quadrature.h" 12 : 13 : registerMooseObject("SolidMechanicsApp", GBRelaxationStrainIncrement); 14 : 15 : InputParameters 16 0 : GBRelaxationStrainIncrement::validParams() 17 : { 18 0 : InputParameters params = Material::validParams(); 19 0 : params.addClassDescription( 20 : "Compute strain increment based on lattice relaxation at grain boundaries"); 21 0 : params.addParam<MaterialPropertyName>("prefactor_name", "Name of prefactor property"); 22 0 : params.addParam<MaterialPropertyName>("gb_normal_name", "Name of GB normal property"); 23 0 : params.addParam<MaterialPropertyName>("property_name", 24 : "Name of GB relaxation strain increment property"); 25 0 : return params; 26 0 : } 27 : 28 0 : GBRelaxationStrainIncrement::GBRelaxationStrainIncrement(const InputParameters & parameters) 29 : : DerivativeMaterialInterface<Material>(parameters), 30 0 : _prefactor(getMaterialProperty<Real>("prefactor_name")), 31 0 : _gb_normal_tensor(getMaterialProperty<RankTwoTensor>("gb_normal_name")), 32 0 : _strain_increment( 33 0 : declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("property_name"))) 34 : { 35 0 : } 36 : 37 : void 38 0 : GBRelaxationStrainIncrement::initQpStatefulProperties() 39 : { 40 0 : _strain_increment[_qp].zero(); 41 0 : } 42 : 43 : void 44 0 : GBRelaxationStrainIncrement::computeQpProperties() 45 : { 46 0 : _strain_increment[_qp] = _prefactor[_qp] * _dt * _gb_normal_tensor[_qp]; 47 0 : }