LCOV - code coverage report
Current view: top level - src/userobjects - TensorMechanicsHardeningPowerRule.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 18 21 85.7 %
Date: 2024-02-27 11:53:14 Functions: 4 5 80.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 "TensorMechanicsHardeningPowerRule.h"
      11             : 
      12             : registerMooseObject("TensorMechanicsApp", TensorMechanicsHardeningPowerRule);
      13             : 
      14             : InputParameters
      15          60 : TensorMechanicsHardeningPowerRule::validParams()
      16             : {
      17          60 :   InputParameters params = TensorMechanicsHardeningModel::validParams();
      18         120 :   params.addRequiredParam<Real>("value_0", "The yield strength when internal variable = 0");
      19         120 :   params.addParam<Real>("epsilon0", 1.0, "The reference strain");
      20         120 :   params.addParam<Real>(
      21             :       "exponent",
      22         120 :       0.0,
      23             :       "Let p = internal_parameter.  Then value = value_0 * (p / epsilon0 + 1)^{exponent})");
      24          60 :   params.addClassDescription("Hardening defined by power rule");
      25          60 :   return params;
      26           0 : }
      27             : 
      28          30 : TensorMechanicsHardeningPowerRule::TensorMechanicsHardeningPowerRule(
      29          30 :     const InputParameters & parameters)
      30             :   : TensorMechanicsHardeningModel(parameters),
      31          30 :     _value_0(getParam<Real>("value_0")),
      32          60 :     _epsilon0(getParam<Real>("epsilon0")),
      33          90 :     _exponent(getParam<Real>("exponent"))
      34             : {
      35          30 : }
      36             : 
      37             : Real
      38    16052760 : TensorMechanicsHardeningPowerRule::value(Real intnl) const
      39             : {
      40    16052760 :   return _value_0 * std::pow(intnl / _epsilon0 + 1, _exponent);
      41             : }
      42             : 
      43             : Real
      44     9637042 : TensorMechanicsHardeningPowerRule::derivative(Real intnl) const
      45             : {
      46     9637042 :   return _value_0 * _exponent / _epsilon0 * std::pow(intnl / _epsilon0 + 1, _exponent - 1);
      47             : }
      48             : 
      49             : std::string
      50           0 : TensorMechanicsHardeningPowerRule::modelName() const
      51             : {
      52           0 :   return "PowerRule";
      53             : }

Generated by: LCOV version 1.14