LCOV - code coverage report
Current view: top level - src/materials/lagrangian - ComputeLagrangianStressPK2.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 20 20 100.0 %
Date: 2025-09-04 07:57:23 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          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 "ComputeLagrangianStressPK2.h"
      11             : 
      12             : InputParameters
      13         328 : ComputeLagrangianStressPK2::validParams()
      14             : {
      15         328 :   InputParameters params = ComputeLagrangianStressPK1::validParams();
      16         328 :   return params;
      17             : }
      18             : 
      19         246 : ComputeLagrangianStressPK2::ComputeLagrangianStressPK2(const InputParameters & parameters)
      20             :   : ComputeLagrangianStressPK1(parameters),
      21         246 :     _E(declareProperty<RankTwoTensor>(_base_name + "green_lagrange_strain")),
      22         246 :     _S(declareProperty<RankTwoTensor>(_base_name + "pk2_stress")),
      23         492 :     _C(declareProperty<RankFourTensor>(_base_name + "pk2_jacobian"))
      24             : {
      25         246 : }
      26             : 
      27             : void
      28     8321736 : ComputeLagrangianStressPK2::computeQpPK1Stress()
      29             : {
      30             :   // Calculate the green-lagrange strain for the benefit of the subclasses
      31     8321736 :   _E[_qp] = 0.5 * (_F[_qp].transpose() * _F[_qp] - RankTwoTensor::Identity());
      32             : 
      33             :   // PK2 update
      34     8321736 :   computeQpPK2Stress();
      35             : 
      36             :   // Complicated wrapping, see documentation
      37     8321736 :   if (_large_kinematics)
      38             :   {
      39     4425688 :     _pk1_stress[_qp] = _F[_qp] * _S[_qp];
      40             :     usingTensorIndices(i_, j_, k_, l_);
      41             :     RankFourTensor dE =
      42     4425688 :         0.5 * (RankTwoTensor::Identity().times<i_, l_, j_, k_>(_F[_qp].transpose()) +
      43    13277064 :                _F[_qp].transpose().times<i_, k_, j_, l_>(RankTwoTensor::Identity()));
      44             : 
      45     8851376 :     _pk1_jacobian[_qp] = RankTwoTensor::Identity().times<i_, k_, j_, l_>(_S[_qp].transpose()) +
      46     8851376 :                          (_C[_qp] * dE).singleProductI(_F[_qp]);
      47             :   }
      48             :   // Small deformations all are equivalent
      49             :   else
      50             :   {
      51     3896048 :     _pk1_stress[_qp] = _S[_qp];
      52     3896048 :     _pk1_jacobian[_qp] = _C[_qp];
      53             :   }
      54     8321736 : }

Generated by: LCOV version 1.14