LCOV - code coverage report
Current view: top level - src/userobjects - HEVPLinearHardening.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 18 19 94.7 %
Date: 2025-09-04 07:57:23 Functions: 4 4 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 "HEVPLinearHardening.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", HEVPLinearHardening);
      13             : 
      14             : InputParameters
      15          14 : HEVPLinearHardening::validParams()
      16             : {
      17          14 :   InputParameters params = HEVPStrengthUOBase::validParams();
      18          28 :   params.addParam<Real>("yield_stress", "Yield strength");
      19          28 :   params.addParam<Real>("slope", "Linear hardening slope");
      20          14 :   params.addClassDescription("User Object for linear hardening");
      21          14 :   return params;
      22           0 : }
      23             : 
      24           7 : HEVPLinearHardening::HEVPLinearHardening(const InputParameters & parameters)
      25             :   : HEVPStrengthUOBase(parameters),
      26           7 :     _sig0(getParam<Real>("yield_stress")),
      27          21 :     _slope(getParam<Real>("slope"))
      28             : {
      29           7 : }
      30             : 
      31             : bool
      32      273312 : HEVPLinearHardening::computeValue(unsigned int qp, Real & val) const
      33             : {
      34      273312 :   val = _sig0 + _slope * _intvar[qp];
      35      273312 :   return true;
      36             : }
      37             : 
      38             : bool
      39      227432 : HEVPLinearHardening::computeDerivative(unsigned int /*qp*/,
      40             :                                        const std::string & coupled_var_name,
      41             :                                        Real & val) const
      42             : {
      43      227432 :   val = 0;
      44             : 
      45      227432 :   if (_intvar_prop_name == coupled_var_name)
      46      227432 :     val = _slope;
      47             : 
      48      227432 :   return true;
      49             : }

Generated by: LCOV version 1.14