LCOV - code coverage report
Current view: top level - src/userobjects - SolidMechanicsHardeningConstant.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 18 19 94.7 %
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 "SolidMechanicsHardeningConstant.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", SolidMechanicsHardeningConstant);
      13             : registerMooseObjectRenamed("SolidMechanicsApp",
      14             :                            TensorMechanicsHardeningConstant,
      15             :                            "01/01/2025 00:00",
      16             :                            SolidMechanicsHardeningConstant);
      17             : 
      18             : InputParameters
      19        8524 : SolidMechanicsHardeningConstant::validParams()
      20             : {
      21        8524 :   InputParameters params = SolidMechanicsHardeningModel::validParams();
      22       17048 :   params.addParam<Real>("value",
      23       17048 :                         1.0,
      24             :                         "The value of the parameter for all internal parameter.  "
      25             :                         "This is perfect plasticity - there is no hardening.");
      26       17048 :   params.addParam<bool>("convert_to_radians",
      27       17048 :                         false,
      28             :                         "If true, the value you entered will be "
      29             :                         "multiplied by Pi/180 before passing to the "
      30             :                         "Plasticity algorithms");
      31        8524 :   params.addClassDescription(
      32             :       "No hardening - the parameter is independent of the internal parameter(s)");
      33        8524 :   return params;
      34           0 : }
      35             : 
      36        4262 : SolidMechanicsHardeningConstant::SolidMechanicsHardeningConstant(const InputParameters & parameters)
      37             :   : SolidMechanicsHardeningModel(parameters),
      38       12786 :     _val(getParam<bool>("convert_to_radians") ? getParam<Real>("value") * libMesh::pi / 180.0
      39       15548 :                                               : getParam<Real>("value"))
      40             : {
      41        4262 : }
      42             : 
      43             : Real
      44    27412562 : SolidMechanicsHardeningConstant::value(Real /*intnl*/) const
      45             : {
      46    27412562 :   return _val;
      47             : }
      48             : 
      49             : Real
      50    10841928 : SolidMechanicsHardeningConstant::derivative(Real /*intnl*/) const
      51             : {
      52    10841928 :   return 0.0;
      53             : }
      54             : 
      55             : std::string
      56       31882 : SolidMechanicsHardeningConstant::modelName() const
      57             : {
      58       31882 :   return "Constant";
      59             : }

Generated by: LCOV version 1.14