LCOV - code coverage report
Current view: top level - src/userobjects - SolidMechanicsHardeningExponential.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 20 21 95.2 %
Date: 2025-09-04 07:57:23 Functions: 5 5 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 "SolidMechanicsHardeningExponential.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", SolidMechanicsHardeningExponential);
      13             : registerMooseObjectRenamed("SolidMechanicsApp",
      14             :                            TensorMechanicsHardeningExponential,
      15             :                            "01/01/2025 00:00",
      16             :                            SolidMechanicsHardeningExponential);
      17             : 
      18             : InputParameters
      19        1198 : SolidMechanicsHardeningExponential::validParams()
      20             : {
      21        1198 :   InputParameters params = SolidMechanicsHardeningModel::validParams();
      22        2396 :   params.addRequiredParam<Real>("value_0", "The value of the parameter at internal_parameter = 0");
      23        2396 :   params.addParam<Real>("value_residual",
      24             :                         "The value of the parameter for internal_parameter = "
      25             :                         "infinity.  Default = value_0, ie perfect plasticity");
      26        2396 :   params.addParam<Real>("rate",
      27        2396 :                         0,
      28             :                         "Let p = internal_parameter.  Then value = value_residual + "
      29             :                         "(value_0 - value_residual)*exp(-rate*intnal_parameter)");
      30        1198 :   params.addClassDescription("Hardening is Exponential");
      31        1198 :   return params;
      32           0 : }
      33             : 
      34         599 : SolidMechanicsHardeningExponential::SolidMechanicsHardeningExponential(
      35         599 :     const InputParameters & parameters)
      36             :   : SolidMechanicsHardeningModel(parameters),
      37         599 :     _val_0(getParam<Real>("value_0")),
      38        1797 :     _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
      39        1797 :     _rate(getParam<Real>("rate"))
      40             : {
      41         599 : }
      42             : 
      43             : Real
      44     2366701 : SolidMechanicsHardeningExponential::value(Real intnl) const
      45             : {
      46     2366701 :   return _val_res + (_val_0 - _val_res) * std::exp(-_rate * intnl);
      47             : }
      48             : 
      49             : Real
      50      694780 : SolidMechanicsHardeningExponential::derivative(Real intnl) const
      51             : {
      52      694780 :   return -_rate * (_val_0 - _val_res) * std::exp(-_rate * intnl);
      53             : }
      54             : 
      55             : std::string
      56        3559 : SolidMechanicsHardeningExponential::modelName() const
      57             : {
      58        3559 :   return "Exponential";
      59             : }

Generated by: LCOV version 1.14