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 "RayTracingExodus.h" 15 : #include "libmesh/restore_warnings.h" 16 : 17 : // Local includes 18 : #include "RayTracingStudy.h" 19 : 20 : #include "libmesh/exodusII_io.h" 21 : 22 : registerMooseObject("RayTracingApp", RayTracingExodus); 23 : 24 : InputParameters 25 706 : RayTracingExodus::validParams() 26 : { 27 706 : auto params = RayTracingMeshOutput::validParams(); 28 706 : params.addClassDescription("Outputs ray segments and data as segments using the Exodus format."); 29 706 : return params; 30 0 : } 31 : 32 359 : RayTracingExodus::RayTracingExodus(const InputParameters & params) : RayTracingMeshOutput(params) {} 33 : 34 : void 35 438 : RayTracingExodus::outputMesh() 36 : { 37 876 : TIME_SECTION("outputMesh", 3, "Writing Ray Mesh"); 38 : 39 438 : libMesh::ExodusII_IO eio(*_segment_mesh); 40 438 : eio.set_hdf5_writing(false); 41 : 42 : // With nodal data, we need to output these variables in write_timestep 43 438 : if (_output_data_nodal) 44 42 : eio.set_output_variables(_study.rayDataNames()); 45 : // Otherwise, there's no variables to write in write_timestep 46 : else 47 396 : eio.set_output_variables(std::vector<std::string>()); 48 : // Write the timestep, which is the mesh + nodal vars (if any) 49 876 : eio.write_timestep(filename(), *_es, 1, time() + _app.getGlobalTimeOffset()); 50 : 51 : // This will default to write_element_data getting all available elemental vars 52 438 : eio.set_output_variables(std::vector<std::string>()); 53 : // Write the elemental variables, which are the variables with the constant Ray field data 54 438 : eio.write_element_data(*_es); 55 : 56 : // We write a new file every time as we don't keep track of whether or not the rays change 57 438 : ++_file_num; 58 876 : }