LCOV - code coverage report
Current view: top level - src/materials/lagrangian - ComputeLagrangianStressPK2.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 20 20 100.0 %
Date: 2025-07-25 05:00:39 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         296 : ComputeLagrangianStressPK2::validParams()
      14             : {
      15         296 :   InputParameters params = ComputeLagrangianStressPK1::validParams();
      16         296 :   return params;
      17             : }
      18             : 
      19         222 : ComputeLagrangianStressPK2::ComputeLagrangianStressPK2(const InputParameters & parameters)
      20             :   : ComputeLagrangianStressPK1(parameters),
      21         222 :     _E(declareProperty<RankTwoTensor>(_base_name + "green_lagrange_strain")),
      22         222 :     _S(declareProperty<RankTwoTensor>(_base_name + "pk2_stress")),
      23         444 :     _C(declareProperty<RankFourTensor>(_base_name + "pk2_jacobian"))
      24             : {
      25         222 : }
      26             : 
      27             : void
      28     8208064 : ComputeLagrangianStressPK2::computeQpPK1Stress()
      29             : {
      30             :   // Calculate the green-lagrange strain for the benefit of the subclasses
      31     8208064 :   _E[_qp] = 0.5 * (_F[_qp].transpose() * _F[_qp] - RankTwoTensor::Identity());
      32             : 
      33             :   // PK2 update
      34     8208064 :   computeQpPK2Stress();
      35             : 
      36             :   // Complicated wrapping, see documentation
      37     8208064 :   if (_large_kinematics)
      38             :   {
      39     4312256 :     _pk1_stress[_qp] = _F[_qp] * _S[_qp];
      40             :     usingTensorIndices(i_, j_, k_, l_);
      41             :     RankFourTensor dE =
      42     4312256 :         0.5 * (RankTwoTensor::Identity().times<i_, l_, j_, k_>(_F[_qp].transpose()) +
      43    12936768 :                _F[_qp].transpose().times<i_, k_, j_, l_>(RankTwoTensor::Identity()));
      44             : 
      45     8624512 :     _pk1_jacobian[_qp] = RankTwoTensor::Identity().times<i_, k_, j_, l_>(_S[_qp].transpose()) +
      46     8624512 :                          (_C[_qp] * dE).singleProductI(_F[_qp]);
      47             :   }
      48             :   // Small deformations all are equivalent
      49             :   else
      50             :   {
      51     3895808 :     _pk1_stress[_qp] = _S[_qp];
      52     3895808 :     _pk1_jacobian[_qp] = _C[_qp];
      53             :   }
      54     8208064 : }

Generated by: LCOV version 1.14