LCOV - code coverage report
Current view: top level - src/materials - AbruptSoftening.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #32971 (54bef8) with base c6cf66 Lines: 14 17 82.4 %
Date: 2026-05-29 20:40:07 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          69 : AbruptSoftening::validParams()
      18             : {
      19          69 :   InputParameters params = SmearedCrackSofteningBase::validParams();
      20          69 :   params.addClassDescription("Softening model with an abrupt stress release upon cracking. This "
      21             :                              "class is intended to be used with ComputeSmearedCrackingStress.");
      22         207 :   params.addRangeCheckedParam<Real>(
      23             :       "residual_stress",
      24         138 :       0.0,
      25             :       "residual_stress <= 1 & residual_stress >= 0",
      26             :       "The fraction of the cracking stress allowed to be maintained following a crack.");
      27          69 :   return params;
      28           0 : }
      29             : 
      30          51 : AbruptSoftening::AbruptSoftening(const InputParameters & parameters)
      31         102 :   : SmearedCrackSofteningBase(parameters), _residual_stress(getParam<Real>("residual_stress"))
      32             : {
      33          51 : }
      34             : 
      35             : void
      36        5680 : 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             :                                         const Real /*poissons_ratio*/)
      44             : {
      45        5680 :   if (_residual_stress == 0.0)
      46             :   {
      47             :     const Real tiny = 1.e-16;
      48        5680 :     stiffness_ratio = tiny;
      49        5680 :     stress = tiny * crack_initiation_strain * youngs_modulus;
      50             :   }
      51             :   else
      52             :   {
      53           0 :     stress = _residual_stress * cracking_stress;
      54           0 :     stiffness_ratio = stress / (crack_max_strain * youngs_modulus);
      55             :   }
      56        5680 : }

Generated by: LCOV version 1.14