LCOV - code coverage report
Current view: top level - src/materials/lagrangian - ComputeLagrangianStressCustomPK2.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #33187 (5aa0b2) with base d7c4bd Lines: 15 17 88.2 %
Date: 2026-06-30 12:24:09 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 "ComputeLagrangianStressCustomPK2.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", ComputeLagrangianStressCustomPK2);
      13             : 
      14             : InputParameters
      15          40 : ComputeLagrangianStressCustomPK2::validParams()
      16             : {
      17          40 :   InputParameters params = ComputeLagrangianStressPK1::validParams();
      18          80 :   params.addRequiredParam<MaterialPropertyName>("custom_pk2_stress", "The name of the PK2 stress.");
      19          80 :   params.addRequiredParam<MaterialPropertyName>(
      20             :       "custom_pk2_jacobian", "The name of the PK2 Jacobian (w.r.t. the deformation gradient).");
      21          40 :   return params;
      22           0 : }
      23             : 
      24          30 : ComputeLagrangianStressCustomPK2::ComputeLagrangianStressCustomPK2(
      25          30 :     const InputParameters & parameters)
      26             :   : ComputeLagrangianStressPK1(parameters),
      27          30 :     _pk2(getMaterialProperty<RankTwoTensor>("custom_pk2_stress")),
      28          90 :     _dpk2_dF(getMaterialProperty<RankFourTensor>("custom_pk2_jacobian"))
      29             : {
      30          30 :   if (!_large_kinematics)
      31           0 :     paramError("large_kinematics", "This material requires large kinematics to be enabled.");
      32          30 : }
      33             : 
      34             : void
      35       12480 : ComputeLagrangianStressCustomPK2::computeQpPK1Stress()
      36             : {
      37       12480 :   _pk1_stress[_qp] = _F[_qp] * _pk2[_qp];
      38             : 
      39             :   usingTensorIndices(i, j, k, l, m);
      40       12480 :   _pk1_jacobian[_qp] = _F[_qp].times<i, m, m, j, k, l>(_dpk2_dF[_qp]);
      41       12480 : }

Generated by: LCOV version 1.14