LCOV - code coverage report
Current view: top level - src/outputs - RayTracingNemesis.C (source / functions) Hit Total Coverage
Test: idaholab/moose ray_tracing: #31405 (292dce) with base fef103 Lines: 18 19 94.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             : // TODO: remove ignore warnings once std::tuple<> is instantiated as a StandardType
      11             : // Using push_parallel_vector_data with std::tuple<> leads to a -Wextra error
      12             : // https://github.com/libMesh/TIMPI/issues/52
      13             : #include "libmesh/ignore_warnings.h"
      14             : #include "RayTracingNemesis.h"
      15             : #include "libmesh/restore_warnings.h"
      16             : 
      17             : // Local includes
      18             : #include "RayTracingStudy.h"
      19             : 
      20             : // libMesh includes
      21             : #include "libmesh/nemesis_io.h"
      22             : 
      23             : registerMooseObject("RayTracingApp", RayTracingNemesis);
      24             : 
      25             : InputParameters
      26         168 : RayTracingNemesis::validParams()
      27             : {
      28         168 :   auto params = RayTracingMeshOutput::validParams();
      29         168 :   params.addClassDescription("Outputs ray segments and data as segments using the Nemesis format.");
      30         168 :   return params;
      31           0 : }
      32             : 
      33          84 : RayTracingNemesis::RayTracingNemesis(const InputParameters & params) : RayTracingMeshOutput(params)
      34             : {
      35          84 : }
      36             : 
      37             : void
      38         156 : RayTracingNemesis::outputMesh()
      39             : {
      40         312 :   TIME_SECTION("outputMesh", 3, "Outputting Nemesis RayTracing Mesh");
      41             : 
      42             :   // Build the nemesis IO object
      43         156 :   libMesh::Nemesis_IO nemesis_io(*_segment_mesh);
      44         156 :   nemesis_io.set_hdf5_writing(false);
      45             : 
      46             :   // With nodal data, we need to output these variables in write_timestep
      47         156 :   if (_output_data_nodal)
      48          12 :     nemesis_io.set_output_variables(_study.rayDataNames());
      49             :   // Otherwise, there's no variables to write in write_timestep
      50             :   else
      51         144 :     nemesis_io.set_output_variables(std::vector<std::string>());
      52             :   // Write the timestep, which is the mesh + nodal vars (if any)
      53         312 :   nemesis_io.write_timestep(filename(), *_es, 1, time() + _app.getGlobalTimeOffset());
      54             : 
      55             :   // This will default to write_element_data getting all available elemental vars
      56         156 :   nemesis_io.set_output_variables(std::vector<std::string>());
      57             :   // Write the elemental variables, which are the variables with the constant Ray field data
      58         156 :   nemesis_io.write_element_data(*_es);
      59             : 
      60             :   // We write a new file every time as we don't keep track of whether or not the rays change
      61         156 :   ++_file_num;
      62         312 : }

Generated by: LCOV version 1.14