LCOV - code coverage report
Current view: top level - src/userobjects - SolidMechanicsHardeningExponential.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: 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        1136 : SolidMechanicsHardeningExponential::validParams()
      20             : {
      21        1136 :   InputParameters params = SolidMechanicsHardeningModel::validParams();
      22        2272 :   params.addRequiredParam<Real>("value_0", "The value of the parameter at internal_parameter = 0");
      23        2272 :   params.addParam<Real>("value_residual",
      24             :                         "The value of the parameter for internal_parameter = "
      25             :                         "infinity.  Default = value_0, ie perfect plasticity");
      26        2272 :   params.addParam<Real>("rate",
      27        2272 :                         0,
      28             :                         "Let p = internal_parameter.  Then value = value_residual + "
      29             :                         "(value_0 - value_residual)*exp(-rate*intnal_parameter)");
      30        1136 :   params.addClassDescription("Hardening is Exponential");
      31        1136 :   return params;
      32           0 : }
      33             : 
      34         568 : SolidMechanicsHardeningExponential::SolidMechanicsHardeningExponential(
      35         568 :     const InputParameters & parameters)
      36             :   : SolidMechanicsHardeningModel(parameters),
      37         568 :     _val_0(getParam<Real>("value_0")),
      38        1704 :     _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
      39        1704 :     _rate(getParam<Real>("rate"))
      40             : {
      41         568 : }
      42             : 
      43             : Real
      44     2018420 : SolidMechanicsHardeningExponential::value(Real intnl) const
      45             : {
      46     2018420 :   return _val_res + (_val_0 - _val_res) * std::exp(-_rate * intnl);
      47             : }
      48             : 
      49             : Real
      50      609436 : SolidMechanicsHardeningExponential::derivative(Real intnl) const
      51             : {
      52      609436 :   return -_rate * (_val_0 - _val_res) * std::exp(-_rate * intnl);
      53             : }
      54             : 
      55             : std::string
      56        2796 : SolidMechanicsHardeningExponential::modelName() const
      57             : {
      58        2796 :   return "Exponential";
      59             : }

Generated by: LCOV version 1.14