LCOV - code coverage report
Current view: top level - src/userobjects - HEVPRambergOsgoodHardening.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 20 21 95.2 %
Date: 2025-07-25 05:00:39 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 "HEVPRambergOsgoodHardening.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", HEVPRambergOsgoodHardening);
      13             : 
      14             : InputParameters
      15          48 : HEVPRambergOsgoodHardening::validParams()
      16             : {
      17          48 :   InputParameters params = HEVPStrengthUOBase::validParams();
      18          96 :   params.addParam<Real>("yield_stress", "Yield strength");
      19          96 :   params.addRequiredParam<Real>("reference_plastic_strain", "Reference plastic strain value");
      20          96 :   params.addRequiredParam<Real>("hardening_exponent", "The hardening exponent value");
      21          48 :   params.addClassDescription("User object for Ramberg-Osgood hardening power law hardening");
      22             : 
      23          48 :   return params;
      24           0 : }
      25             : 
      26          24 : HEVPRambergOsgoodHardening::HEVPRambergOsgoodHardening(const InputParameters & parameters)
      27             :   : HEVPStrengthUOBase(parameters),
      28          24 :     _sig0(getParam<Real>("yield_stress")),
      29          48 :     _peeq0(getParam<Real>("reference_plastic_strain")),
      30          72 :     _exponent(getParam<Real>("hardening_exponent"))
      31             : {
      32          24 : }
      33             : 
      34             : bool
      35      855680 : HEVPRambergOsgoodHardening::computeValue(unsigned int qp, Real & val) const
      36             : {
      37      855680 :   val = _sig0 * std::pow(_intvar[qp] / _peeq0 + 1.0, _exponent);
      38      855680 :   return true;
      39             : }
      40             : 
      41             : bool
      42     1073216 : HEVPRambergOsgoodHardening::computeDerivative(unsigned int qp,
      43             :                                               const std::string & coupled_var_name,
      44             :                                               Real & val) const
      45             : {
      46     1073216 :   val = 0;
      47             : 
      48     1073216 :   if (_intvar_prop_name == coupled_var_name)
      49      711616 :     val = _sig0 * _exponent / _peeq0 * std::pow(_intvar[qp] / _peeq0 + 1.0, _exponent - 1.0);
      50             : 
      51     1073216 :   return true;
      52             : }

Generated by: LCOV version 1.14