LCOV - code coverage report
Current view: top level - src/materials - AbruptSoftening.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 14 17 82.4 %
Date: 2025-07-25 05:00:39 Functions: 3 3 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 "AbruptSoftening.h"
      11             : 
      12             : #include "MooseMesh.h"
      13             : 
      14             : registerMooseObject("SolidMechanicsApp", AbruptSoftening);
      15             : 
      16             : InputParameters
      17         106 : AbruptSoftening::validParams()
      18             : {
      19         106 :   InputParameters params = SmearedCrackSofteningBase::validParams();
      20         106 :   params.addClassDescription("Softening model with an abrupt stress release upon cracking. This "
      21             :                              "class is intended to be used with ComputeSmearedCrackingStress.");
      22         318 :   params.addRangeCheckedParam<Real>(
      23             :       "residual_stress",
      24         212 :       0.0,
      25             :       "residual_stress <= 1 & residual_stress >= 0",
      26             :       "The fraction of the cracking stress allowed to be maintained following a crack.");
      27         106 :   return params;
      28           0 : }
      29             : 
      30          78 : AbruptSoftening::AbruptSoftening(const InputParameters & parameters)
      31         156 :   : SmearedCrackSofteningBase(parameters), _residual_stress(getParam<Real>("residual_stress"))
      32             : {
      33          78 : }
      34             : 
      35             : void
      36        7536 : AbruptSoftening::computeCrackingRelease(Real & stress,
      37             :                                         Real & stiffness_ratio,
      38             :                                         const Real /*strain*/,
      39             :                                         const Real crack_initiation_strain,
      40             :                                         const Real crack_max_strain,
      41             :                                         const Real cracking_stress,
      42             :                                         const Real youngs_modulus)
      43             : {
      44        7536 :   if (_residual_stress == 0.0)
      45             :   {
      46             :     const Real tiny = 1.e-16;
      47        7536 :     stiffness_ratio = tiny;
      48        7536 :     stress = tiny * crack_initiation_strain * youngs_modulus;
      49             :   }
      50             :   else
      51             :   {
      52           0 :     stress = _residual_stress * cracking_stress;
      53           0 :     stiffness_ratio = stress / (crack_max_strain * youngs_modulus);
      54             :   }
      55        7536 : }

Generated by: LCOV version 1.14