LCOV - code coverage report
Current view: top level - src/materials - ComputeSmallStrainNOSPD.C (source / functions) Hit Total Coverage
Test: idaholab/moose peridynamics: #31405 (292dce) with base fef103 Lines: 21 22 95.5 %
Date: 2025-09-04 07:55:08 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         541 : ComputeSmallStrainNOSPD::validParams()
      16             : {
      17         541 :   InputParameters params = ComputeStrainBaseNOSPD::validParams();
      18         541 :   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         541 :   return params;
      23           0 : }
      24             : 
      25         426 : ComputeSmallStrainNOSPD::ComputeSmallStrainNOSPD(const InputParameters & parameters)
      26         426 :   : ComputeStrainBaseNOSPD(parameters)
      27             : {
      28         426 : }
      29             : 
      30             : void
      31     2705364 : ComputeSmallStrainNOSPD::computeQpStrain()
      32             : {
      33     2705364 :   computeQpDeformationGradient();
      34             : 
      35     2705364 :   computeQpTotalStrain();
      36             : 
      37     2705364 :   _mechanical_strain[_qp] = _total_strain[_qp];
      38             : 
      39             :   // Subtract Eigen strains
      40     3430744 :   for (auto es : _eigenstrains)
      41      725380 :     _mechanical_strain[_qp] -= (*es)[_qp];
      42             : 
      43             :   // zero out all strain measures for broken bond
      44     2705364 :   if (_bond_status_var->getElementalValue(_current_elem) < 0.5)
      45             :   {
      46       26712 :     _mechanical_strain[_qp].zero();
      47       26712 :     _total_strain[_qp].zero();
      48             :   }
      49     2705364 : }
      50             : 
      51             : void
      52      529692 : ComputeSmallStrainNOSPD::computeQpTotalStrain()
      53             : {
      54             :   // the small strain tensor
      55      529692 :   _total_strain[_qp] = 0.5 * (_deformation_gradient[_qp].transpose() + _deformation_gradient[_qp]) -
      56      529692 :                        RankTwoTensor(RankTwoTensor::initIdentity);
      57      529692 : }

Generated by: LCOV version 1.14