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 "VolumeDeformGradCorrectedStress.h" 11 : 12 : registerMooseObject("TensorMechanicsApp", VolumeDeformGradCorrectedStress); 13 : 14 : InputParameters 15 24 : VolumeDeformGradCorrectedStress::validParams() 16 : { 17 24 : InputParameters params = Material::validParams(); 18 24 : params.addClassDescription( 19 : "Transforms stress with volumetric term from previous configuration to this configuration"); 20 48 : params.addRequiredParam<MaterialPropertyName>("pre_stress_name", 21 : "Name of stress variable from previous config."); 22 48 : params.addRequiredParam<MaterialPropertyName>("deform_grad_name", 23 : "Name of deformation gradient variable"); 24 48 : params.addParam<MaterialPropertyName>("pre_jacobian_name", 25 : "Name of Jacobian variable from previous config."); 26 48 : params.addRequiredParam<MaterialPropertyName>("stress_name", "Name of stress variable"); 27 48 : params.addParam<MaterialPropertyName>("jacobian_name", "Name of Jacobian variable"); 28 24 : return params; 29 0 : } 30 : 31 18 : VolumeDeformGradCorrectedStress::VolumeDeformGradCorrectedStress(const InputParameters & parameters) 32 : : DerivativeMaterialInterface<Material>(parameters), 33 18 : _pre_stress(getMaterialProperty<RankTwoTensor>("pre_stress_name")), 34 36 : _deformation_gradient(getMaterialProperty<RankTwoTensor>("deform_grad_name")), 35 18 : _pre_Jacobian_mult(isParamValid("pre_jacobian_name") 36 54 : ? &getMaterialProperty<RankFourTensor>("pre_jacobian_name") 37 : : nullptr), 38 36 : _stress(declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("stress_name"))), 39 18 : _Jacobian_mult( 40 18 : isParamValid("jacobian_name") 41 54 : ? &declareProperty<RankFourTensor>(getParam<MaterialPropertyName>("jacobian_name")) 42 18 : : nullptr) 43 : { 44 18 : } 45 : 46 : void 47 64 : VolumeDeformGradCorrectedStress::initQpStatefulProperties() 48 : { 49 64 : _stress[_qp] = _pre_stress[_qp]; 50 64 : } 51 : 52 : void 53 8000 : VolumeDeformGradCorrectedStress::computeQpProperties() 54 : { 55 8000 : computeQpStress(); 56 8000 : } 57 : 58 : void 59 8000 : VolumeDeformGradCorrectedStress::computeQpStress() 60 : { 61 8000 : _stress[_qp] = _deformation_gradient[_qp] * _pre_stress[_qp] * 62 8000 : _deformation_gradient[_qp].transpose() / _deformation_gradient[_qp].det(); 63 : 64 8000 : if (_Jacobian_mult && _pre_Jacobian_mult) 65 8000 : (*_Jacobian_mult)[_qp] = (*_pre_Jacobian_mult)[_qp]; 66 8000 : }