LCOV - code coverage report
Current view: top level - src/postprocessors - NodalIntegralPostprocessorBasePD.C (source / functions) Hit Total Coverage
Test: idaholab/moose peridynamics: #31405 (292dce) with base fef103 Lines: 22 23 95.7 %
Date: 2025-09-04 07:55:08 Functions: 7 7 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 "NodalIntegralPostprocessorBasePD.h"
      11             : 
      12             : InputParameters
      13          66 : NodalIntegralPostprocessorBasePD::validParams()
      14             : {
      15          66 :   InputParameters params = NodalPostprocessorBasePD::validParams();
      16          66 :   params.addClassDescription("Base class for peridynamic nodal integral Postprocessors");
      17             : 
      18          66 :   return params;
      19           0 : }
      20             : 
      21          36 : NodalIntegralPostprocessorBasePD::NodalIntegralPostprocessorBasePD(
      22          36 :     const InputParameters & parameters)
      23          36 :   : NodalPostprocessorBasePD(parameters), _integral_value(0)
      24             : {
      25          36 : }
      26             : 
      27             : void
      28          42 : NodalIntegralPostprocessorBasePD::initialize()
      29             : {
      30          42 :   _integral_value = 0;
      31          42 : }
      32             : 
      33             : void
      34         500 : NodalIntegralPostprocessorBasePD::execute()
      35             : {
      36         500 :   _integral_value += computeNodalValue() * _pdmesh.getNodeVolume(_current_node->id());
      37         500 : }
      38             : 
      39             : Real
      40          36 : NodalIntegralPostprocessorBasePD::getValue() const
      41             : {
      42          36 :   return _integral_value;
      43             : }
      44             : void
      45          36 : NodalIntegralPostprocessorBasePD::finalize()
      46             : {
      47          36 :   gatherSum(_integral_value);
      48          36 : }
      49             : void
      50           6 : NodalIntegralPostprocessorBasePD::threadJoin(const UserObject & uo)
      51             : {
      52             :   const auto & pps = static_cast<const NodalIntegralPostprocessorBasePD &>(uo);
      53           6 :   _integral_value += pps._integral_value;
      54           6 : }

Generated by: LCOV version 1.14