LCOV - code coverage report
Current view: top level - src/filters - AngularLegendreFilter.C (source / functions) Hit Total Coverage
Test: neams-th-coe/cardinal: 93e9c4 Lines: 15 16 93.8 %
Date: 2026-07-16 12:06:10 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /********************************************************************/
       2             : /*                  SOFTWARE COPYRIGHT NOTIFICATION                 */
       3             : /*                             Cardinal                             */
       4             : /*                                                                  */
       5             : /*                  (c) 2021 UChicago Argonne, LLC                  */
       6             : /*                        ALL RIGHTS RESERVED                       */
       7             : /*                                                                  */
       8             : /*                 Prepared by UChicago Argonne, LLC                */
       9             : /*               Under Contract No. DE-AC02-06CH11357               */
      10             : /*                With the U. S. Department of Energy               */
      11             : /*                                                                  */
      12             : /*             Prepared by Battelle Energy Alliance, LLC            */
      13             : /*               Under Contract No. DE-AC07-05ID14517               */
      14             : /*                With the U. S. Department of Energy               */
      15             : /*                                                                  */
      16             : /*                 See LICENSE for full restrictions                */
      17             : /********************************************************************/
      18             : 
      19             : #ifdef ENABLE_OPENMC_COUPLING
      20             : 
      21             : #include "AngularLegendreFilter.h"
      22             : 
      23             : #include "OpenMCCellAverageProblem.h"
      24             : 
      25             : #include "openmc/tallies/filter_legendre.h"
      26             : 
      27             : registerMooseObject("CardinalApp", AngularLegendreFilter);
      28             : 
      29             : InputParameters
      30         170 : AngularLegendreFilter::validParams()
      31             : {
      32         170 :   auto params = FilterBase::validParams();
      33         170 :   params.addClassDescription(
      34             :       "A class which provides a thin wrapper around an OpenMC LegendreFilter.");
      35         340 :   params.addRequiredParam<unsigned int>("order", "The order of the Legendre expansion.");
      36             : 
      37         170 :   return params;
      38           0 : }
      39             : 
      40          86 : AngularLegendreFilter::AngularLegendreFilter(const InputParameters & parameters)
      41         172 :   : FilterBase(parameters), _order(getParam<unsigned int>("order"))
      42             : {
      43          86 :   if (_openmc_problem.runRandomRay())
      44           2 :     mooseError(
      45             :         "AngularLegendreFilter is presently not supported when running the random ray solver!");
      46             : 
      47          84 :   auto legendre_filter = dynamic_cast<openmc::LegendreFilter *>(openmc::Filter::create("legendre"));
      48             : 
      49          84 :   legendre_filter->set_order(_order);
      50          84 :   _filter = legendre_filter;
      51          84 : }
      52             : 
      53             : std::string
      54         480 : AngularLegendreFilter::binName(unsigned int bin_index) const
      55             : {
      56         960 :   return "l" + Moose::stringify(bin_index);
      57             : }
      58             : 
      59             : #endif

Generated by: LCOV version 1.14