LCOV - code coverage report
Current view: top level - src/auxkernels - BondStatusBasePD.C (source / functions) Hit Total Coverage
Test: idaholab/moose peridynamics: #31405 (292dce) with base fef103 Lines: 16 18 88.9 %
Date: 2025-09-04 07:55:08 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 "BondStatusBasePD.h"
      11             : #include "PeridynamicsMesh.h"
      12             : 
      13             : InputParameters
      14          44 : BondStatusBasePD::validParams()
      15             : {
      16          44 :   InputParameters params = AuxKernelBasePD::validParams();
      17          44 :   params.addClassDescription("Base class for different failure criteria to update the bond status");
      18             : 
      19          88 :   params.addRequiredCoupledVar("critical_variable", "Name of critical AuxVariable");
      20             : 
      21          44 :   params.set<ExecFlagEnum>("execute_on", true) = EXEC_TIMESTEP_END;
      22             : 
      23          44 :   return params;
      24           0 : }
      25             : 
      26          24 : BondStatusBasePD::BondStatusBasePD(const InputParameters & parameters)
      27             :   : AuxKernelBasePD(parameters),
      28          24 :     _bond_status_var(&_subproblem.getStandardVariable(_tid, "bond_status")),
      29          48 :     _critical_val(coupledValue("critical_variable"))
      30             : {
      31          24 :   if (isNodal())
      32           0 :     paramError("variable", "This AuxKernel only supports Elemental fields");
      33          24 : }
      34             : 
      35             : Real
      36       49320 : BondStatusBasePD::computeValue()
      37             : {
      38             :   Real val = 0.0;
      39             : 
      40       49320 :   if (_bond_status_var->getElementalValue(_current_elem) > 0.5) // unbroken bond
      41             :   {
      42       48516 :     Real failure_criterion_val = computeFailureCriterionValue();
      43       48516 :     if (failure_criterion_val < 0.0) // unmet failure criterion
      44             :       val = 1.0;                     // bond is still unbroken
      45             :   }
      46             : 
      47       49320 :   return val;
      48             : }

Generated by: LCOV version 1.14