https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
RayTracingNemesis Class Reference

#include <RayTracingNemesis.h>

Inheritance diagram for RayTracingNemesis:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 RayTracingNemesis (const InputParameters &parameters)
 
virtual void outputMesh () override
 Output the mesh - to be overridden. More...
 
virtual std::string filename () override
 
void output () override
 
void setFileBase (const std::string &file_base)
 
void setFileNumber (unsigned int num)
 
unsigned int getFileNumber ()
 
virtual Real time () override
 
virtual Real timeOld ()
 
virtual Real dt ()
 
virtual Real dtOld ()
 
virtual int timeStep ()
 
const unsigned intinterval () const
 
const MultiMooseEnumexecuteOn () const
 
bool isAdvanced ()
 
virtual const OutputOnWarehouseadvancedExecuteOn () const
 
void allowOutput (bool state)
 
virtual void outputStep (const ExecFlagType &type)
 
const std::set< Real > & getSyncTimes ()
 
virtual bool supportsMaterialPropertyOutput () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void meshChanged ()
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
PerfGraphperfGraph ()
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 

Static Public Member Functions

static InputParameters validParams ()
 
static ExecFlagEnum getDefaultExecFlagEnum ()
 
static void addDeprecatedInputParameters (InputParameters &params)
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

virtual bool shouldOutput () override
 
bool checkFilename ()
 
virtual void setFileBaseInternal (const std::string &file_base)
 
bool inNonlinearTimeWindow ()
 
bool inLinearTimeWindow ()
 
virtual Real getOutputTime ()
 
virtual bool onInterval ()
 
void setWallTimeIntervalFromCommandLineParam ()
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
virtual void addReporterDependencyHelper (const ReporterName &)
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
virtual void addUserObjectDependencyHelper (const UserObject &) const
 

Static Protected Member Functions

static PetscErrorCode petscNonlinearOutput (SNES, PetscInt its, PetscReal fnorm, void *void_ptr)
 
static PetscErrorCode petscLinearOutput (KSP, PetscInt its, PetscReal fnorm, void *void_ptr)
 

Protected Attributes

const RayTracingStudy_study
 The RayTracingStudy. More...
 
const bool _output_data
 Whether or not to output all of the Ray's data. More...
 
const std::vector< std::string > *const _output_data_names
 Specific Ray data to output. More...
 
const bool _output_data_nodal
 Whether or not to output the Ray's data in a nodal, linear sense. More...
 
const bool _output_aux_data
 Whether or not to output the Ray's aux data. More...
 
const std::vector< std::string > *const _output_aux_data_names
 Specific Ray Aux data to output. More...
 
std::unique_ptr< MeshBase > _segment_mesh
 The mesh that contains the segments. More...
 
std::unique_ptr< libMesh::EquationSystems_es
 The EquationSystems. More...
 
libMesh::ExplicitSystem_sys
 The system that stores the field data. More...
 
unsigned int_file_num
 
unsigned int _padding
 
std::vector< std::string > _output_if_base_contains
 
std::string _file_base
 
Real _norm
 
PetscInt _nonlinear_iter
 
PetscInt _linear_iter
 
bool _on_linear_residual
 
bool _on_nonlinear_residual
 
FEProblemBase_problem_ptr
 
bool _transient
 
bool _use_displaced
 
libMesh::EquationSystems_es_ptr
 
MooseMesh_mesh_ptr
 
bool _sequence
 
ExecFlagEnum _execute_on
 
ExecFlagType _current_execute_flag
 
Real_time
 
Real_time_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
unsigned int _num
 
const bool _time_step_interval_set_by_addparam
 
unsigned int _time_step_interval
 
const Real _min_simulation_time_interval
 
const Real _simulation_time_interval
 
Real _wall_time_interval
 
std::set< Real_sync_times
 
const Times *const _sync_times_object
 
Real _start_time
 
Real _end_time
 
int _start_step
 
int _end_step
 
Real _t_tol
 
bool _sync_only
 
bool _allow_output
 
bool _is_advanced
 
OutputOnWarehouse _advanced_execute_on
 
Real_last_output_simulation_time
 
std::chrono::time_point< std::chrono::steady_clock > _last_output_wall_time
 
Real _wall_time_since_last_output
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
const ExecFlagEnum_execute_enum
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
PetscOutput_petsc_output
 
const Parallel::Communicator & _communicator
 

Detailed Description

Definition at line 14 of file RayTracingNemesis.h.

Constructor & Destructor Documentation

◆ RayTracingNemesis()

RayTracingNemesis::RayTracingNemesis ( const InputParameters parameters)

Definition at line 33 of file RayTracingNemesis.C.

33  : RayTracingMeshOutput(params)
34 {
35 }
RayTracingMeshOutput(const InputParameters &parameters)

Member Function Documentation

◆ filename()

std::string RayTracingMeshOutput::filename ( )
overridevirtualinherited

Reimplemented from FileOutput.

Definition at line 102 of file RayTracingMeshOutput.C.

Referenced by RayTracingExodus::outputMesh(), and outputMesh().

103 {
104  // Append the .e extension on the base file name
105  std::ostringstream output;
106  output << _file_base << ".e";
107 
108  // Add the _000x extension to the file
109  if (_file_num > 0)
110  output << "-s" << std::setw(_padding) << std::setprecision(0) << std::setfill('0') << std::right
111  << _file_num;
112 
113  // Return the filename
114  return output.str();
115 }
std::string _file_base
unsigned int _padding
unsigned int & _file_num

◆ output()

void RayTracingMeshOutput::output ( )
overridevirtualinherited

Implements FileOutput.

Definition at line 118 of file RayTracingMeshOutput.C.

