LCOV - code coverage report
Current view: top level - src/materials - ComputePFFractureStressBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: f45d79 Lines: 0 45 0.0 %
Date: 2025-07-25 05:00:39 Functions: 0 3 0.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 "ComputePFFractureStressBase.h"
      11             : 
      12             : InputParameters
      13           0 : ComputePFFractureStressBase::validParams()
      14             : {
      15           0 :   InputParameters params = ComputeStressBase::validParams();
      16           0 :   params.addRequiredCoupledVar("c", "Name of damage variable");
      17           0 :   params.addParam<bool>(
      18           0 :       "use_current_history_variable", false, "Use the current value of the history variable.");
      19           0 :   params.addParam<bool>("use_snes_vi_solver",
      20           0 :                         false,
      21             :                         "Use PETSc's SNES variational inequalities solver to enforce damage "
      22             :                         "irreversibility condition and restrict damage value <= 1.");
      23           0 :   params.addParam<MaterialPropertyName>("barrier_energy",
      24             :                                         "Name of material property for fracture energy barrier.");
      25           0 :   params.addParam<MaterialPropertyName>(
      26             :       "E_name", "elastic_energy", "Name of material property for elastic energy");
      27           0 :   params.addParam<MaterialPropertyName>(
      28             :       "D_name", "degradation", "Name of material property for energetic degradation function.");
      29           0 :   params.addParam<MaterialPropertyName>(
      30             :       "I_name", "indicator", "Name of material property for damage indicator function.");
      31           0 :   params.addParam<MaterialPropertyName>(
      32             :       "F_name",
      33             :       "local_fracture_energy",
      34             :       "Name of material property for local fracture energy function.");
      35           0 :   return params;
      36           0 : }
      37             : 
      38           0 : ComputePFFractureStressBase::ComputePFFractureStressBase(const InputParameters & parameters)
      39             :   : ComputeStressBase(parameters),
      40           0 :     _elasticity_tensor_name(_base_name + "elasticity_tensor"),
      41           0 :     _elasticity_tensor(getMaterialPropertyByName<RankFourTensor>(_elasticity_tensor_name)),
      42           0 :     _c(coupledValue("c")),
      43           0 :     _l(getMaterialProperty<Real>("l")),
      44           0 :     _gc(getMaterialProperty<Real>("gc_prop")),
      45           0 :     _pressure(getDefaultMaterialProperty<Real>("fracture_pressure")),
      46           0 :     _use_current_hist(getParam<bool>("use_current_history_variable")),
      47           0 :     _use_snes_vi_solver(getParam<bool>("use_snes_vi_solver")),
      48           0 :     _H(declareProperty<Real>("hist")),
      49           0 :     _H_old(getMaterialPropertyOld<Real>("hist")),
      50           0 :     _barrier(getDefaultMaterialProperty<Real>("barrier_energy")),
      51           0 :     _E(declareProperty<Real>(getParam<MaterialPropertyName>("E_name"))),
      52           0 :     _dEdc(declarePropertyDerivative<Real>(getParam<MaterialPropertyName>("E_name"),
      53           0 :                                           coupledName("c", 0))),
      54           0 :     _d2Ed2c(declarePropertyDerivative<Real>(
      55           0 :         getParam<MaterialPropertyName>("E_name"), coupledName("c", 0), coupledName("c", 0))),
      56           0 :     _dstress_dc(
      57           0 :         declarePropertyDerivative<RankTwoTensor>(_base_name + "stress", coupledName("c", 0))),
      58           0 :     _d2Fdcdstrain(declareProperty<RankTwoTensor>("d2Fdcdstrain")),
      59           0 :     _D(getMaterialProperty<Real>("D_name")),
      60           0 :     _dDdc(getMaterialPropertyDerivative<Real>("D_name", coupledName("c", 0))),
      61           0 :     _d2Dd2c(
      62           0 :         getMaterialPropertyDerivative<Real>("D_name", coupledName("c", 0), coupledName("c", 0))),
      63           0 :     _I(getDefaultMaterialProperty<Real>("I_name")),
      64           0 :     _dIdc(getMaterialPropertyDerivative<Real>("I_name", coupledName("c", 0))),
      65           0 :     _d2Id2c(getMaterialPropertyDerivative<Real>("I_name", coupledName("c", 0), coupledName("c", 0)))
      66             : {
      67           0 : }
      68             : 
      69             : void
      70           0 : ComputePFFractureStressBase::initQpStatefulProperties()
      71             : {
      72           0 :   _H[_qp] = 0.0;
      73           0 : }

Generated by: LCOV version 1.14