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

Generated by: LCOV version 1.14