LCOV - code coverage report
Current view: top level - src/userobjects - SolidMechanicsHardeningConstant.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 18 19 94.7 %
Date: 2025-09-04 07:57:23 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        9386 : SolidMechanicsHardeningConstant::validParams()
      20             : {
      21        9386 :   InputParameters params = SolidMechanicsHardeningModel::validParams();
      22       18772 :   params.addParam<Real>("value",
      23       18772 :                         1.0,
      24             :                         "The value of the parameter for all internal parameter.  "
      25             :                         "This is perfect plasticity - there is no hardening.");
      26       18772 :   params.addParam<bool>("convert_to_radians",
      27       18772 :                         false,
      28             :                         "If true, the value you entered will be "
      29             :                         "multiplied by Pi/180 before passing to the "
      30             :                         "Plasticity algorithms");
      31        9386 :   params.addClassDescription(
      32             :       "No hardening - the parameter is independent of the internal parameter(s)");
      33        9386 :   return params;
      34           0 : }
      35             : 
      36        4693 : SolidMechanicsHardeningConstant::SolidMechanicsHardeningConstant(const InputParameters & parameters)
      37             :   : SolidMechanicsHardeningModel(parameters),
      38       14079 :     _val(getParam<bool>("convert_to_radians") ? getParam<Real>("value") * libMesh::pi / 180.0
      39       17126 :                                               : getParam<Real>("value"))
      40             : {
      41        4693 : }
      42             : 
      43             : Real
      44    35018049 : SolidMechanicsHardeningConstant::value(Real /*intnl*/) const
      45             : {
      46    35018049 :   return _val;
      47             : }
      48             : 
      49             : Real
      50    13699664 : SolidMechanicsHardeningConstant::derivative(Real /*intnl*/) const
      51             : {
      52    13699664 :   return 0.0;
      53             : }
      54             : 
      55             : std::string
      56       45539 : SolidMechanicsHardeningConstant::modelName() const
      57             : {
      58       45539 :   return "Constant";
      59             : }

Generated by: LCOV version 1.14