LCOV - code coverage report
Current view: top level - src/materials - ComputeSmallStrainNOSPD.C (source / functions) Hit Total Coverage
Test: idaholab/moose peridynamics: #32971 (54bef8) with base c6cf66 Lines: 21 22 95.5 %
Date: 2026-05-29 20:38:14 Functions: 4 4 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 "ComputeSmallStrainNOSPD.h"
      11             : 
      12             : registerMooseObject("PeridynamicsApp", ComputeSmallStrainNOSPD);
      13             : 
      14             : InputParameters
      15         537 : ComputeSmallStrainNOSPD::validParams()
      16             : {
      17         537 :   InputParameters params = ComputeStrainBaseNOSPD::validParams();
      18         537 :   params.addClassDescription(
      19             :       "Class for computing nodal quantities for the residual and Jacobian calculation "
      20             :       "for the peridynamic correspondence models under small strain assumptions");
      21             : 
      22         537 :   return params;
      23           0 : }
      24             : 
      25         423 : ComputeSmallStrainNOSPD::ComputeSmallStrainNOSPD(const InputParameters & parameters)
      26         423 :   : ComputeStrainBaseNOSPD(parameters)
      27             : {
      28         423 : }
      29             : 
      30             : void
      31     2673544 : ComputeSmallStrainNOSPD::computeQpStrain()
      32             : {
      33     2673544 :   computeQpDeformationGradient();
      34             : 
      35     2673544 :   computeQpTotalStrain();
      36             : 
      37     2673544 :   _mechanical_strain[_qp] = _total_strain[_qp];
      38             : 
      39             :   // Subtract Eigen strains
      40     3398924 :   for (auto es : _eigenstrains)
      41      725380 :     _mechanical_strain[_qp] -= (*es)[_qp];
      42             : 
      43             :   // zero out all strain measures for broken bond
      44     2673544 :   if (_bond_status_var->getElementalValue(_current_elem) < 0.5)
      45             :   {
      46       24992 :     _mechanical_strain[_qp].zero();
      47       24992 :     _total_strain[_qp].zero();
      48             :   }
      49     2673544 : }
      50             : 
      51             : void
      52      497872 : ComputeSmallStrainNOSPD::computeQpTotalStrain()
      53             : {
      54             :   // the small strain tensor
      55      497872 :   _total_strain[_qp] = 0.5 * (_deformation_gradient[_qp].transpose() + _deformation_gradient[_qp]) -
      56      497872 :                        RankTwoTensor(RankTwoTensor::initIdentity);
      57      497872 : }

Generated by: LCOV version 1.14