LCOV - code coverage report
Current view: top level - src/vectorpostprocessors - CrackFrontNonlocalStress.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31653 (2d163b) with base 0cc44f Lines: 16 16 100.0 %
Date: 2025-11-04 20:42:46 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 "CrackFrontNonlocalStress.h"
      11             : #include "RankTwoScalarTools.h"
      12             : #include "SolidMechanicsAppTypes.h"
      13             : 
      14             : registerMooseObject("SolidMechanicsApp", CrackFrontNonlocalStress);
      15             : 
      16             : InputParameters
      17          14 : CrackFrontNonlocalStress::validParams()
      18             : {
      19          14 :   InputParameters params = CrackFrontNonlocalMaterialBase::validParams();
      20          14 :   params.addClassDescription("Computes the average stress normal to the crack face.");
      21          28 :   params.addRequiredParam<MaterialPropertyName>(
      22             :       "stress_name", "Get name of stress tensor to compute at crack front");
      23          14 :   ExecFlagEnum & exec = params.set<ExecFlagEnum>("execute_on");
      24          14 :   exec.addAvailableFlags(EXEC_XFEM_MARK);
      25          28 :   params.setDocString("execute_on", exec.getDocString());
      26          56 :   params.set<ExecFlagEnum>("execute_on") = {EXEC_XFEM_MARK, EXEC_TIMESTEP_END};
      27          14 :   return params;
      28          14 : }
      29             : 
      30           7 : CrackFrontNonlocalStress::CrackFrontNonlocalStress(const InputParameters & parameters)
      31           7 :   : CrackFrontNonlocalMaterialBase(parameters, parameters.get<MaterialPropertyName>("stress_name")),
      32          14 :     _stress(getMaterialProperty<RankTwoTensor>(_base_name + _property_name))
      33             : {
      34           7 : }
      35             : 
      36             : Real
      37         825 : CrackFrontNonlocalStress::getQPCrackFrontScalar(const unsigned int qp,
      38             :                                                 const Point crack_face_normal) const
      39             : {
      40         825 :   return RankTwoScalarTools::directionValueTensor(_stress[qp], crack_face_normal);
      41             : }

Generated by: LCOV version 1.14