LCOV - code coverage report
Current view: top level - src/kernels - HeatConductionBPD.C (source / functions) Hit Total Coverage
Test: idaholab/moose peridynamics: #31405 (292dce) with base fef103 Lines: 17 18 94.4 %
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 "HeatConductionBPD.h"
      11             : 
      12             : registerMooseObject("PeridynamicsApp", HeatConductionBPD);
      13             : 
      14             : InputParameters
      15         175 : HeatConductionBPD::validParams()
      16             : {
      17         175 :   InputParameters params = PeridynamicsKernelBase::validParams();
      18         175 :   params.addClassDescription("Class for calculating the residual and Jacobian for the bond-based "
      19             :                              "peridynamic heat conduction formulation");
      20             : 
      21         175 :   return params;
      22           0 : }
      23             : 
      24          97 : HeatConductionBPD::HeatConductionBPD(const InputParameters & parameters)
      25             :   : PeridynamicsKernelBase(parameters),
      26          97 :     _bond_heat_flow(getMaterialProperty<Real>("bond_heat_flow")),
      27         291 :     _bond_dQdT(getMaterialProperty<Real>("bond_dQdT"))
      28             : {
      29          97 : }
      30             : 
      31             : void
      32      483670 : HeatConductionBPD::computeLocalResidual()
      33             : {
      34      483670 :   _local_re(0) = -_bond_heat_flow[0] * _bond_status;
      35      483670 :   _local_re(1) = -_local_re(0);
      36      483670 : }
      37             : 
      38             : void
      39       35318 : HeatConductionBPD::computeLocalJacobian()
      40             : {
      41      105954 :   for (unsigned int i = 0; i < _nnodes; ++i)
      42      211908 :     for (unsigned int j = 0; j < _nnodes; ++j)
      43      211908 :       _local_ke(i, j) += -1 * (i == j ? 1 : -1) * _bond_dQdT[0] * _bond_status;
      44       35318 : }

Generated by: LCOV version 1.14