LCOV - code coverage report
Current view: top level - src/userobjects - TensorMechanicsHardeningExponential.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 20 21 95.2 %
Date: 2024-02-27 11:53:14 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://www.mooseframework.org
       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 "TensorMechanicsHardeningExponential.h"
      11             : 
      12             : registerMooseObject("TensorMechanicsApp", TensorMechanicsHardeningExponential);
      13             : 
      14             : InputParameters
      15         568 : TensorMechanicsHardeningExponential::validParams()
      16             : {
      17         568 :   InputParameters params = TensorMechanicsHardeningModel::validParams();
      18        1136 :   params.addRequiredParam<Real>("value_0", "The value of the parameter at internal_parameter = 0");
      19        1136 :   params.addParam<Real>("value_residual",
      20             :                         "The value of the parameter for internal_parameter = "
      21             :                         "infinity.  Default = value_0, ie perfect plasticity");
      22        1136 :   params.addParam<Real>("rate",
      23        1136 :                         0,
      24             :                         "Let p = internal_parameter.  Then value = value_residual + "
      25             :                         "(value_0 - value_residual)*exp(-rate*intnal_parameter)");
      26         568 :   params.addClassDescription("Hardening is Exponential");
      27         568 :   return params;
      28           0 : }
      29             : 
      30         284 : TensorMechanicsHardeningExponential::TensorMechanicsHardeningExponential(
      31         284 :     const InputParameters & parameters)
      32             :   : TensorMechanicsHardeningModel(parameters),
      33         284 :     _val_0(getParam<Real>("value_0")),
      34         852 :     _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
      35         852 :     _rate(getParam<Real>("rate"))
      36             : {
      37         284 : }
      38             : 
      39             : Real
      40     1032130 : TensorMechanicsHardeningExponential::value(Real intnl) const
      41             : {
      42     1032130 :   return _val_res + (_val_0 - _val_res) * std::exp(-_rate * intnl);
      43             : }
      44             : 
      45             : Real
      46      311198 : TensorMechanicsHardeningExponential::derivative(Real intnl) const
      47             : {
      48      311198 :   return -_rate * (_val_0 - _val_res) * std::exp(-_rate * intnl);
      49             : }
      50             : 
      51             : std::string
      52        1398 : TensorMechanicsHardeningExponential::modelName() const
      53             : {
      54        1398 :   return "Exponential";
      55             : }

Generated by: LCOV version 1.14