LCOV - code coverage report
Current view: top level - src/scalarkernels - GeneralizedPlaneStrainPD.C (source / functions) Hit Total Coverage
Test: idaholab/moose peridynamics: #31405 (292dce) with base fef103 Lines: 20 21 95.2 %
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 "GeneralizedPlaneStrainPD.h"
      11             : #include "GeneralizedPlaneStrainUserObjectBasePD.h"
      12             : #include "MooseVariableScalar.h"
      13             : #include "Assembly.h"
      14             : 
      15             : registerMooseObject("PeridynamicsApp", GeneralizedPlaneStrainPD);
      16             : 
      17             : InputParameters
      18         114 : GeneralizedPlaneStrainPD::validParams()
      19             : {
      20         114 :   InputParameters params = ScalarKernel::validParams();
      21         114 :   params.addClassDescription("Class for claculating residual and diagonal Jacobian for"
      22             :                              "state-based peridynamic generalized plane strain formulation");
      23             : 
      24         228 :   params.addRequiredParam<UserObjectName>(
      25             :       "generalized_plane_strain_uo",
      26             :       "UserObject name of the GeneralizedPlaneStrainUserObjectBasePD");
      27             : 
      28         114 :   return params;
      29           0 : }
      30             : 
      31          57 : GeneralizedPlaneStrainPD::GeneralizedPlaneStrainPD(const InputParameters & parameters)
      32             :   : ScalarKernel(parameters),
      33          57 :     _gpsuo(getUserObject<GeneralizedPlaneStrainUserObjectBasePD>("generalized_plane_strain_uo"))
      34             : {
      35          57 : }
      36             : 
      37             : void
      38        2623 : GeneralizedPlaneStrainPD::computeResidual()
      39             : {
      40        2623 :   prepareVectorTag(_assembly, _var.number());
      41        5246 :   for (unsigned int i = 0; i < _local_re.size(); ++i)
      42        2623 :     _local_re(i) += _gpsuo.returnResidual();
      43        2623 :   accumulateTaggedLocalResidual();
      44        2623 : }
      45             : 
      46             : void
      47         154 : GeneralizedPlaneStrainPD::computeJacobian()
      48             : {
      49         154 :   prepareMatrixTag(_assembly, _var.number(), _var.number());
      50         308 :   for (unsigned int i = 0; i < _local_ke.m(); ++i)
      51         154 :     _local_ke(i, i) += _gpsuo.returnJacobian();
      52         154 :   accumulateTaggedLocalMatrix();
      53         154 : }

Generated by: LCOV version 1.14