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 "ComputeLagrangianStressCustomPK2.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", ComputeLagrangianStressCustomPK2); 13 : 14 : InputParameters 15 0 : ComputeLagrangianStressCustomPK2::validParams() 16 : { 17 0 : InputParameters params = ComputeLagrangianStressPK1::validParams(); 18 0 : params.addRequiredParam<MaterialPropertyName>("custom_pk2_stress", "The name of the PK2 stress."); 19 0 : params.addRequiredParam<MaterialPropertyName>( 20 : "custom_pk2_jacobian", "The name of the PK2 Jacobian (w.r.t. the deformation gradient)."); 21 0 : return params; 22 0 : } 23 : 24 0 : ComputeLagrangianStressCustomPK2::ComputeLagrangianStressCustomPK2( 25 0 : const InputParameters & parameters) 26 : : ComputeLagrangianStressPK1(parameters), 27 0 : _pk2(getMaterialProperty<RankTwoTensor>("custom_pk2_stress")), 28 0 : _dpk2_dF(getMaterialProperty<RankFourTensor>("custom_pk2_jacobian")) 29 : { 30 0 : if (!_large_kinematics) 31 0 : paramError("large_kinematics", "This material requires large kinematics to be enabled."); 32 0 : } 33 : 34 : void 35 0 : ComputeLagrangianStressCustomPK2::computeQpPK1Stress() 36 : { 37 0 : _pk1_stress[_qp] = _F[_qp] * _pk2[_qp]; 38 : 39 : usingTensorIndices(i, j, k, l, m); 40 0 : _pk1_jacobian[_qp] = _F[_qp].times<i, m, m, j, k, l>(_dpk2_dF[_qp]); 41 0 : }