Referenced by RayTracingMeshOutput::filename().

119 {
120  // Do we even have any traces?
121  auto num_segments = _study.getCachedTraces().size();
122  _communicator.sum(num_segments);
123  if (!num_segments)
124  mooseError("No cached trace segments were found in the study '", _study.name(), "'.");
125 
126  // Build the _inflated_neighbor_bboxes
128 
129  // Build the _segment_mesh
131 
132  // Setup the system to store the Ray field data
134 
135  // Fill the field data
136  fillFields();
137 
138  // And output
139  outputMesh();
140 
141  // Done with these
142  // We don't necessarily need to create a new mesh every time, but it's easier than
143  // checking if the Rays have changed from last time we built a mesh
144  _es = nullptr;
145  _sys = nullptr;
146  _segment_mesh = nullptr;
147 }
void buildSegmentMesh()
Build the mesh that contains the ray tracing segments.
void fillFields()
Fill the Ray field data.
const std::vector< TraceData > & getCachedTraces() const
Get the cached trace data structure.
const Parallel::Communicator & _communicator
const RayTracingStudy & _study
The RayTracingStudy.
virtual const std::string & name() const
void setupEquationSystem()
Setup the equation system that stores the segment-wise field data.
std::unique_ptr< libMesh::EquationSystems > _es
The EquationSystems.
virtual void outputMesh()=0
Output the mesh - to be overridden.
libMesh::ExplicitSystem * _sys
The system that stores the field data.
std::unique_ptr< MeshBase > _segment_mesh
The mesh that contains the segments.
void mooseError(Args &&... args) const
void buildBoundingBoxes()
Build the inflated neighbor bounding boxes stored in _inflated_neighbor_bboxes for the purposes of id...

◆ outputMesh()

void RayTracingNemesis::outputMesh ( )
overridevirtual

Output the mesh - to be overridden.

Implements RayTracingMeshOutput.

Definition at line 38 of file RayTracingNemesis.C.

39 {
40  TIME_SECTION("outputMesh", 3, "Outputting Nemesis RayTracing Mesh");
41 
42  // Build the nemesis IO object
44  nemesis_io.set_hdf5_writing(false);
45 
46  // With nodal data, we need to output these variables in write_timestep
48  nemesis_io.set_output_variables(_study.rayDataNames());
49  // Otherwise, there's no variables to write in write_timestep
50  else
51  nemesis_io.set_output_variables(std::vector<std::string>());
52  // Write the timestep, which is the mesh + nodal vars (if any)
53  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  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  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  ++_file_num;
62 }
const bool _output_data_nodal
Whether or not to output the Ray&#39;s data in a nodal, linear sense.
virtual Real time() override
const std::vector< std::string > & rayDataNames() const
The Ray data names.
const RayTracingStudy & _study
The RayTracingStudy.
std::unique_ptr< libMesh::EquationSystems > _es
The EquationSystems.
MooseApp & _app
std::unique_ptr< MeshBase > _segment_mesh
The mesh that contains the segments.
unsigned int & _file_num
Real getGlobalTimeOffset() const
virtual std::string filename() override

◆ validParams()

InputParameters RayTracingNemesis::validParams ( )
static

Definition at line 26 of file RayTracingNemesis.C.

27 {
28  auto params = RayTracingMeshOutput::validParams();
29  params.addClassDescription("Outputs ray segments and data as segments using the Nemesis format.");
30  return params;
31 }
static InputParameters validParams()

Member Data Documentation

◆ _es

std::unique_ptr<libMesh::EquationSystems> RayTracingMeshOutput::_es
protectedinherited

◆ _output_aux_data

const bool RayTracingMeshOutput::_output_aux_data
protectedinherited

Whether or not to output the Ray's aux data.

Definition at line 60 of file RayTracingMeshOutput.h.

Referenced by RayTracingMeshOutput::RayTracingMeshOutput(), and RayTracingMeshOutput::setupEquationSystem().

◆ _output_aux_data_names

const std::vector<std::string>* const RayTracingMeshOutput::_output_aux_data_names
protectedinherited

Specific Ray Aux data to output.

Definition at line 62 of file RayTracingMeshOutput.h.

Referenced by RayTracingMeshOutput::RayTracingMeshOutput(), and RayTracingMeshOutput::setupEquationSystem().

◆ _output_data

const bool RayTracingMeshOutput::_output_data
protectedinherited

Whether or not to output all of the Ray's data.

Definition at line 54 of file RayTracingMeshOutput.h.

Referenced by RayTracingMeshOutput::RayTracingMeshOutput(), and RayTracingMeshOutput::setupEquationSystem().

◆ _output_data_names

const std::vector<std::string>* const RayTracingMeshOutput::_output_data_names
protectedinherited

Specific Ray data to output.

Definition at line 56 of file RayTracingMeshOutput.h.

Referenced by RayTracingMeshOutput::RayTracingMeshOutput(), and RayTracingMeshOutput::setupEquationSystem().

◆ _output_data_nodal

const bool RayTracingMeshOutput::_output_data_nodal
protectedinherited

◆ _segment_mesh

std::unique_ptr<MeshBase> RayTracingMeshOutput::_segment_mesh
protectedinherited

◆ _study

const RayTracingStudy& RayTracingMeshOutput::_study
protectedinherited

◆ _sys

libMesh::ExplicitSystem* RayTracingMeshOutput::_sys
protectedinherited

The system that stores the field data.

Definition at line 69 of file RayTracingMeshOutput.h.

Referenced by RayTracingMeshOutput::fillFields(), RayTracingMeshOutput::output(), and RayTracingMeshOutput::setupEquationSystem().


The documentation for this class was generated from the following files: