LCOV - code coverage report
Current view: top level - src/userobjects - TensorMechanicsHardeningCutExponential.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 0 28 0.0 %
Date: 2024-02-27 11:53:14 Functions: 0 5 0.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 "TensorMechanicsHardeningCutExponential.h"
      11             : 
      12             : registerMooseObject("TensorMechanicsApp", TensorMechanicsHardeningCutExponential);
      13             : 
      14             : InputParameters
      15           0 : TensorMechanicsHardeningCutExponential::validParams()
      16             : {
      17           0 :   InputParameters params = TensorMechanicsHardeningModel::validParams();
      18           0 :   params.addRequiredParam<Real>(
      19             :       "value_0", "The value of the parameter for all internal_parameter <= internal_0");
      20           0 :   params.addParam<Real>("value_residual",
      21             :                         "The value of the parameter for internal_parameter = "
      22             :                         "infinity.  Default = value_0, ie perfect plasticity");
      23           0 :   params.addParam<Real>("internal_0", 0, "The cutoff of internal parameter");
      24           0 :   params.addParam<Real>("rate",
      25           0 :                         0,
      26             :                         "Let p = internal_parameter.  Then value = value_0 for "
      27             :                         "p<internal_0, and otherwise, value = value_residual + (value_0 "
      28             :                         "- value_residual)*exp(-rate*(p - internal_0)");
      29           0 :   params.addClassDescription("Hardening is Cut-exponential");
      30           0 :   return params;
      31           0 : }
      32             : 
      33           0 : TensorMechanicsHardeningCutExponential::TensorMechanicsHardeningCutExponential(
      34           0 :     const InputParameters & parameters)
      35             :   : TensorMechanicsHardeningModel(parameters),
      36           0 :     _val_0(getParam<Real>("value_0")),
      37           0 :     _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
      38           0 :     _intnl_0(getParam<Real>("internal_0")),
      39           0 :     _rate(getParam<Real>("rate"))
      40             : {
      41           0 : }
      42             : 
      43             : Real
      44           0 : TensorMechanicsHardeningCutExponential::value(Real intnl) const
      45             : {
      46           0 :   Real x = intnl - _intnl_0;
      47           0 :   if (x <= 0)
      48           0 :     return _val_0;
      49             :   else
      50           0 :     return _val_res + (_val_0 - _val_res) * std::exp(-_rate * x);
      51             : }
      52             : 
      53             : Real
      54           0 : TensorMechanicsHardeningCutExponential::derivative(Real intnl) const
      55             : {
      56           0 :   Real x = intnl - _intnl_0;
      57           0 :   if (x <= 0)
      58             :     return 0;
      59             :   else
      60           0 :     return -_rate * (_val_0 - _val_res) * std::exp(-_rate * x);
      61             : }
      62             : 
      63             : std::string
      64           0 : TensorMechanicsHardeningCutExponential::modelName() const
      65             : {
      66           0 :   return "CutExponential";
      67             : }

Generated by: LCOV version 1.14