https://mooseframework.inl.gov
RayTracingExodus.C
Go to the documentation of this file.
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 
26 {
27  auto params = RayTracingMeshOutput::validParams();
28  params.addClassDescription("Outputs ray segments and data as segments using the Exodus format.");
29  return params;
30 }
31 
33 
34 void
36 {
37  TIME_SECTION("outputMesh", 3, "Writing Ray Mesh");
38 
40  eio.set_hdf5_writing(false);
41 
42  // With nodal data, we need to output these variables in write_timestep
45  // Otherwise, there's no variables to write in write_timestep
46  else
47  eio.set_output_variables(std::vector<std::string>());
48  // Write the timestep, which is the mesh + nodal vars (if any)
50 
51  // This will default to write_element_data getting all available elemental vars
52  eio.set_output_variables(std::vector<std::string>());
53  // Write the elemental variables, which are the variables with the constant Ray field data
54  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  ++_file_num;
58 }
registerMooseObject("RayTracingApp", RayTracingExodus)
const bool _output_data_nodal
Whether or not to output the Ray&#39;s data in a nodal, linear sense.
virtual void outputMesh() override
Output the mesh - to be overridden.
virtual Real time() override
const std::vector< std::string > & rayDataNames() const
The Ray data names.
const RayTracingStudy & _study
The RayTracingStudy.
void set_output_variables(const std::vector< std::string > &output_variables, bool allow_empty=true)
RayTracingExodus(const InputParameters &parameters)
static InputParameters validParams()
static InputParameters validParams()
std::unique_ptr< libMesh::EquationSystems > _es
The EquationSystems.
MooseApp & _app
std::unique_ptr< MeshBase > _segment_mesh
The mesh that contains the segments.
void write_timestep(const std::string &fname, const EquationSystems &es, const int timestep, const Real time, const std::set< std::string > *system_names=nullptr)
void write_element_data(const EquationSystems &es)
unsigned int & _file_num
Base class for outputting Ray data in a mesh format, where EDGE2 elems represent the individual Ray s...
void set_hdf5_writing(bool write_hdf5)
Real getGlobalTimeOffset() const
virtual std::string filename() override