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 "TotalLagrangianWeakPlaneStress.h" 11 : 12 : registerMooseObject("SolidMechanicsApp", TotalLagrangianWeakPlaneStress); 13 : 14 : InputParameters 15 32 : TotalLagrangianWeakPlaneStress::validParams() 16 : { 17 32 : InputParameters params = TotalLagrangianStressDivergence::validParams(); 18 32 : params.addClassDescription("Plane stress kernel to provide out-of-plane strain contribution."); 19 32 : params.set<unsigned int>("component") = 0; 20 32 : params.suppressParameter<unsigned int>("component"); 21 32 : params.suppressParameter<std::vector<VariableName>>("temperature"); 22 32 : params.suppressParameter<std::vector<MaterialPropertyName>>("eigenstrain_names"); 23 32 : params.suppressParameter<std::vector<VariableName>>("out_of_plane_strain"); 24 32 : return params; 25 0 : } 26 : 27 16 : TotalLagrangianWeakPlaneStress::TotalLagrangianWeakPlaneStress(const InputParameters & parameters) 28 16 : : TotalLagrangianStressDivergence(parameters) 29 : { 30 16 : } 31 : 32 : Real 33 313312 : TotalLagrangianWeakPlaneStress::computeQpResidual() 34 : { 35 313312 : return _test[_i][_qp] * _pk1[_qp](2, 2); 36 : } 37 : 38 : Real 39 42944 : TotalLagrangianWeakPlaneStress::computeQpJacobian() 40 : { 41 : // Diagonal Jacobian: d(R_zz)/d(strain_zz_j) = test * d(PK1_{2,2})/d(strain_zz_j). 42 : // strain_zz feeds `_F[(2,2)]` AFTER F-bar runs, so strain_zz perturbations bypass 43 : // F-bar's chain. Use `_dpk1_bypass_fbar` (pk1_jacobian with the F-bar 44 : // `_d_F_stab_d_F_ust` factor REPLACED by identity in the sigma chain) for consistency. 45 42944 : return _test[_i][_qp] * _dpk1_bypass_fbar[_qp](2, 2, 2, 2) * _phi[_j][_qp]; 46 : } 47 : 48 : Real 49 85888 : TotalLagrangianWeakPlaneStress::computeQpOffDiagJacobian(unsigned int jvar) 50 : { 51 128832 : for (auto beta : make_range(_ndisp)) 52 128832 : if (jvar == _disp_nums[beta]) 53 : { 54 : // Local PK1_{2,2} Jacobian via _dpk1 (includes local F-bar through the sigma chain). 55 : // Displacement perturbations DO go through F-bar's chain, so use the regular 56 : // `_dpk1` (= pk1_jacobian WITH the F-bar local correction). 57 85888 : Real J = _test[_i][_qp] * _dpk1[_qp].contractionIj(2, 2, gradTrial(beta)); 58 : 59 : // Non-local F-bar contribution to PK1_{2,2}; helper handles the sigma-via-dL chain and 60 : // the wrap branch. Guarded on `_stabilize_strain` because `_avg_grad_trial` is only 61 : // populated when F-bar is on. 62 85888 : if (_stabilize_strain) 63 : { 64 44928 : const RankTwoTensor delta_F_avg = _d_F_d_grad_u[_qp] * _avg_grad_trial[beta][_j]; 65 44928 : J += _test[_i][_qp] * deltaPK1NonLocalFBar(delta_F_avg)(2, 2); 66 : } 67 : return J; 68 : } 69 : 70 : return 0; 71 : }