LCOV - code coverage report
Current view: top level - src/postprocessors - RayTracingStudyResult.C (source / functions) Hit Total Coverage
Test: idaholab/moose ray_tracing: #31405 (292dce) with base fef103 Lines: 22 24 91.7 %
Date: 2025-09-04 07:56: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        5898 : RayTracingStudyResult::validParams()
      21             : {
      22        5898 :   InputParameters params = GeneralPostprocessor::validParams();
      23             : 
      24        5898 :   params.addClassDescription("Gets a result from a RayTracingStudy.");
      25             : 
      26       11796 :   params.addRequiredParam<UserObjectName>("study", "The RayTracingStudy to get results from");
      27             : 
      28             :   MooseEnum results(
      29       11796 :       "total_rays_started total_processor_crossings max_processor_crossings total_distance");
      30       11796 :   params.addRequiredParam<MooseEnum>("result", results, "The result to use");
      31             : 
      32        5898 :   return params;
      33        5898 : }
      34             : 
      35        2949 : RayTracingStudyResult::RayTracingStudyResult(const InputParameters & parameters)
      36             :   : GeneralPostprocessor(parameters),
      37        2949 :     _study(getUserObject<RayTracingStudy>("study")),
      38        8847 :     _result(getParam<MooseEnum>("result"))
      39             : {
      40        2949 : }
      41             : 
      42             : Real
      43        2578 : RayTracingStudyResult::getValue() const
      44             : {
      45        2578 :   switch (_result)
      46             :   {
      47         284 :     case 0:
      48         284 :       return _study.parallelRayStudy().totalWorkCompleted();
      49             :       break;
      50          14 :     case 1:
      51          14 :       return _study.totalProcessorCrossings();
      52             :       break;
      53          14 :     case 2:
      54          14 :       return _study.maxProcessorCrossings();
      55             :       break;
      56        2266 :     case 3:
      57        2266 :       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