LCOV - code coverage report
Current view: top level - src/userobjects - NumberDensityAccumulator.C (source / functions) Hit Total Coverage
Test: idaholab/salamander: 762d38 Lines: 15 15 100.0 %
Date: 2025-07-22 20:51:44 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of SALAMANDER: Software for Advanced Large-scale Analysis of MAgnetic confinement for Numerical Design, Engineering & Research,
       2             : //* A multiphysics application for modeling plasma facing components
       3             : //* https://github.com/idaholab/salamander
       4             : //* https://mooseframework.inl.gov/salamander
       5             : //*
       6             : //* SALAMANDER is powered by the MOOSE Framework
       7             : //* https://www.mooseframework.inl.gov
       8             : //*
       9             : //* Licensed under LGPL 2.1, please see LICENSE for details
      10             : //* https://www.gnu.org/licenses/lgpl-2.1.html
      11             : //*
      12             : //* Copyright 2025, Battelle Energy Alliance, LLC
      13             : //* ALL RIGHTS RESERVED
      14             : //*
      15             : 
      16             : #include "NumberDensityAccumulator.h"
      17             : #include "ResidualAccumulator.h"
      18             : #include "PICStudyBase.h"
      19             : #include "MooseMesh.h"
      20             : 
      21             : registerMooseObject("SalamanderApp", NumberDensityAccumulator);
      22             : 
      23             : InputParameters
      24          84 : NumberDensityAccumulator::validParams()
      25             : {
      26          84 :   auto params = ParticleQuantityResidualAccumulatorBase::validParams();
      27          84 :   return params;
      28             : }
      29             : 
      30          42 : NumberDensityAccumulator::NumberDensityAccumulator(const InputParameters & params)
      31          42 :   : ParticleQuantityResidualAccumulatorBase(params)
      32             : {
      33          42 : }
      34             : 
      35             : void
      36         462 : NumberDensityAccumulator::execute()
      37             : {
      38         462 :   if (_fe_problem.currentlyComputingResidual())
      39             :   {
      40             :     std::unique_ptr<SALAMANDER::AccumulatorBase> accumulator =
      41         238 :         std::make_unique<SALAMANDER::ResidualAccumulator>(_fe_problem, this, _var_name, 0);
      42             : 
      43         238 :     auto particles = _study.getBankedRays();
      44             : 
      45       13014 :     for (auto & p : particles)
      46             :     {
      47       12776 :       accumulator->add(*p->currentElem(), p->currentPoint(), p->data(_weight_index));
      48             :     }
      49             : 
      50         238 :     accumulator->finalize();
      51         238 :   }
      52         462 : }

Generated by: LCOV version 1.14