LCOV - code coverage report
Current view: top level - src/postprocessors - RayTracingStudyResult.C (source / functions) Hit Total Coverage
Test: idaholab/moose ray_tracing: #32971 (54bef8) with base c6cf66 Lines: 22 24 91.7 %
Date: 2026-05-29 20:39:07 Functions: 3 3 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             : // MOOSE includes
      11             : #include "RayTracingStudyResult.h"
      12             : 
      13             : // Local includes
      14             : #include "RayTracingStudy.h"
      15             : #include "ParallelRayStudy.h"
      16             : 
      17             : registerMooseObject("RayTracingApp", RayTracingStudyResult);
      18             : 
      19             : InputParameters
      20        2872 : RayTracingStudyResult::validParams()
      21             : {
      22        2872 :   InputParameters params = GeneralPostprocessor::validParams();
      23             : 
      24        2872 :   params.addClassDescription("Gets a result from a RayTracingStudy.");
      25             : 
      26        5744 :   params.addRequiredParam<UserObjectName>("study", "The RayTracingStudy to get results from");
      27             : 
      28             :   MooseEnum results(
      29        5744 :       "total_rays_started total_processor_crossings max_processor_crossings total_distance");
      30        5744 :   params.addRequiredParam<MooseEnum>("result", results, "The result to use");
      31             : 
      32        2872 :   return params;
      33        2872 : }
      34             : 
      35        1436 : RayTracingStudyResult::RayTracingStudyResult(const InputParameters & parameters)
      36             :   : GeneralPostprocessor(parameters),
      37        1436 :     _study(getUserObject<RayTracingStudy>("study")),
      38        4308 :     _result(getParam<MooseEnum>("result"))
      39             : {
      40        1436 : }
      41             : 
      42             : Real
      43        1504 : RayTracingStudyResult::getValue() const
      44             : {
      45        1504 :   switch (_result)
      46             :   {
      47         164 :     case 0:
      48         164 :       return _study.parallelRayStudy().totalWorkCompleted();
      49             :       break;
      50           8 :     case 1:
      51           8 :       return _study.totalProcessorCrossings();
      52             :       break;
      53           8 :     case 2:
      54           8 :       return _study.maxProcessorCrossings();
      55             :       break;
      56        1324 :     case 3:
      57        1324 :       return _study.totalDistance();
      58             :       break;
      59           0 :     default:
      60           0 :       mooseError("Unknown result type ", _result, " in ", name());
      61             :   }
      62             : }

Generated by: LCOV version 1.14