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

#include <DisableRayBankingStudy.h>

Inheritance diagram for DisableRayBankingStudy:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 DisableRayBankingStudy (const InputParameters &parameters)
 
virtual void initialSetup () override
 
virtual void residualSetup () override
 
virtual void jacobianSetup () override
 
virtual void timestepSetup () override
 
virtual void initialize () override
 
virtual void finalize () override
 
virtual void execute () override
 Executes the study (generates and propagates Rays) More...
 
virtual void segmentSubdomainSetup (const SubdomainID subdomain, const THREAD_ID tid, const RayID ray_id)
 Setup for on subdomain change or subdomain AND ray change during ray tracing. More...
 
virtual void reinitSegment (const Elem *elem, const Point &start, const Point &end, const Real length, THREAD_ID tid)
 Reinitialize objects for a Ray segment for ray tracing. More...
 
virtual void postOnSegment (const THREAD_ID tid, const std::shared_ptr< Ray > &ray)
 Called at the end of a Ray segment. More...
 
virtual void preTrace (const THREAD_ID, const std::shared_ptr< Ray > &)
 Called at the beginning of a trace for a ray. More...
 
void executeStudy ()
 Method for executing the study so that it can be called out of the standard UO execute() More...
 
unsigned long long int endingProcessorCrossings () const
 Total number of processor crossings for Rays that finished on this processor. More...
 
unsigned int endingMaxProcessorCrossings () const
 Max number of total processor crossings for Rays that finished on this processor. More...
 
unsigned long long int totalProcessorCrossings () const
 Total number of processor crossings. More...
 
unsigned int maxProcessorCrossings () const
 Max number of processor crossings for all Rays. More...
 
unsigned long long int endingIntersections () const
 Total number of Ray/element intersections for Rays that finished on this processor. More...
 
unsigned int endingMaxIntersections () const
 Max number of intersections for Rays that finished on this processor. More...
 
unsigned long long int totalIntersections () const
 Total number of Ray/element intersections. More...
 
unsigned int maxIntersections () const
 Max number of intersections for a Ray. More...
 
unsigned int maxTrajectoryChanges () const
 Max number of trajectory changes for a Ray. More...
 
Real endingDistance () const
 Total amount of distance traveled by the rays that end on this processor. More...
 
Real totalDistance () const
 Total distance traveled by all Rays. More...
 
unsigned long long int localTraceRayResult (const int result) const
 
const ParallelRayStudyparallelRayStudy () const
 
Real rayMaxDistance () const
 Max distance any Ray can travel. More...
 
Real executionTime ()
 Duration for execute() in seconds. More...
 
Real executionTimeNano ()
 Duration for execute() in nanoseconds. More...
 
Real generationTime () const
 Duration for creation of all Rays in seconds. More...
 
Real propagationTime () const
 Duration for creation of all Rays in seconds. More...
 
bool tolerateFailure () const
 Whether or not to tolerate failure. More...
 
bool bankRaysOnCompletion () const
 Whether or not to bank Rays on completion. More...
 
bool rayDependentSubdomainSetup () const
 Whether or not to use Ray dependent subdomain setup. More...
 
RayDataIndex registerRayData (const std::string &name)
 Register a value to be filled in the data on a Ray with a given name. More...
 
std::vector< RayDataIndexregisterRayData (const std::vector< std::string > &names)
 Register values to be filled in the data on a Ray with a given name. More...
 
RayDataIndex getRayDataIndex (const std::string &name, const bool graceful=false) const
 Gets the index associated with a registered value in the Ray data. More...
 
std::vector< RayDataIndexgetRayDataIndices (const std::vector< std::string > &names, const bool graceful=false) const
 Gets the indices associated with registered values in the Ray data. More...
 
const std::string & getRayDataName (const RayDataIndex index) const
 Gets the name associated with a registered value in the Ray data. More...
 
std::vector< std::string > getRayDataNames (const std::vector< RayDataIndex > &indices) const
 Gets the names associated with registered values in the Ray data. More...
 
std::size_t rayDataSize () const
 The registered size of values in the Ray data. More...
 
bool hasRayData () const
 Whether or not any Ray data are registered. More...
 
const std::vector< std::string > & rayDataNames () const
 The Ray data names. More...
 
RayDataIndex registerRayAuxData (const std::string &name)
 Register a value to be filled in the aux data on a Ray with a given name. More...
 
std::vector< RayDataIndexregisterRayAuxData (const std::vector< std::string > &names)
 Register values to be filled in the aux data on a Ray with a given name. More...
 
RayDataIndex getRayAuxDataIndex (const std::string &name, const bool graceful=false) const
 Gets the index associated with a registered value in the Ray aux data. More...
 
std::vector< RayDataIndexgetRayAuxDataIndices (const std::vector< std::string > &names, const bool graceful=false) const
 Gets the indices associated with registered values in the Ray aux data. More...
 
const std::string & getRayAuxDataName (const RayDataIndex index) const
 Gets the name associated with a registered value in the Ray aux data. More...
 
std::vector< std::string > getRayAuxDataNames (const std::vector< RayDataIndex > &indices) const
 Gets the names associated with registered values in the Ray aux data. More...
 
std::size_t rayAuxDataSize () const
 The registered size of values in the Ray aux data. More...
 
bool hasRayAuxData () const
 Whether or not any Ray aux data are registered. More...
 
const std::vector< std::string > & rayAuxDataNames () const
 The Ray aux data names. More...
 
bool hasRayKernels (const THREAD_ID tid)
 Whether or not there are currently any active RayKernel objects. More...
 
void getRayKernels (std::vector< RayKernelBase *> &result, SubdomainID id, THREAD_ID tid)
 Fills the active RayKernels associated with this study and a block into result. More...
 
template<typename T >
void getRayKernels (std::vector< T *> &result, THREAD_ID tid)
 Fills the active RayKernels associated with this study into result. More...
 
void getRayKernels (std::vector< RayKernelBase *> &result, SubdomainID id, THREAD_ID tid, RayID ray_id)
 Fills the active RayKernels associeted with this study, block, and potentially Ray into result. More...
 
void getRayBCs (std::vector< RayBoundaryConditionBase *> &result, BoundaryID id, THREAD_ID tid)
 Fills the active RayBCs associated with this study and a boundary into result. More...
 
template<typename T >
void getRayBCs (std::vector< T *> &result, const std::vector< BoundaryID > &ids, THREAD_ID tid)
 Fills the active RayBCs associated with this study and boundaries result. More...
 
template<typename T >
void getRayBCs (std::vector< T *> &result, THREAD_ID tid)
 Fills the active RayBCs associated with this study into result. More...
 
virtual void getRayBCs (std::vector< RayBoundaryConditionBase *> &result, const std::vector< TraceRayBndElement > &bnd_elems, THREAD_ID tid, RayID ray_id)
 Fills the active RayBCs associated with thie study, boundary elements, and potentially Ray into result. More...
 
const std::vector< RayKernelBase * > & currentRayKernels (THREAD_ID tid) const
 Gets the current RayKernels for a thread, which are set in segmentSubdomainSetup() More...
 
const BoundingBox & boundingBox () const
 Get the nodal bounding box for the domain. More...
 
const BoundingBox & looseBoundingBox () const
 Get the loose nodal bounding box for the domain. More...
 
Real domainMaxLength () const
 Get the inflated maximum length across the domain. More...
 
Real totalVolume () const
 Get the current total volume of the domain. More...
 
bool isRectangularDomain () const
 Whether or not the domain is rectangular (if it is prefectly encompassed by its bounding box) More...
 
bool hasInternalSidesets () const
 Whether or not the local mesh has internal sidesets that have RayBCs on them. More...
 
const std::vector< std::vector< BoundaryID > > & getInternalSidesets (const Elem *elem) const
 Get the internal sidesets (that have RayBC(s)) for each side for a given element. More...
 
const std::set< BoundaryID > & getInternalSidesets () const
 Gets the internal sidesets (that have RayBCs) within the local domain. More...
 
bool sideIsNonPlanar (const Elem *elem, const unsigned short s) const
 Whether or not the side on elem elem is non-planar. More...
 
bool hasSameLevelActiveElems () const
 Whether or not the mesh has active elements of the same level. More...
 
void moveRayToBufferDuringTrace (std::shared_ptr< Ray > &ray, const THREAD_ID tid, const AcquireMoveDuringTraceKey &)
 INTERNAL method for moving a Ray into the buffer during tracing. More...
 
MeshBase & meshBase () const
 Access to the libMesh MeshBase. More...
 
MooseMeshmesh ()
 
virtual const PointgetSideNormal (const Elem *elem, const unsigned short side, const THREAD_ID tid)
 Get the outward normal for a given element side. More...
 
virtual const Point * getElemNormals (const Elem *, const THREAD_ID)
 Gets the outward normals for a given element. More...
 
RayData getBankedRayData (const RayID ray_id, const RayDataIndex index) const
 Gets the data value for a banked ray with a given ID. More...
 
RayData getBankedRayAuxData (const RayID ray_id, const RayDataIndex index) const
 Gets the data value for a banked ray with a given ID. More...
 
RayID registeredRayID (const std::string &name, const bool graceful=false) const
 Gets the ID of a registered ray. More...
 
const std::string & registeredRayName (const RayID ray_id) const
 Gets the name of a registered ray. More...
 
bool useRayRegistration () const
 Whether or not ray registration is being used. More...
 
bool dataOnCacheTraces () const
 Whether or not to store the Ray data on the cached Ray traces. More...
 
bool auxDataOnCacheTraces () const
 Whether or not to store the Ray aux data on the cached Ray traces. More...
 
bool segmentsOnCacheTraces () const
 Whether or not to cache individual element segments when _cache_traces = true. More...
 
virtual bool shouldCacheTrace (const std::shared_ptr< Ray > &) const
 Virtual that allows for selection in if a Ray should be cached or not (only used when _cache_traces). More...
 
TraceDatainitThreadedCachedTrace (const std::shared_ptr< Ray > &ray, THREAD_ID tid)
 Initialize a Ray in the threaded cached trace map to be filled with segments. More...
 
const std::vector< TraceData > & getCachedTraces () const
 Get the cached trace data structure. More...
 
Real subdomainHmax (const SubdomainID subdomain_id) const
 Get the cached hmax for all elements in a subdomain. More...
 
virtual void onCompleteRay (const std::shared_ptr< Ray > &ray)
 Entry point for acting on a ray when it is completed (shouldContinue() == false) More...
 
void verifyUniqueRayIDs (const std::vector< std::shared_ptr< Ray >>::const_iterator begin, const std::vector< std::shared_ptr< Ray >>::const_iterator end, const bool global, const std::string &error_suffix) const
 Verifies that the Rays in the given range have unique Ray IDs. More...
 
void verifyUniqueRays (const std::vector< std::shared_ptr< Ray >>::const_iterator begin, const std::vector< std::shared_ptr< Ray >>::const_iterator end, const std::string &error_suffix)
 Verifies that the Rays in the given range are unique. More...
 
bool currentlyPropagating () const
 Whether or not the study is propagating (tracing Rays) More...
 
bool currentlyGenerating () const
 Whether or not the study is generating. More...
 
bool verifyRays () const
 Whether or not to verify if Rays have valid information before being traced. More...
 
bool verifyTraceIntersections () const
 Whether or not trace verification is enabled in devel/dbg modes. More...
 
bool sideIsIncoming (const Elem *const elem, const unsigned short side, const Point &direction, const THREAD_ID tid)
 Whether or not side is incoming on element elem in direction direction. More...
 
bool warnNonPlanar () const
 Whether or not to produce a warning when interacting with a non-planar mesh. More...
 
ParallelStudy< std::shared_ptr< Ray >, Ray > * parallelStudy ()
 The underlying parallel study: used for the context for calling the packed range routines. More...
 
const libMesh::ElemelemSide (const libMesh::Elem &elem, const unsigned int s, const THREAD_ID tid=0)
 Get an element's side pointer without excessive memory allocation. More...
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObjectprimaryThreadCopy ()
 
SubProblemgetSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
void gatherSum (T &value)
 
void gatherMax (T &value)
 
void gatherMin (T &value)
 
void gatherProxyValueMax (T1 &proxy, T2 &value)
 
void gatherProxyValueMin (T1 &proxy, T2 &value)
 
std::set< UserObjectName > getDependObjects () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool needThreadedCopy () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool haveParameter (const std::string &name) const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (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
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) 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 customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const TgetUserObject (const std::string &param_name, bool is_dependency=true) const
 
const TgetUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const std::vector< MooseVariableScalar *> & getCoupledMooseScalarVars ()
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name_in)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOldByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlderByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialProperty (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > getKokkosBlockMaterialProperty (const MaterialPropertyName &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName (const std::string &prop_name)
 
const MaterialProperty< T > & getZeroMaterialProperty (Ts... args)
 
std::set< SubdomainIDgetMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryIDgetMaterialPropertyBoundaryIDs (const std::string &name)
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 
std::unordered_map< SubdomainID, std::vector< MaterialBase *> > buildRequiredMaterials (bool allow_stateful=true)
 
void statefulPropertiesAllowed (bool)
 
virtual bool getMaterialPropertyCalled () const
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 
virtual void resolveOptionalProperties ()
 
const GenericMaterialProperty< T, is_ad > & getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state)
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
virtual void threadJoin (const UserObject &) override
 
virtual void threadJoin (const UserObject &) override
 
virtual void subdomainSetup () override
 
virtual void subdomainSetup () override
 
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
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
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
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const TgetKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const TgetKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (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
 
TgetSampler (const std::string &name)
 
SamplergetSampler (const std::string &name)
 
TgetSamplerByName (const SamplerName &name)
 
SamplergetSamplerByName (const SamplerName &name)
 
virtual void meshDisplaced ()
 
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 DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
std::shared_ptr< RayacquireRayDuringTrace (const THREAD_ID tid, const AcquireMoveDuringTraceKey &)
 INTERNAL methods for acquiring a Ray during a trace in RayKernels and RayBCs. More...
 
std::shared_ptr< RayacquireRayInternal (const RayID id, const std::size_t data_size, const std::size_t aux_data_size, const bool reset, const AcquireRayInternalKey &)
 
TraceRaytraceRay (const THREAD_ID tid)
 Gets the threaded TraceRay object for tid. More...
 
const TraceRaytraceRay (const THREAD_ID tid) const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void sort (typename std::vector< T > &vector)
 
static void sortDFS (typename std::vector< T > &vector)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header, NameFunc &&name_func)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr PropertyValue::id_type default_property_id
 
static constexpr PropertyValue::id_type zero_property_id
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

virtual void defineRays () override
 Entry point for the user to create Rays. More...
 
virtual void meshChanged () override
 
virtual void generateRays () override
 Subclasses should override this to determine how to generate Rays. More...
 
virtual void preExecuteStudy ()
 Entry point before study execution. More...
 
virtual void postExecuteStudy ()
 Entry point after study execution. More...
 
Real computeTotalVolume ()
 Helper function for computing the total domain volume. More...
 
std::vector< RayKernelBase * > & currentRayKernelsWrite (THREAD_ID tid)
 Gets the writeable current RayKernels for a thread. More...
 
void reserveRayBuffer (const std::size_t size)
 Reserve size entires in the Ray buffer. More...
 
bool sameLevelActiveElems () const
 Determine whether or not the mesh currently has active elements that are all the same level. More...
 
virtual void buildSegmentQuadrature (const Point &start, const Point &end, const Real length, std::vector< Point > &points, std::vector< Real > &weights) const
 Builds quadrature points for a given segment using the _segment_qrule. More...
 
const std::vector< std::shared_ptr< Ray > > & rayBank () const
 Get the Ray bank. More...
 
std::shared_ptr< RaygetBankedRay (const RayID ray_id) const
 Gets the Ray with the ID ray_id from the Ray bank. More...
 
void resetUniqueRayIDs ()
 Resets the generation of unique RayIDs via generateUniqueRayID() to the beginning of the range. More...
 
void resetReplicatedRayIDs ()
 Resets the generation of unique replicated RayIDs accessed via generateReplicatedRayID(). More...
 
std::vector< RayTracingObject * > getRayTracingObjects ()
 Gets all of the currently active RayTracingObjects. More...
 
virtual RayID generateUniqueRayID (const THREAD_ID tid)
 Generates a unique RayID to be used for a Ray. More...
 
RayID generateReplicatedRayID ()
 Generates a Ray ID that is replicated across all processors. More...
 
void moveRayToBuffer (std::shared_ptr< Ray > &ray)
 Moves a ray to the buffer to be traced during generateRays(). More...
 
void moveRaysToBuffer (std::vector< std::shared_ptr< Ray >> &rays)
 Moves rays to the buffer to be traced during generateRays(). More...
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &uo) const override
 
void addReporterDependencyHelper (const ReporterName &reporter_name) override
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const ReporterContextBasegetReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
TdeclareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< TdeclareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const TgetRestartableData (const std::string &data_name) const
 
TdeclareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
TdeclareRecoverableData (const std::string &data_name, Args &&... args)
 
TdeclareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
TdeclareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
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
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 
libMesh::Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValuecoupledVectorTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledMatrixTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalargetScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 
virtual void getKokkosMaterialPropertyHook (const std::string &, const unsigned int)
 
void markMatPropRequested (const std::string &)
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (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
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
std::shared_ptr< RayacquireRay ()
 User APIs for constructing Rays within the RayTracingStudy. More...
 
std::shared_ptr< RayacquireUnsizedRay ()
 Acquire a Ray from the pool of Rays within generateRays(), without resizing the data (sizes the data to zero). More...
 
std::shared_ptr< RayacquireReplicatedRay ()
 Acquire a Ray from the pool of Rays within generateRays() in a replicated fashion. More...
 
std::shared_ptr< RayacquireCopiedRay (const Ray &ray)
 Acquires a Ray that that is copied from another Ray within generateRays(). More...
 
std::shared_ptr< RayacquireRegisteredRay (const std::string &name)
 Acquires a Ray with a given name within generateRays(). More...
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const std::vector< std::string > _names
 The Ray names. More...
 
const std::vector< Point > _start_points
 The points to start the Rays from. More...
 
const std::vector< Point > *const _end_points
 The Ray end points (if defined) More...
 
const std::vector< Point > *const _directions
 The Ray directions (if defined) More...
 
const std::vector< Real > *const _max_distances
 The Ray max distances (if defined) More...
 
const std::vector< RayDataIndex_ray_data_indices
 The Ray data indices (if defined) More...
 
const std::vector< std::vector< Real > > *const _initial_ray_data
 The initial Ray data to set (if defined) More...
 
const std::vector< RayDataIndex_ray_aux_data_indices
 The Ray aux data indices (if defined) More...
 
const std::vector< std::vector< Real > > *const _initial_ray_aux_data
 The initial Ray data to set (if defined) More...
 
std::vector< std::shared_ptr< Ray > > & _rays
 Vector of Rays that the user will fill into in defineRays() (restartable) More...
 
const bool _define_rays_replicated
 Whether or not the Rays filled into _rays are replicated across all processors. More...
 
const bool _claim_after_define_rays
 Whether or not Rays need to be claimed after defineRays() More...
 
bool & _should_define_rays
 Whether or not we should call defineRays() on the next generateRays() Can be set to true in derived classes if they wish to redefine the rays after they have been defined once. More...
 
MooseMesh_mesh
 The Mesh. More...
 
const Parallel::Communicator & _comm
 The Communicator. More...
 
const processor_id_type _pid
 The rank of this processor (this actually takes time to lookup - so just do it once) More...
 
const bool _ray_kernel_coverage_check
 Whether or not to perform coverage checks on RayKernels. More...
 
const bool _warn_non_planar
 Whether not to warn if non-planar faces are found. More...
 
const bool _use_ray_registration
 Whether or not to use Ray registration. More...
 
const bool _use_internal_sidesets
 Whether or not to use the internal sidesets in ray tracing. More...
 
const bool _tolerate_failure
 Whether or not to tolerate a Ray Tracing failure. More...
 
const bool _bank_rays_on_completion
 Whether or not to bank rays on completion. More...
 
const bool _ray_dependent_subdomain_setup
 Whether or not subdomain setup is dependent on the Ray. More...
 
bool _always_cache_traces
 Whether or not to cache traces on every trace execution. More...
 
const bool _data_on_cache_traces
 Whether or not to store the Ray data on the cache traces. More...
 
const bool _aux_data_on_cache_traces
 Whether or not to store the Ray aux data on the cache traces. More...
 
const bool _segments_on_cache_traces
 Whether or not to cache individual element segments when caching. More...
 
const Real _ray_max_distance
 Max distance a Ray can travel before being killed (can change) More...
 
const bool _verify_rays
 Whether or not to verify if Rays have valid information before being traced. More...
 
const bool _verify_trace_intersections
 Whether or not to verify the trace intersections in devel and dbg modes. More...
 
const Moose::CoordinateSystemType_coord_sys
 
const THREAD_ID _tid
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
Assembly_assembly
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
FEProblemBase_mdi_feproblem
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
FEProblemBase_sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real_real_zero
 
const VariableValue_scalar_zero
 
const Point & _point_zero
 
const InputParameters_mi_params
 
const std::string _mi_name
 
const MooseObjectName _mi_moose_object_name
 
FEProblemBase_mi_feproblem
 
SubProblem_mi_subproblem
 
const THREAD_ID _mi_tid
 
const bool _is_kokkos_object
 
const Moose::MaterialDataType _material_data_type
 
MaterialData_material_data
 
bool _stateful_allowed
 
bool _get_material_property_called
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 
std::unordered_set< unsigned int_material_property_dependencies
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real_t
 
const Real_t_old
 
int_t_step
 
Real_dt
 
Real_dt_old
 
bool _is_transient
 
const Parallel::Communicator & _communicator
 

Static Protected Attributes

static const std::string _interpolated_old
 
static const std::string _interpolated_older
 

Detailed Description

Definition at line 14 of file DisableRayBankingStudy.h.

Constructor & Destructor Documentation

◆ DisableRayBankingStudy()

DisableRayBankingStudy::DisableRayBankingStudy ( const InputParameters parameters)

Definition at line 24 of file DisableRayBankingStudy.C.

26 {
27 }
const InputParameters & parameters() const
RepeatableRayStudy(const InputParameters &parameters)

Member Function Documentation

◆ acquireCopiedRay()

std::shared_ptr< Ray > RayTracingStudy::acquireCopiedRay ( const Ray ray)
protectedinherited

Acquires a Ray that that is copied from another Ray within generateRays().

All of the information is copied except for the counters (intersections, processor crossings, etc), which are reset.

Definition at line 1835 of file RayTracingStudy.C.

Referenced by RepeatableRayStudyBaseTest::defineRays(), RayTracingStudyTest::generateRays(), and RepeatableRayStudyBase::generateRays().

1836 {
1837  mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1838  return _parallel_ray_study->acquireParallelData(
1839  /* tid = */ 0, &ray, Ray::ConstructRayKey());
1840 }
bool currentlyGenerating() const
Whether or not the study is generating.
Class that is used as a parameter to the public constructors/reset methods.
Definition: Ray.h:99
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.

◆ acquireRay()

std::shared_ptr< Ray > RayTracingStudy::acquireRay ( )
protectedinherited

User APIs for constructing Rays within the RayTracingStudy.

Rays can ONLY be constructed by users within the RayTracingStudy via the following methods. Acquire a Ray from the pool of Rays within generateRays().

A unique ID is generated and assigned to the acquired Ray. The data and aux data sizes are set according to the sizes required by the RayTracingStudy.

Definition at line 1771 of file RayTracingStudy.C.

Referenced by LotsOfRaysRayStudy::defineRay(), StationaryRayStudyTest::generateRays(), TestRay::generateRays(), RayTracingStudyTest::generateRays(), TestReuseRaysStudy::generateRays(), TestTransientRaysStudy::generateRays(), and ViewFactorRayStudy::generateRays().

1772 {
1773  mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1774 
1775  return _parallel_ray_study->acquireParallelData(
1776  /* tid = */ 0,
1777  this,
1778  generateUniqueRayID(/* tid = */ 0),
1779  rayDataSize(),
1780  rayAuxDataSize(),
1781  /* reset = */ true,
1783 }
bool currentlyGenerating() const
Whether or not the study is generating.
Class that is used as a parameter to the public constructors/reset methods.
Definition: Ray.h:99
std::size_t rayAuxDataSize() const
The registered size of values in the Ray aux data.
virtual RayID generateUniqueRayID(const THREAD_ID tid)
Generates a unique RayID to be used for a Ray.
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.
std::size_t rayDataSize() const
The registered size of values in the Ray data.

◆ acquireRayDuringTrace()

std::shared_ptr< Ray > RayTracingStudy::acquireRayDuringTrace ( const THREAD_ID  tid,
const AcquireMoveDuringTraceKey  
)
inherited

INTERNAL methods for acquiring a Ray during a trace in RayKernels and RayBCs.

You should not use these APIs directly. If you wish to acquire a Ray during generation during generateRays()), use the protected RayTracingStudy::acquire{}Ray() methods. If you wish to acquire a Ray during propagation in RayKernels and RayBC, use the protected RayKernelBase::acquireRay() and RayBoundaryConditionBase::acquireRay(), respectively.

Definition at line 1843 of file RayTracingStudy.C.

Referenced by RayBoundaryConditionBase::acquireRay(), and RayKernelBase::acquireRay().

1844 {
1845  mooseAssert(currentlyPropagating(), "Can only use during propagation");
1846  return _parallel_ray_study->acquireParallelData(tid,
1847  this,
1848  generateUniqueRayID(tid),
1849  rayDataSize(),
1850  rayAuxDataSize(),
1851  /* reset = */ true,
1853 }
Class that is used as a parameter to the public constructors/reset methods.
Definition: Ray.h:99
std::size_t rayAuxDataSize() const
The registered size of values in the Ray aux data.
virtual RayID generateUniqueRayID(const THREAD_ID tid)
Generates a unique RayID to be used for a Ray.
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
std::size_t rayDataSize() const
The registered size of values in the Ray data.

◆ acquireRayInternal()

std::shared_ptr<Ray> RayTracingStudy::acquireRayInternal ( const RayID  id,
const std::size_t  data_size,
const std::size_t  aux_data_size,
const bool  reset,
const AcquireRayInternalKey  
)
inlineinherited

Definition at line 489 of file RayTracingStudy.h.

Referenced by dataLoad(), and libMesh::Parallel::Packing< std::shared_ptr< Ray > >::unpack().

494  {
495  return _parallel_ray_study->acquireParallelData(
496  0, this, id, data_size, aux_data_size, reset, Ray::ConstructRayKey());
497  }
Class that is used as a parameter to the public constructors/reset methods.
Definition: Ray.h:99
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.

◆ acquireRegisteredRay()

std::shared_ptr< Ray > RayTracingStudy::acquireRegisteredRay ( const std::string &  name)
protectedinherited

Acquires a Ray with a given name within generateRays().

Used when ray registration is enabled, that is, the private paramater '_use_ray_registration' == true.

This method must be called on all processors at the same time with the same name. This method can only be called on thread 0, which is why there is no thread argument.

Definition at line 1816 of file RayTracingStudy.C.

Referenced by RepeatableRayStudyBaseTest::defineRays(), RepeatableRayStudy::defineRays(), and RayTracingStudyTest::generateRays().

1817 {
1818  mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1819 
1820  // Either register a Ray or get an already registered Ray id
1821  const RayID id = registerRay(name);
1822 
1823  // Acquire a Ray with the properly sized data initialized to zero
1824  return _parallel_ray_study->acquireParallelData(
1825  /* tid = */ 0,
1826  this,
1827  id,
1828  rayDataSize(),
1829  rayAuxDataSize(),
1830  /* reset = */ true,
1832 }
bool currentlyGenerating() const
Whether or not the study is generating.
RayID registerRay(const std::string &name)
Registers a Ray with a given name.
unsigned long int RayID
Type for a Ray&#39;s ID.
Definition: Ray.h:44
Class that is used as a parameter to the public constructors/reset methods.
Definition: Ray.h:99
std::size_t rayAuxDataSize() const
The registered size of values in the Ray aux data.
const std::string & name() const
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.
std::size_t rayDataSize() const
The registered size of values in the Ray data.

◆ acquireReplicatedRay()

std::shared_ptr< Ray > RayTracingStudy::acquireReplicatedRay ( )
protectedinherited

Acquire a Ray from the pool of Rays within generateRays() in a replicated fashion.

That is, this method must be called on all processors at the same time and the ID of the resulting Ray is the same across all processors.

The data and aux data sizes are set according to the sizes required by the RayTracingStudy.

Definition at line 1800 of file RayTracingStudy.C.

Referenced by ConeRayStudy::defineRays(), and TestPICRayStudy::generateRays().

1801 {
1802  mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1803  libmesh_parallel_only(comm());
1804 
1805  return _parallel_ray_study->acquireParallelData(
1806  /* tid = */ 0,
1807  this,
1809  rayDataSize(),
1810  rayAuxDataSize(),
1811  /* reset = */ true,
1813 }
bool currentlyGenerating() const
Whether or not the study is generating.
Class that is used as a parameter to the public constructors/reset methods.
Definition: Ray.h:99
std::size_t rayAuxDataSize() const
The registered size of values in the Ray aux data.
const Parallel::Communicator & comm() const
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.
RayID generateReplicatedRayID()
Generates a Ray ID that is replicated across all processors.
std::size_t rayDataSize() const
The registered size of values in the Ray data.

◆ acquireUnsizedRay()

std::shared_ptr< Ray > RayTracingStudy::acquireUnsizedRay ( )
protectedinherited

Acquire a Ray from the pool of Rays within generateRays(), without resizing the data (sizes the data to zero).

A unique ID is generated and assigned to the acquired Ray.

Definition at line 1786 of file RayTracingStudy.C.

Referenced by LotsOfRaysRayStudy::defineRay().

1787 {
1788  mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1789 
1790  return _parallel_ray_study->acquireParallelData(/* tid = */ 0,
1791  this,
1792  generateUniqueRayID(/* tid = */ 0),
1793  /* data_size = */ 0,
1794  /* aux_data_size = */ 0,
1795  /* reset = */ true,
1797 }
bool currentlyGenerating() const
Whether or not the study is generating.
Class that is used as a parameter to the public constructors/reset methods.
Definition: Ray.h:99
virtual RayID generateUniqueRayID(const THREAD_ID tid)
Generates a unique RayID to be used for a Ray.
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.

◆ auxDataOnCacheTraces()

bool RayTracingStudy::auxDataOnCacheTraces ( ) const
inlineinherited

Whether or not to store the Ray aux data on the cached Ray traces.

Definition at line 573 of file RayTracingStudy.h.

Referenced by TraceRay::continueTraceOffProcessor(), TraceRay::onCompleteTrace(), TraceRay::onContinueTrace(), TraceRay::onTrajectoryChanged(), RayTracingMeshOutput::RayTracingMeshOutput(), and TraceRay::trace().

573 { return _aux_data_on_cache_traces; }
const bool _aux_data_on_cache_traces
Whether or not to store the Ray aux data on the cache traces.

◆ bankRaysOnCompletion()

bool RayTracingStudy::bankRaysOnCompletion ( ) const
inlineinherited

Whether or not to bank Rays on completion.

Definition at line 214 of file RayTracingStudy.h.

Referenced by RayIntegralValue::initialize(), and RayDataValue::RayDataValue().

214 { return _bank_rays_on_completion; }
const bool _bank_rays_on_completion
Whether or not to bank rays on completion.

◆ boundingBox()

const BoundingBox& RayTracingStudy::boundingBox ( ) const
inlineinherited

Get the nodal bounding box for the domain.

Definition at line 422 of file RayTracingStudy.h.

Referenced by TestRayDataStudy::auxDataValue(), TestRayDataStudy::dataValue(), LotsOfRaysRayStudy::defineRays(), and TraceRay::trace().

422 { return _b_box; }
libMesh::BoundingBox _b_box
Nodal bounding box for the domain.

◆ buildSegmentQuadrature()

void RayTracingStudy::buildSegmentQuadrature ( const Point start,
const Point end,
const Real  length,
std::vector< Point > &  points,
std::vector< Real > &  weights 
) const
protectedvirtualinherited

Builds quadrature points for a given segment using the _segment_qrule.

Parameters
startStart point of the segment
endEnd point of the segment
lengthThe lengh of the start -> end segment
pointsPoints to fill into (should be sized ahead of time)
weightsWeights to fill into (should be sized ahead of time)

Definition at line 814 of file RayTracingStudy.C.

Referenced by RayTracingStudy::reinitSegment().

819 {
820  points.resize(_segment_qrule->n_points());
821  weights.resize(_segment_qrule->n_points());
822 
823  const Point diff = end - start;
824  const Point sum = end + start;
825  mooseAssert(MooseUtils::absoluteFuzzyEqual(length, diff.norm()), "Invalid length");
826 
827  // The standard quadrature rule should be on x = [-1, 1]
828  // To scale the points, you...
829  // - Scale to size of the segment in 3D
830  // initial_scaled_qp = x_qp * 0.5 * (end - start) = 0.5 * x_qp * diff
831  // - Shift quadrature midpoint to segment midpoint
832  // final_qp = initial_scaled_qp + 0.5 * (end - start) = initial_scaled_qp + 0.5 * sum
833  // = 0.5 * (x_qp * diff + sum)
834  for (unsigned int qp = 0; qp < _segment_qrule->n_points(); ++qp)
835  {
836  points[qp] = 0.5 * (_segment_qrule->qp(qp)(0) * diff + sum);
837  weights[qp] = 0.5 * _segment_qrule->w(qp) * length;
838  }
839 }
auto norm() const
std::unique_ptr< libMesh::QBase > _segment_qrule
Quadrature rule for laying points across a 1D ray segment.

◆ computeTotalVolume()

Real RayTracingStudy::computeTotalVolume ( )
protectedinherited

Helper function for computing the total domain volume.

Definition at line 1491 of file RayTracingStudy.C.

1492 {
1493  Real volume = 0;
1494  for (const auto & elem : *_mesh.getActiveLocalElementRange())
1495  volume += elem->volume();
1496  _communicator.sum(volume);
1497  return volume;
1498 }
libMesh::ConstElemRange * getActiveLocalElementRange()
MooseMesh & _mesh
The Mesh.
const Parallel::Communicator & _communicator
Real volume(const MeshBase &mesh, unsigned int dim=libMesh::invalid_uint)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ currentlyGenerating()

bool RayTracingStudy::currentlyGenerating ( ) const
inlineinherited

◆ currentlyPropagating()

bool RayTracingStudy::currentlyPropagating ( ) const
inlineinherited

◆ currentRayKernels()

const std::vector<RayKernelBase *>& RayTracingStudy::currentRayKernels ( THREAD_ID  tid) const
inlineinherited

Gets the current RayKernels for a thread, which are set in segmentSubdomainSetup()

Definition at line 414 of file RayTracingStudy.h.

Referenced by TraceRay::onCompleteTrace(), TraceRay::onSegment(), TraceRay::onSubdomainChanged(), RayTracingStudy::reinitSegment(), and TraceRay::trace().

415  {
416  return _threaded_current_ray_kernels[tid];
417  }
std::vector< std::vector< RayKernelBase * > > _threaded_current_ray_kernels
The current RayKernel objects for each thread.

◆ currentRayKernelsWrite()

std::vector<RayKernelBase *>& RayTracingStudy::currentRayKernelsWrite ( THREAD_ID  tid)
inlineprotectedinherited

Gets the writeable current RayKernels for a thread.

Allows for other ray studies to fill the current ray kernels in a custom manner

Definition at line 721 of file RayTracingStudy.h.

722  {
723  return _threaded_current_ray_kernels[tid];
724  }
std::vector< std::vector< RayKernelBase * > > _threaded_current_ray_kernels
The current RayKernel objects for each thread.

◆ dataOnCacheTraces()

bool RayTracingStudy::dataOnCacheTraces ( ) const
inlineinherited

Whether or not to store the Ray data on the cached Ray traces.

Definition at line 569 of file RayTracingStudy.h.

Referenced by TraceRay::continueTraceOffProcessor(), TraceRay::onCompleteTrace(), TraceRay::onContinueTrace(), TraceRay::onTrajectoryChanged(), RayTracingMeshOutput::RayTracingMeshOutput(), and TraceRay::trace().

569 { return _data_on_cache_traces; }
const bool _data_on_cache_traces
Whether or not to store the Ray data on the cache traces.

◆ defineRays()

void RepeatableRayStudy::defineRays ( )
overrideprotectedvirtualinherited

Entry point for the user to create Rays.

Users must override this function to fill _rays.

See the comments in RepeatableRayStudyBase::generateRays() for more information.

Implements RepeatableRayStudyBase.

Reimplemented in RepeatableRayStudyDefineNoClaimTest, and RepeatableRayStudyBaseTest.

Definition at line 153 of file RepeatableRayStudy.C.

Referenced by RepeatableRayStudyBaseTest::defineRays().

154 {
155  for (std::size_t i = 0; i < _names.size(); ++i)
156  {
157  std::shared_ptr<Ray> ray = acquireRegisteredRay(_names[i]);
158 
159  ray->setStart(_start_points[i]);
160  if (_end_points) // user set end point
161  ray->setStartingEndPoint((*_end_points)[i]);
162  else // user set direction
163  ray->setStartingDirection((*_directions)[i]);
164 
165  // Set the data if the user requested so
166  const auto set_data = [this, &ray, &i](const bool aux)
167  {
168  const auto indices = aux ? _ray_aux_data_indices : _ray_data_indices;
169  const auto data = aux ? _initial_ray_aux_data : _initial_ray_data;
170  if (data)
171  {
172  mooseAssert(data->size() == _names.size(), "Size mismatch");
173  mooseAssert((*data)[i].size() == indices.size(), "Size mismatch");
174  for (const auto index_i : indices)
175  {
176  const auto data_index = indices[index_i];
177  const auto value = (*data)[i][index_i];
178  if (aux)
179  ray->auxData(data_index) = value;
180  else
181  ray->data(data_index) = value;
182  }
183  }
184  };
185  set_data(false);
186  set_data(true);
187 
188  // User set max-distances
189  if (_max_distances)
190  ray->setStartingMaxDistance((*_max_distances)[i]);
191 
192  _rays.emplace_back(std::move(ray));
193  }
194 }
const std::vector< RayDataIndex > _ray_aux_data_indices
The Ray aux data indices (if defined)
const std::vector< Point > _start_points
The points to start the Rays from.
const std::vector< std::vector< Real > > *const _initial_ray_aux_data
The initial Ray data to set (if defined)
std::shared_ptr< Ray > acquireRegisteredRay(const std::string &name)
Acquires a Ray with a given name within generateRays().
const std::vector< std::vector< Real > > *const _initial_ray_data
The initial Ray data to set (if defined)
const std::vector< Point > *const _directions
The Ray directions (if defined)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
const std::vector< std::string > _names
The Ray names.
const std::vector< RayDataIndex > _ray_data_indices
The Ray data indices (if defined)
std::vector< std::shared_ptr< Ray > > & _rays
Vector of Rays that the user will fill into in defineRays() (restartable)
const std::vector< Real > *const _max_distances
The Ray max distances (if defined)
const std::vector< Point > *const _end_points
The Ray end points (if defined)

◆ domainMaxLength()

Real RayTracingStudy::domainMaxLength ( ) const
inlineinherited

Get the inflated maximum length across the domain.

Definition at line 433 of file RayTracingStudy.h.

Referenced by TraceRay::exitsElem(), and TraceRay::trace().

433 { return _domain_max_length; }
Real _domain_max_length
An inflated max distance for the domain.

◆ elemSide()

const libMesh::Elem& RayTracingStudy::elemSide ( const libMesh::Elem elem,
const unsigned int  s,
const THREAD_ID  tid = 0 
)
inlineinherited

Get an element's side pointer without excessive memory allocation.

Parameters
elemThe element to build a side for
sThe side to build
tidThe thread id
Returns
A pointer to the side element

Definition at line 689 of file RayTracingStudy.h.

Referenced by LotsOfRaysRayStudy::defineRays(), StationaryRayStudyTest::generateRays(), RayTracingStudy::nonPlanarSideSetup(), and ClaimRays::postClaimRay().

690  {
691  return _threaded_elem_side_builders[tid](elem, s);
692  }
std::vector< libMesh::ElemSideBuilder > _threaded_elem_side_builders
Threaded helpers for building element sides without extraneous allocation.

◆ endingDistance()

Real RayTracingStudy::endingDistance ( ) const
inlineinherited

Total amount of distance traveled by the rays that end on this processor.

Definition at line 168 of file RayTracingStudy.h.

168 { return _ending_distance; }
Real _ending_distance
Total distance traveled by Rays that end on this processor.

◆ endingIntersections()

unsigned long long int RayTracingStudy::endingIntersections ( ) const
inlineinherited

Total number of Ray/element intersections for Rays that finished on this processor.

Definition at line 147 of file RayTracingStudy.h.

147 { return _ending_intersections; }
unsigned long long int _ending_intersections
Total number of Ray/element intersections for Rays that finished on this processor.

◆ endingMaxIntersections()

unsigned int RayTracingStudy::endingMaxIntersections ( ) const
inlineinherited

Max number of intersections for Rays that finished on this processor.

Definition at line 151 of file RayTracingStudy.h.

151 { return _ending_max_intersections; }
unsigned int _ending_max_intersections
Max number of intersections for Rays that finished on this processor.

◆ endingMaxProcessorCrossings()

unsigned int RayTracingStudy::endingMaxProcessorCrossings ( ) const
inlineinherited

Max number of total processor crossings for Rays that finished on this processor.

Definition at line 134 of file RayTracingStudy.h.

unsigned int _ending_max_processor_crossings
Max number of total processor crossings for Rays that finished on this processor. ...

◆ endingProcessorCrossings()

unsigned long long int RayTracingStudy::endingProcessorCrossings ( ) const
inlineinherited

Total number of processor crossings for Rays that finished on this processor.

Definition at line 130 of file RayTracingStudy.h.

130 { return _ending_processor_crossings; }
unsigned long long int _ending_processor_crossings
Total number of processor crossings for Rays that finished on this processor.

◆ execute()

void RayTracingStudy::execute ( )
overridevirtualinherited

Executes the study (generates and propagates Rays)

Implements GeneralUserObject.

Reimplemented in SingleTraceLineSourceTest.

Definition at line 313 of file RayTracingStudy.C.

Referenced by SingleTraceLineSourceTest::execute().

314 {
315  executeStudy();
316 }
void executeStudy()
Method for executing the study so that it can be called out of the standard UO execute() ...

◆ executeStudy()

void RayTracingStudy::executeStudy ( )
inherited

Method for executing the study so that it can be called out of the standard UO execute()

Definition at line 875 of file RayTracingStudy.C.

Referenced by RayTracingStudy::execute().

876 {
877  TIME_SECTION("executeStudy", 2, "Executing Study");
878 
879  mooseAssert(_called_initial_setup, "Initial setup not called");
880 
881  // Reset ray start/complete timers
883  _max_intersections = 0;
885 
886  // Reset physical tracing stats
887  for (auto & val : _local_trace_ray_results)
888  val = 0;
889 
890  // Reset crossing and intersection
897  _ending_distance = 0;
898  _total_distance = 0;
899 
900  // Zero the AuxVariables that our AuxRayKernels contribute to before they accumulate
902 
903  preExecuteStudy();
904  for (auto & rto : getRayTracingObjects())
905  rto->preExecuteStudy();
906 
907  _ray_bank.clear();
908 
909  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
910  {
911  _threaded_trace_ray[tid]->preExecute();
912  _threaded_cached_normals[tid].clear();
913  }
914 
916  _execution_start_time = std::chrono::steady_clock::now();
917 
918  _parallel_ray_study->preExecute();
919 
920  {
921  {
922  auto generation_start_time = std::chrono::steady_clock::now();
923 
924  TIME_SECTION("generateRays", 2, "Generating Rays");
925 
926  generateRays();
927 
928  _generation_time = std::chrono::steady_clock::now() - generation_start_time;
929  }
930 
931  // At this point, nobody is working so this is good time to make sure
932  // Rays are unique across all processors in the working buffer
933  if (verifyRays())
934  {
935  verifyUniqueRays(_parallel_ray_study->workBuffer().begin(),
936  _parallel_ray_study->workBuffer().end(),
937  /* error_suffix = */ "after generateRays()");
938 
939  verifyUniqueRayIDs(_parallel_ray_study->workBuffer().begin(),
940  _parallel_ray_study->workBuffer().end(),
941  /* global = */ true,
942  /* error_suffix = */ "after generateRays()");
943  }
944 
946 
947  {
948  TIME_SECTION("propagateRays", 2, "Propagating Rays");
949 
950  const auto propagation_start_time = std::chrono::steady_clock::now();
951 
952  _parallel_ray_study->execute();
953 
954  _propagation_time = std::chrono::steady_clock::now() - propagation_start_time;
955  }
956  }
957 
958  _execution_time = std::chrono::steady_clock::now() - _execution_start_time;
959 
960  if (verifyRays())
961  {
962  verifyUniqueRays(_parallel_ray_study->workBuffer().begin(),
963  _parallel_ray_study->workBuffer().end(),
964  /* error_suffix = */ "after tracing completed");
965 
966 #ifndef NDEBUG
967  // Outside of debug, _ray_bank always holds all of the Rays that have ended on this processor
968  // We can use this as a global point to check for unique IDs for every Ray that has traced
970  _ray_bank.end(),
971  /* global = */ true,
972  /* error_suffix = */ "after tracing completed");
973 #endif
974  }
975 
976  // Update counters from the threaded trace objects
977  for (const auto & tr : _threaded_trace_ray)
978  for (std::size_t i = 0; i < _local_trace_ray_results.size(); ++i)
979  _local_trace_ray_results[i] += tr->results()[i];
980 
981  // Update local ending counters
988  // ...and communicate the global values
995 
996  // Throw a warning with the number of failed (tolerated) traces
997  if (_tolerate_failure)
998  {
1000  _communicator.sum(failures);
1001  if (failures)
1002  mooseWarning(
1003  type(), " '", name(), "': ", failures, " ray tracing failures were tolerated.\n");
1004  }
1005 
1006  // Clear the current RayKernels
1007  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
1009 
1010  // Move the threaded cache trace information into the full cached trace vector
1011  // Here, we only clear the cached vectors so that we might not have to
1012  // reallocate on future traces
1013  std::size_t num_entries = 0;
1014  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
1015  num_entries += _threaded_cached_traces[tid].size();
1016  _cached_traces.clear();
1017  _cached_traces.reserve(num_entries);
1018  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
1019  {
1020  for (const auto & entry : _threaded_cached_traces[tid])
1021  _cached_traces.emplace_back(std::move(entry));
1022  _threaded_cached_traces[tid].clear();
1023  }
1024 
1025  // Add any stragglers that contribute to the Jacobian or residual
1026  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
1027  if (_num_cached[tid] != 0)
1028  {
1029  mooseAssert(_fe_problem.currentlyComputingJacobian() ||
1031  "Should not have cached values without Jacobian/residual computation");
1032 
1035  else
1037 
1038  _num_cached[tid] = 0;
1039  }
1040 
1041  // AuxRayKernels may have modified AuxVariables
1044 
1045  // Clear FE
1046  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
1047  {
1050  }
1051 
1052  postExecuteStudy();
1053  for (auto & rto : getRayTracingObjects())
1054  rto->postExecuteStudy();
1055 }
const bool _tolerate_failure
Whether or not to tolerate a Ray Tracing failure.
unsigned long long int _total_intersections
Total number of Ray/element intersections.
unsigned long long int _ending_intersections
Total number of Ray/element intersections for Rays that finished on this processor.
unsigned int _max_trajectory_changes
Max number of trajectory changes for a single Ray.
void verifyUniqueRayIDs(const std::vector< std::shared_ptr< Ray >>::const_iterator begin, const std::vector< std::shared_ptr< Ray >>::const_iterator end, const bool global, const std::string &error_suffix) const
Verifies that the Rays in the given range have unique Ray IDs.
unsigned int n_threads()
NumericVector< Number > & solution()
std::vector< std::vector< TraceData > > _threaded_cached_traces
The threaded storage for cached traces.
Real _ending_distance
Total distance traveled by Rays that end on this processor.
const Parallel::Communicator & _communicator
void clearActiveMaterialProperties(const THREAD_ID tid)
std::vector< std::vector< RayKernelBase * > > _threaded_current_ray_kernels
The current RayKernel objects for each thread.
std::vector< TraceData > _cached_traces
Storage for the cached traces.
std::vector< std::shared_ptr< TraceRay > > _threaded_trace_ray
The TraceRay objects for each thread (they do the physical tracing)
FEProblemBase & _fe_problem
unsigned long long int _total_processor_crossings
Total number of processor crossings.
bool verifyRays() const
Whether or not to verify if Rays have valid information before being traced.
const std::string & name() const
unsigned int _ending_max_intersections
Max number of intersections for Rays that finished on this processor.
sideset clear()
virtual void postExecuteStudy()
Entry point after study execution.
unsigned int _max_processor_crossings
Max number of processor crossings for all Rays.
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.
std::vector< RayTracingObject * > getRayTracingObjects()
Gets all of the currently active RayTracingObjects.
const bool & currentlyComputingResidual() const
unsigned int _max_intersections
Max number of intersections for a single Ray.
unsigned int _ending_max_trajectory_changes
Max number of trajectory changes for Rays that finished on this processor.
unsigned int _ending_max_processor_crossings
Max number of total processor crossings for Rays that finished on this processor. ...
void zeroAuxVariables()
Zero the AuxVariables that the registered AuxRayKernels contribute to.
const std::string & type() const
std::chrono::steady_clock::time_point _execution_start_time
Timing.
virtual void preExecuteStudy()
Entry point before study execution.
AuxiliarySystem & getAuxiliarySystem()
virtual void generateRays()=0
Subclasses should override this to determine how to generate Rays.
virtual void close()=0
unsigned long long int _ending_processor_crossings
Total number of processor crossings for Rays that finished on this processor.
std::vector< std::unordered_map< std::pair< const Elem *, unsigned short >, Point > > _threaded_cached_normals
Threaded cache for side normals that have been computed already during tracing.
void max(const T &r, T &o, Request &req) const
std::vector< std::size_t > _num_cached
Number of currently cached objects for Jacobian/residual for each thread.
std::chrono::steady_clock::duration _propagation_time
void mooseWarning(Args &&... args) const
bool _called_initial_setup
Whether or not we&#39;ve called initial setup - used to stop from late registration.
void verifyUniqueRays(const std::vector< std::shared_ptr< Ray >>::const_iterator begin, const std::vector< std::shared_ptr< Ray >>::const_iterator end, const std::string &error_suffix)
Verifies that the Rays in the given range are unique.
Real _total_distance
Total distance traveled by all Rays.
const bool & currentlyComputingJacobian() const
std::vector< std::shared_ptr< Ray > > _ray_bank
Cumulative Ray bank - stored only when _bank_rays_on_completion.
std::vector< unsigned long long int > _local_trace_ray_results
Cumulative results on this processor from the threaded TraceRay objects.
std::chrono::steady_clock::duration _generation_time
void registeredRaySetup()
Sets up the maps from Ray to associated RayTracingObjects if _use_ray_registration.
virtual void addCachedResidual(const THREAD_ID tid) override
std::chrono::steady_clock::duration _execution_time
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
unsigned int THREAD_ID
virtual void addCachedJacobian(const THREAD_ID tid) override

◆ executionTime()

Real RayTracingStudy::executionTime ( )
inlineinherited

Duration for execute() in seconds.

Definition at line 189 of file RayTracingStudy.h.

189 { return std::chrono::duration<Real>(_execution_time).count(); }
std::chrono::steady_clock::duration _execution_time

◆ executionTimeNano()

Real RayTracingStudy::executionTimeNano ( )
inlineinherited

Duration for execute() in nanoseconds.

Definition at line 193 of file RayTracingStudy.h.

194  {
195  return std::chrono::duration<Real, std::nano>(_execution_time).count();
196  }
std::chrono::steady_clock::duration _execution_time

◆ finalize()

virtual void RayTracingStudy::finalize ( )
inlineoverridevirtualinherited

Implements GeneralUserObject.

Definition at line 81 of file RayTracingStudy.h.

81 {}

◆ generateRays()

void RepeatableRayStudyBase::generateRays ( )
overrideprotectedvirtualinherited

Subclasses should override this to determine how to generate Rays.

This will be called within execute() and makes up the "generation phase" of the algorithm.

Implements RayTracingStudy.

Definition at line 57 of file RepeatableRayStudyBase.C.

58 {
59  // Initially, the user is to define the Rays that they want to trace by overriding
60  // defineRays() and filling into _rays within this method. These Rays are not
61  // the Rays that will actually be traced, they just serve as a template for
62  // Rays that will be put into the tracer to be traced.
63  //
64  // If the private parameter '_claim_after_define_rays' == true, it is assumed
65  // that the Rays that were filled into _rays from the overridden defineRays()
66  // do not have their starting element and incoming sides set. The Rays in _rays
67  // will be "claimed" later and communicated to the processors that will start them
68  // with their starting element set and incoming side set (if any). An example of this
69  // is in RepeatableRayStudy.
70  //
71  // If the private parameter '_claim_after_define_rays' == false, it is assumed
72  // that the Rays that were filled into _rays from the overridden defineRays():
73  // - Have their starting element and incoming side (if applicable) set and it is
74  // correct
75  // - Are on the processor that will start them (the processor that contains
76  // the starting element)
77  // At this point, the Rays in _rays will be also inserted into _local_rays
78  // because they are on the right processor with starting information set.
79  // An example of this is in LotsOfRaysRayStudy.
81  {
82  _should_define_rays = false;
83 
85  }
86 
88  {
89  _should_claim_rays = false;
90 
92  }
93 
94  // Reserve ahead of time how many Rays we are adding to the buffer
96 
97  // To make this study "repeatable", we will not trace the Rays that
98  // are ready to go in _local_rays. We will instead create new Rays
99  // that are duplicates of the ones in _local_rays, and trace those.
100  // This ensures that on multiple executions of this study, we always
101  // have the information to create the same Rays.
102  for (const auto & ray : _local_rays)
103  {
104  // This acquires a new ray that is copied from a Ray that has already
105  // been claimed to begin on this processor with the user-defined trajectory
106  std::shared_ptr<Ray> copied_ray = acquireCopiedRay(*ray);
107 
108  // This calls std::move() on the ray, which means that copied_ray in this context
109  // is no longer valid. We use the move method because copied_ray is a shared_ptr
110  // and otherwise we would increase the count as we add it to the buffer and also
111  // decrease the count once this goes out of scope.
112  moveRayToBuffer(copied_ray);
113  }
114 }
bool & _should_claim_rays
Whether or not we should call claimRays() on the next generateRays() (restartable) ...
bool & _should_define_rays
Whether or not we should call defineRays() on the next generateRays() Can be set to true in derived c...
void reserveRayBuffer(const std::size_t size)
Reserve size entires in the Ray buffer.
std::vector< std::shared_ptr< Ray > > & _local_rays
Storage for all of the Rays this processor is responsible for (restartable)
void moveRayToBuffer(std::shared_ptr< Ray > &ray)
Moves a ray to the buffer to be traced during generateRays().
std::shared_ptr< Ray > acquireCopiedRay(const Ray &ray)
Acquires a Ray that that is copied from another Ray within generateRays().

◆ generateReplicatedRayID()

RayID RayTracingStudy::generateReplicatedRayID ( )
protectedinherited

Generates a Ray ID that is replicated across all processors.

Definition at line 1754 of file RayTracingStudy.C.

Referenced by RayTracingStudy::acquireReplicatedRay().

1755 {
1756  return _replicated_next_ray_id++;
1757 }
RayID _replicated_next_ray_id
Storage for the next available replicated RayID, obtained via generateReplicatedRayID() ...

◆ generateUniqueRayID()

RayID RayTracingStudy::generateUniqueRayID ( const THREAD_ID  tid)
protectedvirtualinherited

Generates a unique RayID to be used for a Ray.

This is used internally when acquiring new Rays.

Definition at line 1729 of file RayTracingStudy.C.

Referenced by RayTracingStudy::acquireRay(), RayTracingStudy::acquireRayDuringTrace(), and RayTracingStudy::acquireUnsizedRay().

1730 {
1731  // Get the current ID to return
1732  const auto id = _threaded_next_ray_id[tid];
1733 
1734  // Advance so that the next call has the correct ID
1736 
1737  return id;
1738 }
unsigned long int RayID
Type for a Ray&#39;s ID.
Definition: Ray.h:44
unsigned int n_threads()
std::vector< RayID > _threaded_next_ray_id
Storage for the next available unique RayID, obtained via generateUniqueRayID()
processor_id_type n_processors() const

◆ generationTime()

Real RayTracingStudy::generationTime ( ) const
inlineinherited

Duration for creation of all Rays in seconds.

Definition at line 200 of file RayTracingStudy.h.

Referenced by PerProcessorRayTracingResultsVectorPostprocessor::execute().

200 { return std::chrono::duration<Real>(_generation_time).count(); }
std::chrono::steady_clock::duration _generation_time

◆ getBankedRay()

std::shared_ptr< Ray > RayTracingStudy::getBankedRay ( const RayID  ray_id) const
protectedinherited

Gets the Ray with the ID ray_id from the Ray bank.

If the Ray with ray_id is not found across all processors, this will error.

This will ONLY return a valid Ray (not a null shared_ptr) on the processor that has the Ray.

Definition at line 1381 of file RayTracingStudy.C.

Referenced by RayTracingStudy::getBankedRayDataInternal().

1382 {
1383  // This is only a linear search - can be improved on with a map in the future
1384  // if this is used on a larger scale
1385  std::shared_ptr<Ray> ray;
1386  for (const std::shared_ptr<Ray> & possible_ray : rayBank())
1387  if (possible_ray->id() == ray_id)
1388  {
1389  ray = possible_ray;
1390  break;
1391  }
1392 
1393  // Make sure one and only one processor has the Ray
1394  unsigned int have_ray = ray ? 1 : 0;
1395  _communicator.sum(have_ray);
1396  if (have_ray == 0)
1397  mooseError("Could not find a Ray with the ID ", ray_id, " in the Ray banks.");
1398 
1399  // This should never happen... but let's make sure
1400  mooseAssert(have_ray == 1, "Multiple rays with the same ID were found in the Ray banks");
1401 
1402  return ray;
1403 }
const std::vector< std::shared_ptr< Ray > > & rayBank() const
Get the Ray bank.
const Parallel::Communicator & _communicator
void mooseError(Args &&... args) const

◆ getBankedRayAuxData()

RayData RayTracingStudy::getBankedRayAuxData ( const RayID  ray_id,
const RayDataIndex  index 
) const
inherited

Gets the data value for a banked ray with a given ID.

This will return the value replicated across all processors

Definition at line 1425 of file RayTracingStudy.C.

Referenced by RayDataValue::getValue().

1426 {
1427  return getBankedRayDataInternal(ray_id, index, /* aux = */ true);
1428 }
RayData getBankedRayDataInternal(const RayID ray_id, const RayDataIndex index, const bool aux) const
Internal method for getting the value (replicated across all processors) in a Ray&#39;s data or aux data ...

◆ getBankedRayData()

RayData RayTracingStudy::getBankedRayData ( const RayID  ray_id,
const RayDataIndex  index 
) const
inherited

Gets the data value for a banked ray with a given ID.

This will return the value replicated across all processors

Definition at line 1419 of file RayTracingStudy.C.

Referenced by RayDataValue::getValue(), and RayIntegralValue::getValue().

1420 {
1421  return getBankedRayDataInternal(ray_id, index, /* aux = */ false);
1422 }
RayData getBankedRayDataInternal(const RayID ray_id, const RayDataIndex index, const bool aux) const
Internal method for getting the value (replicated across all processors) in a Ray&#39;s data or aux data ...

◆ getCachedTraces()

const std::vector<TraceData>& RayTracingStudy::getCachedTraces ( ) const
inlineinherited

Get the cached trace data structure.

Definition at line 595 of file RayTracingStudy.h.

Referenced by RayTracingMeshOutput::buildIDMap(), RayTracingMeshOutput::buildSegmentMesh(), RayTracingMeshOutput::fillFields(), and RayTracingMeshOutput::output().

595 { return _cached_traces; }
std::vector< TraceData > _cached_traces
Storage for the cached traces.

◆ getElemNormals()

virtual const Point* RayTracingStudy::getElemNormals ( const Elem *  ,
const THREAD_ID   
)
inlinevirtualinherited

Gets the outward normals for a given element.

Returns a pointer to the normal for the zeroth side.

Reimplemented in BackfaceCullingStudyTest.

Definition at line 531 of file RayTracingStudy.h.

Referenced by TraceRay::moveThroughNeighbor(), RayTracingStudyTest::RayTracingStudyTest(), and TraceRay::trace().

532  {
533  mooseError("Unimplemented element normal caching in ", type(), "::getElemNormals()");
534  }
const std::string & type() const
void mooseError(Args &&... args) const

◆ getInternalSidesets() [1/2]

const std::vector<std::vector<BoundaryID> >& RayTracingStudy::getInternalSidesets ( const Elem *  elem) const
inherited

Get the internal sidesets (that have RayBC(s)) for each side for a given element.

This will be empty if the elem does not have any internal sidesets that have RayBC(s)

Referenced by TraceRay::applyOnInternalBoundary().

◆ getInternalSidesets() [2/2]

const std::set<BoundaryID>& RayTracingStudy::getInternalSidesets ( ) const
inlineinherited

Gets the internal sidesets (that have RayBCs) within the local domain.

Definition at line 459 of file RayTracingStudy.h.

Referenced by ViewFactorRayStudy::initialSetup().

459 { return _internal_sidesets; }
std::set< BoundaryID > _internal_sidesets
The BoundaryIDs on the local mesh that have internal RayBCs.

◆ getRayAuxDataIndex()

RayDataIndex RayTracingStudy::getRayAuxDataIndex ( const std::string &  name,
const bool  graceful = false 
) const
inherited

Gets the index associated with a registered value in the Ray aux data.

Parameters
nameThe value name to get the index of
gracefulWhether or not to exit gracefully if none is found (return INVALID_RAY_DATA_INDEX)
Returns
The index for the value

Definition at line 1214 of file RayTracingStudy.C.

Referenced by RayDataValue::initialize(), RayTracingStudyTest::RayTracingStudyTest(), and RayTracingMeshOutput::setupEquationSystem().

1216 {
1217  return getRayDataIndexInternal(name, /* aux = */ true, graceful);
1218 }
const std::string & name() const
RayDataIndex getRayDataIndexInternal(const std::string &name, const bool aux, const bool graceful) const
Internal method for getting the index of Ray data or Ray aux data.

◆ getRayAuxDataIndices()

std::vector< RayDataIndex > RayTracingStudy::getRayAuxDataIndices ( const std::vector< std::string > &  names,
const bool  graceful = false 
) const
inherited

Gets the indices associated with registered values in the Ray aux data.

Parameters
namesThe value names to get the indices of
gracefulWhether or not to exit gracefully if none is found (index is filled with INVALID_RAY_DATA_INDEX)
Returns
The indices for the values

Definition at line 1221 of file RayTracingStudy.C.

1223 {
1224  return getRayDataIndicesInternal(names, /* aux = */ true, graceful);
1225 }
std::vector< RayDataIndex > getRayDataIndicesInternal(const std::vector< std::string > &names, const bool aux, const bool graceful) const
Internal method for getting the indicies of Ray data or Ray aux data.

◆ getRayAuxDataName()

const std::string & RayTracingStudy::getRayAuxDataName ( const RayDataIndex  index) const
inherited

Gets the name associated with a registered value in the Ray aux data.

Parameters
indexThe index to get the name of
Returns
The name associated with index

Definition at line 1228 of file RayTracingStudy.C.

Referenced by Ray::getInfo().

1229 {
1230  return getRayDataNameInternal(index, /* aux = */ true);
1231 }
const std::string & getRayDataNameInternal(const RayDataIndex index, const bool aux) const
Internal method for getting the name of Ray data or Ray aux data.

◆ getRayAuxDataNames()

std::vector<std::string> RayTracingStudy::getRayAuxDataNames ( const std::vector< RayDataIndex > &  indices) const
inherited

Gets the names associated with registered values in the Ray aux data.

Parameters
indicesThe indices to get the names of
Returns
The associated names

◆ getRayBCs() [1/4]

void RayTracingStudy::getRayBCs ( std::vector< RayBoundaryConditionBase *> &  result,
BoundaryID  id,
THREAD_ID  tid 
)
inherited

Fills the active RayBCs associated with this study and a boundary into result.

Definition at line 1292 of file RayTracingStudy.C.

Referenced by RayTracingStudy::dependencyChecks(), RayTracingStudy::getRayBCs(), ViewFactorRayStudy::initialSetup(), RayTracingStudy::internalSidesetSetup(), TraceRay::onBoundary(), RayTracingStudy::periodicBoundaryChecks(), and RayTracingStudyTest::RayTracingStudyTest().

1295 {
1296  // If the cache doesn't have any attributes yet, it means that we haven't set
1297  // the conditions yet. We do this so that it can be generated on the fly on first use.
1298  if (!_threaded_cache_ray_bc[tid].numAttribs())
1299  {
1300  if (!_called_initial_setup)
1301  mooseError("Should not call getRayBCs() before initialSetup()");
1302 
1303  auto query = _fe_problem.theWarehouse()
1304  .query()
1305  .condition<AttribRayTracingStudy>(this)
1306  .condition<AttribSystem>("RayBoundaryCondition")
1307  .condition<AttribThread>(tid);
1308  _threaded_cache_ray_bc[tid] = query.clone();
1309  }
1310 
1311  _threaded_cache_ray_bc[tid].queryInto(result, std::make_tuple(id, false));
1312 }
Attribute for the RayTracingStudy a RayTracingObject is associated with.
FEProblemBase & _fe_problem
TheWarehouse & theWarehouse() const
std::vector< TheWarehouse::QueryCache< AttribBoundaries > > _threaded_cache_ray_bc
Threaded cached boundary query for RayBC objects pertaining to this study.
query_obj query
Query query()
bool _called_initial_setup
Whether or not we&#39;ve called initial setup - used to stop from late registration.
void mooseError(Args &&... args) const

◆ getRayBCs() [2/4]

template<typename T >
void RayTracingStudy::getRayBCs ( std::vector< T *> &  result,
const std::vector< BoundaryID > &  ids,
THREAD_ID  tid 
)
inlineinherited

Fills the active RayBCs associated with this study and boundaries result.

Definition at line 376 of file RayTracingStudy.h.

377  {
379  .query()
380  .condition<AttribRayTracingStudy>(this)
381  .condition<AttribSystem>("RayBoundaryCondition")
382  .condition<AttribBoundaries>(ids)
383  .condition<AttribThread>(tid)
384  .queryInto(result);
385  }
Attribute for the RayTracingStudy a RayTracingObject is associated with.
FEProblemBase & _fe_problem
TheWarehouse & theWarehouse() const
Query query()

◆ getRayBCs() [3/4]

template<typename T >
void RayTracingStudy::getRayBCs ( std::vector< T *> &  result,
THREAD_ID  tid 
)
inlineinherited

Fills the active RayBCs associated with this study into result.

Definition at line 390 of file RayTracingStudy.h.

391  {
393  .query()
394  .condition<AttribRayTracingStudy>(this)
395  .condition<AttribSystem>("RayBoundaryCondition")
396  .condition<AttribThread>(tid)
397  .queryInto(result);
398  }
Attribute for the RayTracingStudy a RayTracingObject is associated with.
FEProblemBase & _fe_problem
TheWarehouse & theWarehouse() const
Query query()

◆ getRayBCs() [4/4]

void RayTracingStudy::getRayBCs ( std::vector< RayBoundaryConditionBase *> &  result,
const std::vector< TraceRayBndElement > &  bnd_elems,
THREAD_ID  tid,
RayID  ray_id 
)
virtualinherited

Fills the active RayBCs associated with thie study, boundary elements, and potentially Ray into result.

This is purposely virtual because it allows derived studies to optimize the retrieval of RayBCs during the trace in TraceRay.

Definition at line 1315 of file RayTracingStudy.C.

1319 {
1320  // No Ray registration: no need to sift through objects
1321  if (!_use_ray_registration)
1322  {
1323  if (bnd_elems.size() == 1)
1324  getRayBCs(result, bnd_elems[0].bnd_id, tid);
1325  else
1326  {
1327  std::vector<BoundaryID> bnd_ids(bnd_elems.size());
1328  for (MooseIndex(bnd_elems.size()) i = 0; i < bnd_elems.size(); ++i)
1329  bnd_ids[i] = bnd_elems[i].bnd_id;
1330  getRayBCs(result, bnd_ids, tid);
1331  }
1332  }
1333  // Has Ray registration: only pick the objects associated with ray_id
1334  else
1335  {
1336  // Get all of the RayBCs on these boundaries
1337  std::vector<RayBoundaryConditionBase *> rbcs;
1338  if (bnd_elems.size() == 1)
1339  getRayBCs(rbcs, bnd_elems[0].bnd_id, tid);
1340  else
1341  {
1342  std::vector<BoundaryID> bnd_ids(bnd_elems.size());
1343  for (MooseIndex(bnd_elems.size()) i = 0; i < bnd_elems.size(); ++i)
1344  bnd_ids[i] = bnd_elems[i].bnd_id;
1345  getRayBCs(rbcs, bnd_ids, tid);
1346  }
1347 
1348  // The RayTracingObjects associated with this ray
1349  mooseAssert(ray_id < _threaded_ray_object_registration[tid].size(), "Not in registration");
1350  const auto & ray_id_rtos = _threaded_ray_object_registration[tid][ray_id];
1351 
1352  // The result is the union of all of the kernels and the objects associated with this Ray
1353  result.clear();
1354  for (auto rbc : rbcs)
1355  if (ray_id_rtos.count(rbc))
1356  result.push_back(rbc);
1357  }
1358 }
std::vector< std::vector< std::set< const RayTracingObject * > > > _threaded_ray_object_registration
Threaded storage for all of the RayTracingObjects associated with a single Ray.
void getRayBCs(std::vector< RayBoundaryConditionBase *> &result, BoundaryID id, THREAD_ID tid)
Fills the active RayBCs associated with this study and a boundary into result.
const bool _use_ray_registration
Whether or not to use Ray registration.

◆ getRayDataIndex()

RayDataIndex RayTracingStudy::getRayDataIndex ( const std::string &  name,
const bool  graceful = false 
) const
inherited

Gets the index associated with a registered value in the Ray data.

Parameters
nameThe value name to get the index of
gracefulWhether or not to exit gracefully if none is found (return INVALID_RAY_DATA_INDEX)
Returns
The index for the value

Definition at line 1183 of file RayTracingStudy.C.

Referenced by RayDataValue::initialize(), RayIntegralValue::initialize(), RayTracingStudyTest::RayTracingStudyTest(), and RayTracingMeshOutput::setupEquationSystem().

1184 {
1185  return getRayDataIndexInternal(name, /* aux = */ false, graceful);
1186 }
const std::string & name() const
RayDataIndex getRayDataIndexInternal(const std::string &name, const bool aux, const bool graceful) const
Internal method for getting the index of Ray data or Ray aux data.

◆ getRayDataIndices()

std::vector< RayDataIndex > RayTracingStudy::getRayDataIndices ( const std::vector< std::string > &  names,
const bool  graceful = false 
) const
inherited

Gets the indices associated with registered values in the Ray data.

Parameters
namesThe value names to get the indices of
gracefulWhether or not to exit gracefully if none is found (index is filled with INVALID_RAY_DATA_INDEX)
Returns
The indices for the values

Definition at line 1189 of file RayTracingStudy.C.

1191 {
1192  return getRayDataIndicesInternal(names, /* aux = */ false, graceful);
1193 }
std::vector< RayDataIndex > getRayDataIndicesInternal(const std::vector< std::string > &names, const bool aux, const bool graceful) const
Internal method for getting the indicies of Ray data or Ray aux data.

◆ getRayDataName()

const std::string & RayTracingStudy::getRayDataName ( const RayDataIndex  index) const
inherited

Gets the name associated with a registered value in the Ray data.

Parameters
indexThe index to get the name of
Returns
The name associated with index

Definition at line 1196 of file RayTracingStudy.C.

Referenced by Ray::getInfo(), and RayTracingStudyTest::RayTracingStudyTest().

1197 {
1198  return getRayDataNameInternal(index, /* aux = */ false);
1199 }
const std::string & getRayDataNameInternal(const RayDataIndex index, const bool aux) const
Internal method for getting the name of Ray data or Ray aux data.

◆ getRayDataNames()

std::vector<std::string> RayTracingStudy::getRayDataNames ( const std::vector< RayDataIndex > &  indices) const
inherited

Gets the names associated with registered values in the Ray data.

Parameters
indicesThe indices to get the names of
Returns
The associated names

◆ getRayKernels() [1/3]

void RayTracingStudy::getRayKernels ( std::vector< RayKernelBase *> &  result,
SubdomainID  id,
THREAD_ID  tid 
)
inherited

Fills the active RayKernels associated with this study and a block into result.

Definition at line 1242 of file RayTracingStudy.C.

Referenced by RayTracingStudy::coverageChecks(), RayTracingStudy::dependencyChecks(), RayTracingStudy::getRayKernels(), RayTracingStudy::hasRayKernels(), RayTracingStudy::initialSetup(), RayTracingStudyTest::RayTracingStudyTest(), RayTracingStudy::segmentSubdomainSetup(), and RayTracingStudy::zeroAuxVariables().

1243 {
1244  // If the cache doesn't have any attributes yet, it means that we haven't set
1245  // the conditions yet. We do this so that it can be generated on the fly on first use.
1246  if (!_threaded_cache_ray_kernel[tid].numAttribs())
1247  {
1248  if (!_called_initial_setup)
1249  mooseError("Should not call getRayKernels() before initialSetup()");
1250 
1251  auto query = _fe_problem.theWarehouse()
1252  .query()
1253  .condition<AttribRayTracingStudy>(this)
1254  .condition<AttribSystem>("RayKernel")
1255  .condition<AttribThread>(tid);
1256  _threaded_cache_ray_kernel[tid] = query.clone();
1257  }
1258 
1259  _threaded_cache_ray_kernel[tid].queryInto(result, id);
1260 }
Attribute for the RayTracingStudy a RayTracingObject is associated with.
FEProblemBase & _fe_problem
TheWarehouse & theWarehouse() const
std::vector< TheWarehouse::QueryCache< AttribSubdomains > > _threaded_cache_ray_kernel
Threaded cached subdomain query for RayKernelBase objects pertaining to this study.
query_obj query
Query query()
bool _called_initial_setup
Whether or not we&#39;ve called initial setup - used to stop from late registration.
void mooseError(Args &&... args) const

◆ getRayKernels() [2/3]

template<typename T >
void RayTracingStudy::getRayKernels ( std::vector< T *> &  result,
THREAD_ID  tid 
)
inlineinherited

Fills the active RayKernels associated with this study into result.

Definition at line 354 of file RayTracingStudy.h.

355  {
357  .query()
358  .condition<AttribRayTracingStudy>(this)
359  .condition<AttribSystem>("RayKernel")
360  .condition<AttribThread>(tid)
361  .queryInto(result);
362  }
Attribute for the RayTracingStudy a RayTracingObject is associated with.
FEProblemBase & _fe_problem
TheWarehouse & theWarehouse() const
Query query()

◆ getRayKernels() [3/3]

void RayTracingStudy::getRayKernels ( std::vector< RayKernelBase *> &  result,
SubdomainID  id,
THREAD_ID  tid,
RayID  ray_id 
)
inherited

Fills the active RayKernels associeted with this study, block, and potentially Ray into result.

Definition at line 1263 of file RayTracingStudy.C.

1267 {
1268  // No Ray registration: no need to sift through objects
1269  if (!_use_ray_registration)
1270  {
1271  getRayKernels(result, id, tid);
1272  }
1273  // Has Ray registration: only pick the objects associated with ray_id
1274  else
1275  {
1276  // Get all of the kernels on this block
1277  std::vector<RayKernelBase *> rkbs;
1278  getRayKernels(rkbs, id, tid);
1279 
1280  // The RayTracingObjects associated with this ray
1281  const auto & ray_id_rtos = _threaded_ray_object_registration[tid][ray_id];
1282 
1283  // The result is the union of all of the kernels and the objects associated with this Ray
1284  result.clear();
1285  for (auto rkb : rkbs)
1286  if (ray_id_rtos.count(rkb))
1287  result.push_back(rkb);
1288  }
1289 }
void getRayKernels(std::vector< RayKernelBase *> &result, SubdomainID id, THREAD_ID tid)
Fills the active RayKernels associated with this study and a block into result.
std::vector< std::vector< std::set< const RayTracingObject * > > > _threaded_ray_object_registration
Threaded storage for all of the RayTracingObjects associated with a single Ray.
const bool _use_ray_registration
Whether or not to use Ray registration.

◆ getRayTracingObjects()

std::vector< RayTracingObject * > RayTracingStudy::getRayTracingObjects ( )
protectedinherited

Gets all of the currently active RayTracingObjects.

Definition at line 1361 of file RayTracingStudy.C.

Referenced by RayTracingStudy::executeStudy(), RayTracingStudy::initialSetup(), RayTracingStudy::jacobianSetup(), RayTracingStudy::registeredRaySetup(), RayTracingStudy::residualSetup(), and RayTracingStudy::timestepSetup().

1362 {
1363  std::vector<RayTracingObject *> result;
1364  _fe_problem.theWarehouse().query().condition<AttribRayTracingStudy>(this).queryInto(result);
1365  return result;
1366 }
Attribute for the RayTracingStudy a RayTracingObject is associated with.
FEProblemBase & _fe_problem
TheWarehouse & theWarehouse() const
Query query()

◆ getSideNormal()

const Point & RayTracingStudy::getSideNormal ( const Elem elem,
const unsigned short  side,
const THREAD_ID  tid 
)
virtualinherited

Get the outward normal for a given element side.

Definition at line 1654 of file RayTracingStudy.C.

Referenced by LotsOfRaysRayStudy::defineRays(), BackfaceCullingStudyTest::generateNormals(), ViewFactorRayStudy::generateRays(), TraceRay::getPointNeighbors(), ReflectRayBC::onBoundary(), RayTracingStudy::sideIsIncoming(), and TraceRay::trace().

1655 {
1656  std::unordered_map<std::pair<const Elem *, unsigned short>, Point> & cache =
1658 
1659  // See if we've already cached this side normal
1660  const auto elem_side_pair = std::make_pair(elem, side);
1661  const auto search = cache.find(elem_side_pair);
1662 
1663  // Haven't cached this side normal: compute it and then cache it
1664  if (search == cache.end())
1665  {
1666  _threaded_fe_face[tid]->reinit(elem, side);
1667  const auto & normal = _threaded_fe_face[tid]->get_normals()[0];
1668  cache.emplace(elem_side_pair, normal);
1669  return normal;
1670  }
1671 
1672  // Have cached this side normal: simply return it
1673  return search->second;
1674 }
std::vector< std::unique_ptr< libMesh::FEBase > > _threaded_fe_face
Face FE used for computing face normals for each thread.
std::vector< std::unordered_map< std::pair< const Elem *, unsigned short >, Point > > _threaded_cached_normals
Threaded cache for side normals that have been computed already during tracing.

◆ hasInternalSidesets()

bool RayTracingStudy::hasInternalSidesets ( ) const
inlineinherited

Whether or not the local mesh has internal sidesets that have RayBCs on them.

NOTE: if useInternalSidesets() == false, this will be false even if the mesh does have internal sidesets

Definition at line 449 of file RayTracingStudy.h.

Referenced by TraceRay::applyOnInternalBoundary(), and TraceRay::trace().

449 { return _internal_sidesets.size(); }
std::set< BoundaryID > _internal_sidesets
The BoundaryIDs on the local mesh that have internal RayBCs.

◆ hasRayAuxData()

bool RayTracingStudy::hasRayAuxData ( ) const
inlineinherited

Whether or not any Ray aux data are registered.

Definition at line 336 of file RayTracingStudy.h.

336 { return _ray_aux_data_names.size(); }
std::vector< std::string > _ray_aux_data_names
The names for each Ray aux data entry.

◆ hasRayData()

bool RayTracingStudy::hasRayData ( ) const
inlineinherited

Whether or not any Ray data are registered.

Definition at line 276 of file RayTracingStudy.h.

Referenced by RayTracingMeshOutput::fillFields().

276 { return _ray_data_names.size(); }
std::vector< std::string > _ray_data_names
The names for each Ray data entry.

◆ hasRayKernels()

bool RayTracingStudy::hasRayKernels ( const THREAD_ID  tid)
inherited

Whether or not there are currently any active RayKernel objects.

Definition at line 1234 of file RayTracingStudy.C.

Referenced by ViewFactorRayStudy::initialSetup(), and TraceRay::preExecute().

1235 {
1236  std::vector<RayKernelBase *> result;
1237  getRayKernels(result, tid);
1238  return result.size();
1239 }
void getRayKernels(std::vector< RayKernelBase *> &result, SubdomainID id, THREAD_ID tid)
Fills the active RayKernels associated with this study and a block into result.

◆ hasSameLevelActiveElems()

bool RayTracingStudy::hasSameLevelActiveElems ( ) const
inlineinherited

Whether or not the mesh has active elements of the same level.

Use this over sameLevelActiveElems(), which is for internally setting _has_same_level_active_elems

Definition at line 475 of file RayTracingStudy.h.

Referenced by TraceRay::applyOnInternalBoundary(), and TraceRay::trace().

bool _has_same_level_active_elems
Whether or not the mesh has active elements of the same level.

◆ initialize()

virtual void RayTracingStudy::initialize ( )
inlineoverridevirtualinherited

Implements GeneralUserObject.

Definition at line 80 of file RayTracingStudy.h.

80 {}

◆ initialSetup()

void RayTracingStudy::initialSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Reimplemented in BackfaceCullingStudyTest, and ViewFactorRayStudy.

Definition at line 226 of file RayTracingStudy.C.

Referenced by ViewFactorRayStudy::initialSetup(), and BackfaceCullingStudyTest::initialSetup().

227 {
228  // Keep track of initialSetup call to avoid registration of various things
229  _called_initial_setup = true;
230 
231  // Sets up a local index for each elem this proc knows about
233 
234  // Check for RayKernel coverage
235  coverageChecks();
236 
237  // Make sure the dependencies exist, if any
239 
240  // Check for traceable element types
242 
243  // Check for sane periodic boundaries
245 
246  // Setup for internal sidesets
248 
250 
251  // Setup approximate hmax for each subdomain
253 
254  // Call initial setup on all of the objects
255  for (auto & rto : getRayTracingObjects())
256  rto->initialSetup();
257 
258  // Check for proper exec flags with RayKernels
259  std::vector<RayKernelBase *> ray_kernels;
260  getRayKernels(ray_kernels, 0);
261  for (const auto & rkb : ray_kernels)
262  if (dynamic_cast<RayKernel *>(rkb) && !_execute_enum.isValueSet(EXEC_PRE_KERNELS))
263  mooseError("This study has RayKernel objects that contribute to residuals and Jacobians.",
264  "\nIn this case, the study must use the execute_on = PRE_KERNELS");
265 
266  // Build 1D quadrature rule for along a segment
268  QBase::build(QGAUSS, 1, _fe_problem.getSystemBase(_sys.number()).getMinQuadratureOrder());
269 }
void getRayKernels(std::vector< RayKernelBase *> &result, SubdomainID id, THREAD_ID tid)
Fills the active RayKernels associated with this study and a block into result.
void internalSidesetSetup()
Does the setup for internal sidesets.
void periodicBoundaryChecks()
Check for overlapping PeriodicRayBC boundaries and check for cases in which ghosting may not be suffi...
void traceableMeshChecks()
Check for if all of the element types in the mesh are supported by ray tracing.
FEProblemBase & _fe_problem
void nonPlanarSideSetup()
Sets up the caching of whether or not each element side is non-planar, which is stored in _non_planar...
void coverageChecks()
Perform coverage checks (coverage of RayMaterials and RayKernels, if enabled)
std::vector< RayTracingObject * > getRayTracingObjects()
Gets all of the currently active RayTracingObjects.
void dependencyChecks()
Perform checks to see if the listed dependencies in the RayTracingObjects exist.
bool isValueSet(const std::string &value) const
unsigned int number() const
const ExecFlagEnum & _execute_enum
SystemBase & _sys
virtual const SystemBase & getSystemBase(const unsigned int sys_num) const
bool _called_initial_setup
Whether or not we&#39;ve called initial setup - used to stop from late registration.
void mooseError(Args &&... args) const
void localElemIndexSetup()
Sets up the _elem_index_helper, which is used for obtaining a contiguous index for all elements that ...
void subdomainHMaxSetup()
Caches the hmax for all elements in each subdomain.
std::unique_ptr< libMesh::QBase > _segment_qrule
Quadrature rule for laying points across a 1D ray segment.

◆ initThreadedCachedTrace()

TraceData & RayTracingStudy::initThreadedCachedTrace ( const std::shared_ptr< Ray > &  ray,
THREAD_ID  tid 
)
inherited

Initialize a Ray in the threaded cached trace map to be filled with segments.

Definition at line 1513 of file RayTracingStudy.C.

Referenced by TraceRay::trace().

1514 {
1515  mooseAssert(shouldCacheTrace(ray), "Not caching trace");
1516  mooseAssert(currentlyPropagating(), "Should only use while tracing");
1517 
1518  _threaded_cached_traces[tid].emplace_back(ray);
1519  return _threaded_cached_traces[tid].back();
1520 }
std::vector< std::vector< TraceData > > _threaded_cached_traces
The threaded storage for cached traces.
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
virtual bool shouldCacheTrace(const std::shared_ptr< Ray > &) const
Virtual that allows for selection in if a Ray should be cached or not (only used when _cache_traces)...

◆ isRectangularDomain()

bool RayTracingStudy::isRectangularDomain ( ) const
inherited

Whether or not the domain is rectangular (if it is prefectly encompassed by its bounding box)

Definition at line 1705 of file RayTracingStudy.C.

Referenced by LotsOfRaysRayStudy::LotsOfRaysRayStudy(), and TraceRay::preExecute().

1706 {
1707  Real bbox_volume = 1;
1708  for (unsigned int d = 0; d < _mesh.dimension(); ++d)
1709  bbox_volume *= std::abs(_b_box.max()(d) - _b_box.min()(d));
1710 
1711  return MooseUtils::absoluteFuzzyEqual(bbox_volume, totalVolume(), TOLERANCE);
1712 }
Real totalVolume() const
Get the current total volume of the domain.
MooseMesh & _mesh
The Mesh.
virtual unsigned int dimension() const
const Point & min() const
libMesh::BoundingBox _b_box
Nodal bounding box for the domain.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & max() const

◆ jacobianSetup()

void RayTracingStudy::jacobianSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 282 of file RayTracingStudy.C.

283 {
284  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
285  mooseAssert(_num_cached[tid] == 0, "Cached residuals/Jacobians not empty");
286 
287  for (auto & rto : getRayTracingObjects())
288  rto->jacobianSetup();
289 }
unsigned int n_threads()
std::vector< RayTracingObject * > getRayTracingObjects()
Gets all of the currently active RayTracingObjects.
std::vector< std::size_t > _num_cached
Number of currently cached objects for Jacobian/residual for each thread.
unsigned int THREAD_ID

◆ localTraceRayResult()

unsigned long long int RayTracingStudy::localTraceRayResult ( const int  result) const
inlineinherited

Definition at line 174 of file RayTracingStudy.h.

Referenced by PerProcessorRayTracingResultsVectorPostprocessor::execute().

175  {
176  return _local_trace_ray_results[result];
177  }
std::vector< unsigned long long int > _local_trace_ray_results
Cumulative results on this processor from the threaded TraceRay objects.

◆ looseBoundingBox()

const BoundingBox& RayTracingStudy::looseBoundingBox ( ) const
inlineinherited

Get the loose nodal bounding box for the domain.

BoundingBox::contains_point does not have a tolerance, so we need to stretch the box a little bit for some contains_point checks.

Definition at line 429 of file RayTracingStudy.h.

Referenced by Ray::setStart(), and Ray::setStartingEndPoint().

429 { return _loose_b_box; }
libMesh::BoundingBox _loose_b_box
Loose nodal bounding box for the domain.

◆ maxIntersections()

unsigned int RayTracingStudy::maxIntersections ( ) const
inlineinherited

Max number of intersections for a Ray.

Definition at line 159 of file RayTracingStudy.h.

159 { return _max_intersections; }
unsigned int _max_intersections
Max number of intersections for a single Ray.

◆ maxProcessorCrossings()

unsigned int RayTracingStudy::maxProcessorCrossings ( ) const
inlineinherited

Max number of processor crossings for all Rays.

Definition at line 142 of file RayTracingStudy.h.

Referenced by RayTracingStudyResult::getValue().

142 { return _max_processor_crossings; }
unsigned int _max_processor_crossings
Max number of processor crossings for all Rays.

◆ maxTrajectoryChanges()

unsigned int RayTracingStudy::maxTrajectoryChanges ( ) const
inlineinherited

Max number of trajectory changes for a Ray.

Definition at line 163 of file RayTracingStudy.h.

163 { return _max_trajectory_changes; }
unsigned int _max_trajectory_changes
Max number of trajectory changes for a single Ray.

◆ mesh()

MooseMesh& RayTracingStudy::mesh ( )
inlineinherited
Returns
A reference to the MooseMesh associated with this study.

Definition at line 520 of file RayTracingStudy.h.

520 { return _mesh; }
MooseMesh & _mesh
The Mesh.

◆ meshBase()

MeshBase& RayTracingStudy::meshBase ( ) const
inlineinherited

◆ meshChanged()

void RepeatableRayStudyBase::meshChanged ( )
overrideprotectedvirtualinherited

Reimplemented from RayTracingStudy.

Reimplemented in BackfaceCullingStudyTest.

Definition at line 117 of file RepeatableRayStudyBase.C.

Referenced by BackfaceCullingStudyTest::meshChanged().

118 {
120 
121  // Need to reclaim after this
122  _should_claim_rays = true;
123 
124  // Invalidate all of the old starting info because we can't be sure those elements still exist
125  for (const auto & ray : _rays)
126  {
127  ray->invalidateStartingElem();
128  ray->invalidateStartingIncomingSide();
129  }
130  for (const auto & ray : _local_rays)
131  {
132  ray->invalidateStartingElem();
133  ray->invalidateStartingIncomingSide();
134  }
135 }
bool & _should_claim_rays
Whether or not we should call claimRays() on the next generateRays() (restartable) ...
virtual void meshChanged() override
std::vector< std::shared_ptr< Ray > > & _local_rays
Storage for all of the Rays this processor is responsible for (restartable)
std::vector< std::shared_ptr< Ray > > & _rays
Vector of Rays that the user will fill into in defineRays() (restartable)

◆ moveRaysToBuffer()

void RayTracingStudy::moveRaysToBuffer ( std::vector< std::shared_ptr< Ray >> &  rays)
protectedinherited

Moves rays to the buffer to be traced during generateRays().

This moves the rays into the buffer (with std::move), therefore all valid rays in rays will be nullptr after this call.

Definition at line 1619 of file RayTracingStudy.C.

Referenced by TestPICRayStudy::generateRays(), TestReuseRaysStudy::generateRays(), and TestTransientRaysStudy::generateRays().

1620 {
1621  mooseAssert(currentlyGenerating(), "Can only use while generating");
1622 #ifndef NDEBUG
1623  for (const std::shared_ptr<Ray> & ray : rays)
1624  {
1625  mooseAssert(ray, "Null ray");
1626  mooseAssert(ray->shouldContinue(), "Ray is not continuing");
1627  }
1628 #endif
1629 
1630  _parallel_ray_study->moveWorkToBuffer(rays, /* tid = */ 0);
1631 }
bool currentlyGenerating() const
Whether or not the study is generating.
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.

◆ moveRayToBuffer()

void RayTracingStudy::moveRayToBuffer ( std::shared_ptr< Ray > &  ray)
protectedinherited

Moves a ray to the buffer to be traced during generateRays().

This moves the Ray into the buffer (with std::move), therefore ray will be nullptr after this call.

Definition at line 1609 of file RayTracingStudy.C.

Referenced by RayTracingStudyTest::generateRays(), StationaryRayStudyTest::generateRays(), TestReuseRaysStudy::generateRays(), TestTransientRaysStudy::generateRays(), RepeatableRayStudyBase::generateRays(), and ViewFactorRayStudy::generateRays().

1610 {
1611  mooseAssert(currentlyGenerating(), "Can only use while generating");
1612  mooseAssert(ray, "Null ray");
1613  mooseAssert(ray->shouldContinue(), "Ray is not continuing");
1614 
1615  _parallel_ray_study->moveWorkToBuffer(ray, /* tid = */ 0);
1616 }
bool currentlyGenerating() const
Whether or not the study is generating.
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.

◆ moveRayToBufferDuringTrace()

void RayTracingStudy::moveRayToBufferDuringTrace ( std::shared_ptr< Ray > &  ray,
const THREAD_ID  tid,
const AcquireMoveDuringTraceKey  
)
inherited

INTERNAL method for moving a Ray into the buffer during tracing.

You should not and cannot use this API. It is protected by the AcquireMoveDuringTraceKey, which is only constructable by RayKernelBase and RayBoundaryConditionBase.

Definition at line 1634 of file RayTracingStudy.C.

Referenced by RayBoundaryConditionBase::moveRayToBuffer(), and RayKernelBase::moveRayToBuffer().

1637 {
1638  mooseAssert(ray, "Null ray");
1639  mooseAssert(currentlyPropagating(), "Can only use while tracing");
1640 
1641  _parallel_ray_study->moveWorkToBuffer(ray, tid);
1642 }
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)

◆ onCompleteRay()

void RayTracingStudy::onCompleteRay ( const std::shared_ptr< Ray > &  ray)
virtualinherited

Entry point for acting on a ray when it is completed (shouldContinue() == false)

Reimplemented in TestRayDataStudy.

Definition at line 1058 of file RayTracingStudy.C.

Referenced by TestRayDataStudy::onCompleteRay(), and ParallelRayStudy::postExecuteChunk().

1059 {
1060  mooseAssert(currentlyPropagating(), "Should only be called during Ray propagation");
1061 
1062  _ending_processor_crossings += ray->processorCrossings();
1064  std::max(_ending_max_processor_crossings, ray->processorCrossings());
1065  _ending_intersections += ray->intersections();
1066  _ending_max_intersections = std::max(_ending_max_intersections, ray->intersections());
1068  std::max(_ending_max_trajectory_changes, ray->trajectoryChanges());
1069  _ending_distance += ray->distance();
1070 
1071 #ifdef NDEBUG
1072  // In non-opt modes, we will always bank the Rays for debugging
1074 #endif
1075  _ray_bank.emplace_back(ray);
1076 }
unsigned long long int _ending_intersections
Total number of Ray/element intersections for Rays that finished on this processor.
Real _ending_distance
Total distance traveled by Rays that end on this processor.
const bool _bank_rays_on_completion
Whether or not to bank rays on completion.
unsigned int _ending_max_intersections
Max number of intersections for Rays that finished on this processor.
unsigned int _ending_max_trajectory_changes
Max number of trajectory changes for Rays that finished on this processor.
unsigned int _ending_max_processor_crossings
Max number of total processor crossings for Rays that finished on this processor. ...
unsigned long long int _ending_processor_crossings
Total number of processor crossings for Rays that finished on this processor.
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
std::vector< std::shared_ptr< Ray > > _ray_bank
Cumulative Ray bank - stored only when _bank_rays_on_completion.

◆ parallelRayStudy()

const ParallelRayStudy& RayTracingStudy::parallelRayStudy ( ) const
inlineinherited

Definition at line 179 of file RayTracingStudy.h.

Referenced by PerProcessorRayTracingResultsVectorPostprocessor::execute(), and RayTracingStudyResult::getValue().

179 { return *_parallel_ray_study; }
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.

◆ parallelStudy()

ParallelStudy<std::shared_ptr<Ray>, Ray>* RayTracingStudy::parallelStudy ( )
inlineinherited

The underlying parallel study: used for the context for calling the packed range routines.

Definition at line 678 of file RayTracingStudy.h.

Referenced by RayTracingStudyTest::generateRays(), and RepeatableRayStudyBase::verifyReplicatedRays().

678 { return _parallel_ray_study.get(); }
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.

◆ postExecuteStudy()

virtual void RayTracingStudy::postExecuteStudy ( )
inlineprotectedvirtualinherited

Entry point after study execution.

Reimplemented in ViewFactorRayStudy, TestTransientRaysStudy, TestReuseRaysStudy, TestPICRayStudy, RayTracingStudyTest, and TestRayLots.

Definition at line 709 of file RayTracingStudy.h.

Referenced by RayTracingStudy::executeStudy().

709 {}

◆ postOnSegment()

void RayTracingStudy::postOnSegment ( const THREAD_ID  tid,
const std::shared_ptr< Ray > &  ray 
)
virtualinherited

Called at the end of a Ray segment.

Parameters
tidThread id
rayThe ray

Definition at line 842 of file RayTracingStudy.C.

Referenced by TraceRay::trace().

843 {
844  mooseAssert(currentlyPropagating(), "Should not call while not propagating");
846  mooseAssert(_num_cached[tid] == 0,
847  "Values should only be cached when computing Jacobian/residual");
848 
849  // Fill into cached Jacobian/residuals if necessary
851  {
853 
854  if (++_num_cached[tid] == 20)
855  {
856  Threads::spin_mutex::scoped_lock lock(_spin_mutex);
858  _num_cached[tid] = 0;
859  }
860  }
862  {
864 
865  if (++_num_cached[tid] == 20)
866  {
867  Threads::spin_mutex::scoped_lock lock(_spin_mutex);
869  _num_cached[tid] = 0;
870  }
871  }
872 }
FEProblemBase & _fe_problem
Threads::spin_mutex _spin_mutex
Spin mutex object for locks.
const bool & currentlyComputingResidual() const
virtual void cacheResidual(const THREAD_ID tid) override
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
std::vector< std::size_t > _num_cached
Number of currently cached objects for Jacobian/residual for each thread.
const bool & currentlyComputingJacobian() const
virtual void cacheJacobian(const THREAD_ID tid) override
virtual void addCachedResidual(const THREAD_ID tid) override
virtual void addCachedJacobian(const THREAD_ID tid) override

◆ preExecuteStudy()

virtual void RayTracingStudy::preExecuteStudy ( )
inlineprotectedvirtualinherited

Entry point before study execution.

Reimplemented in ViewFactorRayStudy.

Definition at line 705 of file RayTracingStudy.h.

Referenced by RayTracingStudy::executeStudy().

705 {}

◆ preTrace()

virtual void RayTracingStudy::preTrace ( const THREAD_ID  ,
const std::shared_ptr< Ray > &   
)
inlinevirtualinherited

Called at the beginning of a trace for a ray.

Parameters
tidThread id
rayThe ray

Definition at line 120 of file RayTracingStudy.h.

Referenced by TraceRay::trace().

120 {}

◆ propagationTime()

Real RayTracingStudy::propagationTime ( ) const
inlineinherited

Duration for creation of all Rays in seconds.

Definition at line 204 of file RayTracingStudy.h.

Referenced by PerProcessorRayTracingResultsVectorPostprocessor::execute().

204 { return std::chrono::duration<Real>(_propagation_time).count(); }
std::chrono::steady_clock::duration _propagation_time

◆ rayAuxDataNames()

const std::vector<std::string>& RayTracingStudy::rayAuxDataNames ( ) const
inlineinherited

The Ray aux data names.

Definition at line 340 of file RayTracingStudy.h.

Referenced by RayTracingMeshOutput::setupEquationSystem().

340 { return _ray_aux_data_names; }
std::vector< std::string > _ray_aux_data_names
The names for each Ray aux data entry.

◆ rayAuxDataSize()

std::size_t RayTracingStudy::rayAuxDataSize ( ) const
inlineinherited

The registered size of values in the Ray aux data.

Definition at line 332 of file RayTracingStudy.h.

Referenced by RayTracingStudy::acquireRay(), RayTracingStudy::acquireRayDuringTrace(), RayTracingStudy::acquireRegisteredRay(), RayTracingStudy::acquireReplicatedRay(), Ray::auxData(), and RayTracingStudy::getRayDataNameInternal().

332 { return _ray_aux_data_names.size(); }
std::vector< std::string > _ray_aux_data_names
The names for each Ray aux data entry.

◆ rayBank()

const std::vector< std::shared_ptr< Ray > > & RayTracingStudy::rayBank ( ) const
protectedinherited

Get the Ray bank.

This is the bank of Rays that have completed on this processor after an execution of the study.

This is only available when the private parameter _bank_rays_on_completion is set to true.

Definition at line 1369 of file RayTracingStudy.C.

Referenced by RayTracingStudyTest::generateRays(), RayTracingStudy::getBankedRay(), TestRayLots::postExecuteStudy(), RayTracingStudyTest::postExecuteStudy(), TestPICRayStudy::postExecuteStudy(), TestReuseRaysStudy::postExecuteStudy(), TestTransientRaysStudy::postExecuteStudy(), and RayTracingStudyNoBankingTest::RayTracingStudyNoBankingTest().

1370 {
1372  mooseError("The Ray bank is not available because the private parameter "
1373  "'_bank_rays_on_completion' is set to false.");
1375  mooseError("Cannot get the Ray bank during generation or propagation.");
1376 
1377  return _ray_bank;
1378 }
bool currentlyGenerating() const
Whether or not the study is generating.
const bool _bank_rays_on_completion
Whether or not to bank rays on completion.
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
void mooseError(Args &&... args) const
std::vector< std::shared_ptr< Ray > > _ray_bank
Cumulative Ray bank - stored only when _bank_rays_on_completion.

◆ rayDataNames()

const std::vector<std::string>& RayTracingStudy::rayDataNames ( ) const
inlineinherited

The Ray data names.

Definition at line 280 of file RayTracingStudy.h.

Referenced by RayTracingExodus::outputMesh(), RayTracingNemesis::outputMesh(), and RayTracingMeshOutput::setupEquationSystem().

280 { return _ray_data_names; }
std::vector< std::string > _ray_data_names
The names for each Ray data entry.

◆ rayDataSize()

std::size_t RayTracingStudy::rayDataSize ( ) const
inlineinherited

The registered size of values in the Ray data.

Definition at line 272 of file RayTracingStudy.h.

Referenced by RayTracingStudy::acquireRay(), RayTracingStudy::acquireRayDuringTrace(), RayTracingStudy::acquireRegisteredRay(), RayTracingStudy::acquireReplicatedRay(), Ray::data(), and RayTracingStudy::getRayDataNameInternal().

272 { return _ray_data_names.size(); }
std::vector< std::string > _ray_data_names
The names for each Ray data entry.

◆ rayDependentSubdomainSetup()

bool RayTracingStudy::rayDependentSubdomainSetup ( ) const
inlineinherited

Whether or not to use Ray dependent subdomain setup.

Definition at line 219 of file RayTracingStudy.h.

Referenced by TraceRay::trace().

const bool _ray_dependent_subdomain_setup
Whether or not subdomain setup is dependent on the Ray.

◆ rayMaxDistance()

Real RayTracingStudy::rayMaxDistance ( ) const
inlineinherited

Max distance any Ray can travel.

Definition at line 184 of file RayTracingStudy.h.

Referenced by TraceRay::trace().

184 { return _ray_max_distance; }
const Real _ray_max_distance
Max distance a Ray can travel before being killed (can change)

◆ registeredRayID()

RayID RayTracingStudy::registeredRayID ( const std::string &  name,
const bool  graceful = false 
) const
inherited

Gets the ID of a registered ray.

Parameters
nameThe name of said ray
gracefulWhether or not to exit gracefully if none is found (with invalid_id)

Definition at line 1455 of file RayTracingStudy.C.

Referenced by RayDataValue::getValue(), RayIntegralValue::initialize(), RayTracingStudyTest::RayTracingStudyTest(), RayTracingStudyWithRegistrationTest::RayTracingStudyWithRegistrationTest(), and RayTracingStudy::registeredRaySetup().

1456 {
1457  Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1458 
1459  if (!_use_ray_registration)
1460  mooseError("Should not use registeredRayID() with Ray registration disabled");
1461 
1462  const auto search = _registered_ray_map.find(name);
1463  if (search != _registered_ray_map.end())
1464  return search->second;
1465 
1466  if (graceful)
1467  return Ray::INVALID_RAY_ID;
1468 
1469  mooseError("Attempted to obtain ID of registered Ray ",
1470  name,
1471  ", but a Ray with said name is not registered.");
1472 }
if(subdm)
Threads::spin_mutex _spin_mutex
Spin mutex object for locks.
const std::string & name() const
void mooseError(Args &&... args) const
std::unordered_map< std::string, RayID > & _registered_ray_map
Map from registered Ray name to ID.
const bool _use_ray_registration
Whether or not to use Ray registration.
static const RayID INVALID_RAY_ID
Invalid Ray ID.
Definition: Ray.h:214

◆ registeredRayName()

const std::string & RayTracingStudy::registeredRayName ( const RayID  ray_id) const
inherited

Gets the name of a registered ray.

Parameters
ray_idThe ID of said ray

Definition at line 1475 of file RayTracingStudy.C.

Referenced by Ray::getInfo(), RayTracingStudyTest::RayTracingStudyTest(), and RayTracingStudyWithRegistrationTest::RayTracingStudyWithRegistrationTest().

1476 {
1477  Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1478 
1479  if (!_use_ray_registration)
1480  mooseError("Should not use registeredRayName() with Ray registration disabled");
1481 
1482  if (_reverse_registered_ray_map.size() > ray_id)
1483  return _reverse_registered_ray_map[ray_id];
1484 
1485  mooseError("Attempted to obtain name of registered Ray with ID ",
1486  ray_id,
1487  ", but a Ray with said ID is not registered.");
1488 }
std::vector< std::string > & _reverse_registered_ray_map
Map from registered Ray ID to name.
Threads::spin_mutex _spin_mutex
Spin mutex object for locks.
void mooseError(Args &&... args) const
const bool _use_ray_registration
Whether or not to use Ray registration.

◆ registerRayAuxData() [1/2]

RayDataIndex RayTracingStudy::registerRayAuxData ( const std::string &  name)
inherited

Register a value to be filled in the aux data on a Ray with a given name.

Parameters
nameThe name to register
Returns
The Ray aux data index for the registered value

Note that this does not actually allocate the storage. It is simply a registration system to keep track of the values stored in the Ray aux data.

Definition at line 1202 of file RayTracingStudy.C.

Referenced by RayTracingStudyTest::RayTracingStudyTest(), StationaryRayStudyTest::StationaryRayStudyTest(), TestRayDataStudy::TestRayDataStudy(), and TestRayLots::TestRayLots().

1203 {
1204  return registerRayDataInternal(name, /* aux = */ true);
1205 }
RayDataIndex registerRayDataInternal(const std::string &name, const bool aux)
Internal method for registering Ray data or Ray aux data with a name.
const std::string & name() const

◆ registerRayAuxData() [2/2]

std::vector< RayDataIndex > RayTracingStudy::registerRayAuxData ( const std::vector< std::string > &  names)
inherited

Register values to be filled in the aux data on a Ray with a given name.

Parameters
namesThe names to register
Returns
The Ray aux data indices for the registered values

Note that this does not actually allocate the storage. It is simply a registration system to keep track of the values stored in the Ray aux data.

Definition at line 1208 of file RayTracingStudy.C.

1209 {
1210  return registerRayDataInternal(names, /* aux = */ true);
1211 }
RayDataIndex registerRayDataInternal(const std::string &name, const bool aux)
Internal method for registering Ray data or Ray aux data with a name.

◆ registerRayData() [1/2]

RayDataIndex RayTracingStudy::registerRayData ( const std::string &  name)
inherited

Register a value to be filled in the data on a Ray with a given name.

Parameters
nameThe name to register
Returns
The Ray data index for the registered value

Note that this does not actually allocate the storage. It is simply a registration system to keep track of the values stored in the Ray data.

Definition at line 1171 of file RayTracingStudy.C.

Referenced by RayTracingStudyTest::generateRays(), RayTracingStudyTest::RayTracingStudyTest(), StationaryRayStudyTest::StationaryRayStudyTest(), TestRayDataStudy::TestRayDataStudy(), and TestRayLots::TestRayLots().

1172 {
1173  return registerRayDataInternal(name, /* aux = */ false);
1174 }
RayDataIndex registerRayDataInternal(const std::string &name, const bool aux)
Internal method for registering Ray data or Ray aux data with a name.
const std::string & name() const

◆ registerRayData() [2/2]

std::vector< RayDataIndex > RayTracingStudy::registerRayData ( const std::vector< std::string > &  names)
inherited

Register values to be filled in the data on a Ray with a given name.

Parameters
namesThe names to register
Returns
The Ray data indices for the registered value

Note that this does not actually allocate the storage. It is simply a registration system to keep track of the values stored in the Ray data.

Definition at line 1177 of file RayTracingStudy.C.

1178 {
1179  return registerRayDataInternal(names, /* aux = */ false);
1180 }
RayDataIndex registerRayDataInternal(const std::string &name, const bool aux)
Internal method for registering Ray data or Ray aux data with a name.

◆ reinitSegment()

void RayTracingStudy::reinitSegment ( const Elem elem,
const Point start,
const Point end,
const Real  length,
THREAD_ID  tid 
)
virtualinherited

Reinitialize objects for a Ray segment for ray tracing.

Parameters
elemThe elem the segment is in
startStart point of the segment
endEnd point of the segment
lengthThe length of the start -> end segment
tidThread id

Definition at line 778 of file RayTracingStudy.C.

Referenced by TraceRay::onSegment().

780 {
781  mooseAssert(MooseUtils::absoluteFuzzyEqual((start - end).norm(), length), "Invalid length");
782  mooseAssert(currentlyPropagating(), "Should not call while not propagating");
783 
785 
786  // If we have any variables or material properties that are active, we definitely need to reinit
787  bool reinit = _fe_problem.hasActiveElementalMooseVariables(tid) ||
789  // If not, make sure that the RayKernels have not requested a reinit (this could happen when a
790  // RayKernel doesn't have variables or materials but still does an integration and needs qps)
791  if (!reinit)
792  for (const RayKernelBase * rk : currentRayKernels(tid))
793  if (rk->needSegmentReinit())
794  {
795  reinit = true;
796  break;
797  }
798 
799  if (reinit)
800  {
801  _fe_problem.prepare(elem, tid);
802 
803  std::vector<Point> points;
804  std::vector<Real> weights;
805  buildSegmentQuadrature(start, end, length, points, weights);
806  _fe_problem.reinitElemPhys(elem, points, tid);
807  _fe_problem.assembly(tid, _sys.number()).modifyArbitraryWeights(weights);
808 
810  }
811 }
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
Base object for the RayKernel syntax.
Definition: RayKernelBase.h:27
const std::vector< RayKernelBase * > & currentRayKernels(THREAD_ID tid) const
Gets the current RayKernels for a thread, which are set in segmentSubdomainSetup() ...
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override
FEProblemBase & _fe_problem
unsigned int number() const
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
SystemBase & _sys
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
subdomain_id_type subdomain_id() const
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
auto norm(const T &a)
virtual void buildSegmentQuadrature(const Point &start, const Point &end, const Real length, std::vector< Point > &points, std::vector< Real > &weights) const
Builds quadrature points for a given segment using the _segment_qrule.
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
bool hasActiveMaterialProperties(const THREAD_ID tid) const
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid) override

◆ reserveRayBuffer()

void RayTracingStudy::reserveRayBuffer ( const std::size_t  size)
protectedinherited

Reserve size entires in the Ray buffer.

This can only be used within generateRays() and should be used when possible to reserve entires in the buffer before adding Rays via moveRay(s)ToBuffer.

Definition at line 1645 of file RayTracingStudy.C.

Referenced by RepeatableRayStudyBase::generateRays(), ViewFactorRayStudy::generateRays(), and RayTracingStudyTest::RayTracingStudyTest().

1646 {
1647  if (!currentlyGenerating())
1648  mooseError("Can only reserve in Ray buffer during generateRays()");
1649 
1650  _parallel_ray_study->reserveBuffer(size);
1651 }
bool currentlyGenerating() const
Whether or not the study is generating.
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
The study that used is to actually execute (trace) the Rays.
void mooseError(Args &&... args) const

◆ resetReplicatedRayIDs()

void RayTracingStudy::resetReplicatedRayIDs ( )
protectedinherited

Resets the generation of unique replicated RayIDs accessed via generateReplicatedRayID().

Definition at line 1741 of file RayTracingStudy.C.

Referenced by RayTracingStudy::RayTracingStudy().

1742 {
1743  libmesh_parallel_only(comm());
1744 
1745  Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1746 
1747  mooseAssert(!currentlyGenerating() && !currentlyPropagating(),
1748  "Cannot be reset during generation or propagation");
1749 
1751 }
bool currentlyGenerating() const
Whether or not the study is generating.
const Parallel::Communicator & comm() const
RayID _replicated_next_ray_id
Storage for the next available replicated RayID, obtained via generateReplicatedRayID() ...
Threads::spin_mutex _spin_mutex
Spin mutex object for locks.
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)

◆ resetUniqueRayIDs()

void RayTracingStudy::resetUniqueRayIDs ( )
protectedinherited

Resets the generation of unique RayIDs via generateUniqueRayID() to the beginning of the range.

Definition at line 1715 of file RayTracingStudy.C.

Referenced by RayTracingStudy::RayTracingStudy().

1716 {
1717  libmesh_parallel_only(comm());
1718 
1719  Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1720 
1721  mooseAssert(!currentlyGenerating() && !currentlyPropagating(),
1722  "Cannot be reset during generation or propagation");
1723 
1724  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
1726 }
bool currentlyGenerating() const
Whether or not the study is generating.
unsigned long int RayID
Type for a Ray&#39;s ID.
Definition: Ray.h:44
unsigned int n_threads()
const Parallel::Communicator & comm() const
std::vector< RayID > _threaded_next_ray_id
Storage for the next available unique RayID, obtained via generateUniqueRayID()
Threads::spin_mutex _spin_mutex
Spin mutex object for locks.
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
const processor_id_type _pid
The rank of this processor (this actually takes time to lookup - so just do it once) ...
unsigned int THREAD_ID

◆ residualSetup()

void RayTracingStudy::residualSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 272 of file RayTracingStudy.C.

273 {
274  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
275  mooseAssert(_num_cached[tid] == 0, "Cached residuals/Jacobians not empty");
276 
277  for (auto & rto : getRayTracingObjects())
278  rto->residualSetup();
279 }
unsigned int n_threads()
std::vector< RayTracingObject * > getRayTracingObjects()
Gets all of the currently active RayTracingObjects.
std::vector< std::size_t > _num_cached
Number of currently cached objects for Jacobian/residual for each thread.
unsigned int THREAD_ID

◆ sameLevelActiveElems()

bool RayTracingStudy::sameLevelActiveElems ( ) const
protectedinherited

Determine whether or not the mesh currently has active elements that are all the same level.

Definition at line 1677 of file RayTracingStudy.C.

Referenced by RayTracingStudy::meshChanged().

1678 {
1679  unsigned int min_level = std::numeric_limits<unsigned int>::max();
1680  unsigned int max_level = std::numeric_limits<unsigned int>::min();
1681 
1682  for (const auto & elem : *_mesh.getActiveLocalElementRange())
1683  {
1684  const auto level = elem->level();
1685  min_level = std::min(level, min_level);
1686  max_level = std::max(level, max_level);
1687  }
1688 
1689  _communicator.min(min_level);
1690  _communicator.max(max_level);
1691 
1692  return min_level == max_level;
1693 }
libMesh::ConstElemRange * getActiveLocalElementRange()
MooseMesh & _mesh
The Mesh.
const Parallel::Communicator & _communicator
void min(const T &r, T &o, Request &req) const
void max(const T &r, T &o, Request &req) const

◆ segmentsOnCacheTraces()

bool RayTracingStudy::segmentsOnCacheTraces ( ) const
inlineinherited

Whether or not to cache individual element segments when _cache_traces = true.

Definition at line 577 of file RayTracingStudy.h.

Referenced by RayTracingMeshOutput::buildSegmentMesh(), RayTracingMeshOutput::neededNodes(), TraceRay::onContinueTrace(), TraceRay::onTrajectoryChanged(), RayTracingMeshOutput::RayTracingMeshOutput(), and RayTracingMeshOutput::startingIDs().

577 { return _segments_on_cache_traces; }
const bool _segments_on_cache_traces
Whether or not to cache individual element segments when caching.

◆ segmentSubdomainSetup()

void RayTracingStudy::segmentSubdomainSetup ( const SubdomainID  subdomain,
const THREAD_ID  tid,
const RayID  ray_id 
)
virtualinherited

Setup for on subdomain change or subdomain AND ray change during ray tracing.

Parameters
subdomainThe subdomain changed to
tidThread id
ray_idID of the ray initiating the change

Definition at line 743 of file RayTracingStudy.C.

Referenced by TraceRay::onSubdomainChanged().

746 {
747  mooseAssert(currentlyPropagating(), "Should not call while not propagating");
748 
749  // Call subdomain setup on FE
750  _fe_problem.subdomainSetup(subdomain, tid);
751 
752  std::set<MooseVariableFEBase *> needed_moose_vars;
753  std::unordered_set<unsigned int> needed_mat_props;
754 
755  // Get RayKernels and their dependencies and call subdomain setup
756  getRayKernels(_threaded_current_ray_kernels[tid], subdomain, tid, ray_id);
757  for (auto & rkb : _threaded_current_ray_kernels[tid])
758  {
759  rkb->subdomainSetup();
760 
761  const auto & mv_deps = rkb->getMooseVariableDependencies();
762  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
763 
764  const auto & mp_deps = rkb->getMatPropDependencies();
765  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
766  }
767 
768  // Prepare aux vars
769  for (auto & var : needed_moose_vars)
770  if (var->kind() == Moose::VarKindType::VAR_AUXILIARY)
771  var->prepareAux();
772 
773  _fe_problem.setActiveElementalMooseVariables(needed_moose_vars, tid);
774  _fe_problem.prepareMaterials(needed_mat_props, subdomain, tid);
775 }
void getRayKernels(std::vector< RayKernelBase *> &result, SubdomainID id, THREAD_ID tid)
Fills the active RayKernels associated with this study and a block into result.
std::vector< std::vector< RayKernelBase * > > _threaded_current_ray_kernels
The current RayKernel objects for each thread.
FEProblemBase & _fe_problem
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase * > &moose_vars, const THREAD_ID tid) override
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
void prepareMaterials(const std::unordered_set< unsigned int > &consumer_needed_mat_props, const SubdomainID blk_id, const THREAD_ID tid)

◆ shouldCacheTrace()

virtual bool RayTracingStudy::shouldCacheTrace ( const std::shared_ptr< Ray > &  ) const
inlinevirtualinherited

Virtual that allows for selection in if a Ray should be cached or not (only used when _cache_traces).

Definition at line 583 of file RayTracingStudy.h.

Referenced by RayTracingStudy::initThreadedCachedTrace(), and TraceRay::trace().

584  {
585  return _always_cache_traces;
586  }
bool _always_cache_traces
Whether or not to cache traces on every trace execution.

◆ sideIsIncoming()

bool RayTracingStudy::sideIsIncoming ( const Elem *const  elem,
const unsigned short  side,
const Point direction,
const THREAD_ID  tid 
)
inherited

Whether or not side is incoming on element elem in direction direction.

Definition at line 1760 of file RayTracingStudy.C.

Referenced by TraceRay::findExternalBoundarySide(), TraceRay::onSegment(), ClaimRays::postClaimRay(), and TraceRay::trace().

1764 {
1765  const auto & normal = getSideNormal(elem, side, tid);
1766  const auto dot = normal * direction;
1767  return dot < TraceRayTools::TRACE_TOLERANCE;
1768 }
const Real TRACE_TOLERANCE
The standard tolerance to use in tracing.
Definition: TraceRayTools.h:48
virtual const Point & getSideNormal(const Elem *elem, const unsigned short side, const THREAD_ID tid)
Get the outward normal for a given element side.

◆ sideIsNonPlanar()

bool RayTracingStudy::sideIsNonPlanar ( const Elem *  elem,
const unsigned short  s 
) const
inlineinherited

Whether or not the side on elem elem is non-planar.

This is cached because checking whether or not a face is planar is costly

Definition at line 465 of file RayTracingStudy.h.

Referenced by TraceRay::exitsElem(), ViewFactorRayStudy::generateRays(), ReflectRayBC::onBoundary(), TraceRay::onSegment(), TraceRay::possiblyAddToBoundaryElems(), Ray::setStart(), and TraceRay::trace().

466  {
468  }
std::vector< std::vector< unsigned short > > _non_planar_sides
Non planar side data, which is for quick checking if an elem side is non-planar We use unsigned short...
libMesh::dof_id_type getIndex(const libMesh::Elem *elem) const
Get the index associated with the element elem.
ElemIndexHelper _elem_index_helper
Helper for defining a local contiguous index for each element.
bool _has_non_planar_sides
Whether or not the local mesh has elements with non-planar sides.

◆ subdomainHmax()

Real RayTracingStudy::subdomainHmax ( const SubdomainID  subdomain_id) const
inherited

Get the cached hmax for all elements in a subdomain.

Used for scaling tolerances in ray tracing.

Definition at line 1696 of file RayTracingStudy.C.

Referenced by RayTracingStudyTest::generateRays(), TraceRay::onSubdomainChanged(), TraceRay::subdomainHmax(), and RayTracingStudy::subdomainHMaxSetup().

1697 {
1698  const auto find = _subdomain_hmax.find(subdomain_id);
1699  if (find == _subdomain_hmax.end())
1700  mooseError("Subdomain ", subdomain_id, " not found in subdomain hmax map");
1701  return find->second;
1702 }
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
std::unordered_map< SubdomainID, Real > _subdomain_hmax
The cached hmax for all elements in a subdomain.
void mooseError(Args &&... args) const

◆ timestepSetup()

void RayTracingStudy::timestepSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 292 of file RayTracingStudy.C.

293 {
294  for (auto & rto : getRayTracingObjects())
295  rto->timestepSetup();
296 }
std::vector< RayTracingObject * > getRayTracingObjects()
Gets all of the currently active RayTracingObjects.

◆ tolerateFailure()

bool RayTracingStudy::tolerateFailure ( ) const
inlineinherited

Whether or not to tolerate failure.

Definition at line 209 of file RayTracingStudy.h.

Referenced by TraceRay::exitsElem(), TraceRay::onBoundary(), and TraceRay::trace().

209 { return _tolerate_failure; }
const bool _tolerate_failure
Whether or not to tolerate a Ray Tracing failure.

◆ totalDistance()

Real RayTracingStudy::totalDistance ( ) const
inlineinherited

Total distance traveled by all Rays.

Definition at line 172 of file RayTracingStudy.h.

Referenced by RayTracingStudyResult::getValue().

172 { return _total_distance; }
Real _total_distance
Total distance traveled by all Rays.

◆ totalIntersections()

unsigned long long int RayTracingStudy::totalIntersections ( ) const
inlineinherited

Total number of Ray/element intersections.

Definition at line 155 of file RayTracingStudy.h.

155 { return _total_intersections; }
unsigned long long int _total_intersections
Total number of Ray/element intersections.

◆ totalProcessorCrossings()

unsigned long long int RayTracingStudy::totalProcessorCrossings ( ) const
inlineinherited

Total number of processor crossings.

Definition at line 138 of file RayTracingStudy.h.

Referenced by RayTracingStudyResult::getValue().

138 { return _total_processor_crossings; }
unsigned long long int _total_processor_crossings
Total number of processor crossings.

◆ totalVolume()

Real RayTracingStudy::totalVolume ( ) const
inlineinherited

Get the current total volume of the domain.

Definition at line 437 of file RayTracingStudy.h.

Referenced by RayTracingStudy::isRectangularDomain().

437 { return _total_volume; }
Real _total_volume
The total volume of the domain.

◆ traceRay() [1/2]

TraceRay& RayTracingStudy::traceRay ( const THREAD_ID  tid)
inlineinherited

Gets the threaded TraceRay object for tid.

Definition at line 647 of file RayTracingStudy.h.

Referenced by BackfaceCullingStudyTest::BackfaceCullingStudyTest().

647 { return *_threaded_trace_ray[tid]; }
std::vector< std::shared_ptr< TraceRay > > _threaded_trace_ray
The TraceRay objects for each thread (they do the physical tracing)

◆ traceRay() [2/2]

const TraceRay& RayTracingStudy::traceRay ( const THREAD_ID  tid) const
inlineinherited

Definition at line 648 of file RayTracingStudy.h.

648 { return *_threaded_trace_ray[tid]; }
std::vector< std::shared_ptr< TraceRay > > _threaded_trace_ray
The TraceRay objects for each thread (they do the physical tracing)

◆ useRayRegistration()

bool RayTracingStudy::useRayRegistration ( ) const
inlineinherited

Whether or not ray registration is being used.

Definition at line 564 of file RayTracingStudy.h.

Referenced by Ray::getInfo(), RayIntegralValue::initialize(), and RayDataValue::RayDataValue().

564 { return _use_ray_registration; }
const bool _use_ray_registration
Whether or not to use Ray registration.

◆ validParams()

InputParameters DisableRayBankingStudy::validParams ( )
static

Definition at line 15 of file DisableRayBankingStudy.C.

16 {
17  auto params = RepeatableRayStudy::validParams();
18 
19  params.set<bool>("_bank_rays_on_completion") = false;
20 
21  return params;
22 }
static InputParameters validParams()

◆ verifyRays()

bool RayTracingStudy::verifyRays ( ) const
inlineinherited

Whether or not to verify if Rays have valid information before being traced.

Definition at line 654 of file RayTracingStudy.h.

Referenced by RayKernelBase::changeRayStartDirection(), ClaimRays::claim(), RepeatableRayStudyBase::defineRaysInternal(), RayTracingStudy::executeStudy(), Ray::setStart(), Ray::setStartingEndPoint(), and TraceRay::trace().

654 { return _verify_rays; }
const bool _verify_rays
Whether or not to verify if Rays have valid information before being traced.

◆ verifyTraceIntersections()

bool RayTracingStudy::verifyTraceIntersections ( ) const
inlineinherited

Whether or not trace verification is enabled in devel/dbg modes.

Definition at line 659 of file RayTracingStudy.h.

Referenced by TraceRay::exitsElem(), TraceRay::onSegment(), TraceRay::onTrajectoryChanged(), and TraceRay::trace().

659 { return _verify_trace_intersections; }
const bool _verify_trace_intersections
Whether or not to verify the trace intersections in devel and dbg modes.

◆ verifyUniqueRayIDs()

void RayTracingStudy::verifyUniqueRayIDs ( const std::vector< std::shared_ptr< Ray >>::const_iterator  begin,
const std::vector< std::shared_ptr< Ray >>::const_iterator  end,
const bool  global,
const std::string &  error_suffix 
) const
inherited

Verifies that the Rays in the given range have unique Ray IDs.

Parameters
beginThe beginning of the range of Rays to check
endThe end of the range of Rays to check
globalIf true, this will complete the verification across all processors
error_suffixEntry point for additional information in the error message

Definition at line 1523 of file RayTracingStudy.C.

Referenced by RayTracingStudy::executeStudy(), and RepeatableRayStudyBase::verifyReplicatedRays().

1527 {
1528  // Determine the unique set of Ray IDs on this processor,
1529  // and if not locally unique throw an error. Once we build this set,
1530  // we will send it to rank 0 to verify globally
1531  std::set<RayID> local_rays;
1532  for (const std::shared_ptr<Ray> & ray : as_range(begin, end))
1533  {
1534  mooseAssert(ray, "Null ray");
1535 
1536  // Try to insert into the set; the second entry in the pair
1537  // will be false if it was not inserted
1538  if (!local_rays.insert(ray->id()).second)
1539  {
1540  for (const std::shared_ptr<Ray> & other_ray : as_range(begin, end))
1541  if (ray.get() != other_ray.get() && ray->id() == other_ray->id())
1542  mooseError("Multiple Rays exist with ID ",
1543  ray->id(),
1544  " on processor ",
1545  _pid,
1546  " ",
1547  error_suffix,
1548  "\n\nOffending Ray information:\n\n",
1549  ray->getInfo(),
1550  "\n",
1551  other_ray->getInfo());
1552  }
1553  }
1554 
1555  // Send IDs from all procs to rank 0 and verify on rank 0
1556  if (global)
1557  {
1558  // Package our local IDs and send to rank 0
1559  std::map<processor_id_type, std::vector<RayID>> send_ids;
1560  if (local_rays.size())
1561  send_ids.emplace(std::piecewise_construct,
1562  std::forward_as_tuple(0),
1563  std::forward_as_tuple(local_rays.begin(), local_rays.end()));
1564  local_rays.clear();
1565 
1566  // Mapping on rank 0 from ID -> processor ID
1567  std::map<RayID, processor_id_type> global_map;
1568 
1569  // Verify another processor's IDs against the global map on rank 0
1570  const auto check_ids =
1571  [this, &global_map, &error_suffix](processor_id_type pid, const std::vector<RayID> & ids)
1572  {
1573  for (const RayID id : ids)
1574  {
1575  const auto emplace_pair = global_map.emplace(id, pid);
1576 
1577  // Means that this ID already exists in the map
1578  if (!emplace_pair.second)
1579  mooseError("Ray with ID ",
1580  id,
1581  " exists on ranks ",
1582  emplace_pair.first->second,
1583  " and ",
1584  pid,
1585  "\n",
1586  error_suffix);
1587  }
1588  };
1589 
1590  Parallel::push_parallel_vector_data(_communicator, send_ids, check_ids);
1591  }
1592 }
unsigned long int RayID
Type for a Ray&#39;s ID.
Definition: Ray.h:44
const Parallel::Communicator & _communicator
uint8_t processor_id_type
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
void mooseError(Args &&... args) const
const processor_id_type _pid
The rank of this processor (this actually takes time to lookup - so just do it once) ...

◆ verifyUniqueRays()

void RayTracingStudy::verifyUniqueRays ( const std::vector< std::shared_ptr< Ray >>::const_iterator  begin,
const std::vector< std::shared_ptr< Ray >>::const_iterator  end,
const std::string &  error_suffix 
)
inherited

Verifies that the Rays in the given range are unique.

That is, that there are not multiple shared_ptrs that point to the same Ray

Parameters
beginThe beginning of the range of Rays to check
endThe end of the range of Rays to check
error_suffixEntry point for additional information in the error message

Definition at line 1595 of file RayTracingStudy.C.

Referenced by RayTracingStudy::executeStudy().

1598 {
1599  std::set<const Ray *> rays;
1600  for (const std::shared_ptr<Ray> & ray : as_range(begin, end))
1601  if (!rays.insert(ray.get()).second) // false if not inserted into rays
1602  mooseError("Multiple shared_ptrs were found that point to the same Ray ",
1603  error_suffix,
1604  "\n\nOffending Ray:\n",
1605  ray->getInfo());
1606 }
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
void mooseError(Args &&... args) const

◆ warnNonPlanar()

bool RayTracingStudy::warnNonPlanar ( ) const
inlineinherited

Whether or not to produce a warning when interacting with a non-planar mesh.

Definition at line 673 of file RayTracingStudy.h.

673 { return _warn_non_planar; }
const bool _warn_non_planar
Whether not to warn if non-planar faces are found.

Member Data Documentation

◆ _always_cache_traces

bool RayTracingStudy::_always_cache_traces
protectedinherited

Whether or not to cache traces on every trace execution.

Definition at line 883 of file RayTracingStudy.h.

Referenced by RayTracingStudy::shouldCacheTrace().

◆ _aux_data_on_cache_traces

const bool RayTracingStudy::_aux_data_on_cache_traces
protectedinherited

Whether or not to store the Ray aux data on the cache traces.

Definition at line 887 of file RayTracingStudy.h.

Referenced by RayTracingStudy::auxDataOnCacheTraces().

◆ _bank_rays_on_completion

const bool RayTracingStudy::_bank_rays_on_completion
protectedinherited

Whether or not to bank rays on completion.

Definition at line 878 of file RayTracingStudy.h.

Referenced by RayTracingStudy::bankRaysOnCompletion(), RayTracingStudy::onCompleteRay(), and RayTracingStudy::rayBank().

◆ _claim_after_define_rays

const bool RepeatableRayStudyBase::_claim_after_define_rays
protectedinherited

Whether or not Rays need to be claimed after defineRays()

Definition at line 49 of file RepeatableRayStudyBase.h.

Referenced by RepeatableRayStudyBase::defineRaysInternal(), and RepeatableRayStudyBase::RepeatableRayStudyBase().

◆ _comm

const Parallel::Communicator& RayTracingStudy::_comm
protectedinherited

The Communicator.

Definition at line 863 of file RayTracingStudy.h.

Referenced by LotsOfRaysRayStudy::defineRays().

◆ _data_on_cache_traces

const bool RayTracingStudy::_data_on_cache_traces
protectedinherited

Whether or not to store the Ray data on the cache traces.

Definition at line 885 of file RayTracingStudy.h.

Referenced by RayTracingStudy::dataOnCacheTraces().

◆ _define_rays_replicated

const bool RepeatableRayStudyBase::_define_rays_replicated
protectedinherited

Whether or not the Rays filled into _rays are replicated across all processors.

Definition at line 47 of file RepeatableRayStudyBase.h.

Referenced by RepeatableRayStudyBase::defineRaysInternal().

◆ _directions

const std::vector<Point>* const RepeatableRayStudy::_directions
protectedinherited

The Ray directions (if defined)

Definition at line 36 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _end_points

const std::vector<Point>* const RepeatableRayStudy::_end_points
protectedinherited

The Ray end points (if defined)

Definition at line 34 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _initial_ray_aux_data

const std::vector<std::vector<Real> >* const RepeatableRayStudy::_initial_ray_aux_data
protectedinherited

The initial Ray data to set (if defined)

Definition at line 46 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _initial_ray_data

const std::vector<std::vector<Real> >* const RepeatableRayStudy::_initial_ray_data
protectedinherited

The initial Ray data to set (if defined)

Definition at line 42 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _max_distances

const std::vector<Real>* const RepeatableRayStudy::_max_distances
protectedinherited

The Ray max distances (if defined)

Definition at line 38 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _mesh

MooseMesh& RayTracingStudy::_mesh
protectedinherited

◆ _names

const std::vector<std::string> RepeatableRayStudy::_names
protectedinherited

The Ray names.

Definition at line 30 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _pid

const processor_id_type RayTracingStudy::_pid
protectedinherited

◆ _ray_aux_data_indices

const std::vector<RayDataIndex> RepeatableRayStudy::_ray_aux_data_indices
protectedinherited

The Ray aux data indices (if defined)

Definition at line 44 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _ray_data_indices

const std::vector<RayDataIndex> RepeatableRayStudy::_ray_data_indices
protectedinherited

The Ray data indices (if defined)

Definition at line 40 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _ray_dependent_subdomain_setup

const bool RayTracingStudy::_ray_dependent_subdomain_setup
protectedinherited

Whether or not subdomain setup is dependent on the Ray.

Definition at line 880 of file RayTracingStudy.h.

Referenced by RayTracingStudy::rayDependentSubdomainSetup().

◆ _ray_kernel_coverage_check

const bool RayTracingStudy::_ray_kernel_coverage_check
protectedinherited

Whether or not to perform coverage checks on RayKernels.

Definition at line 868 of file RayTracingStudy.h.

Referenced by RayTracingStudy::coverageChecks().

◆ _ray_max_distance

const Real RayTracingStudy::_ray_max_distance
protectedinherited

Max distance a Ray can travel before being killed (can change)

Definition at line 891 of file RayTracingStudy.h.

Referenced by RayTracingStudy::rayMaxDistance().

◆ _rays

std::vector<std::shared_ptr<Ray> >& RepeatableRayStudyBase::_rays
protectedinherited

◆ _segments_on_cache_traces

const bool RayTracingStudy::_segments_on_cache_traces
protectedinherited

Whether or not to cache individual element segments when caching.

Definition at line 889 of file RayTracingStudy.h.

Referenced by RayTracingStudy::segmentsOnCacheTraces().

◆ _should_define_rays

bool& RepeatableRayStudyBase::_should_define_rays
protectedinherited

Whether or not we should call defineRays() on the next generateRays() Can be set to true in derived classes if they wish to redefine the rays after they have been defined once.

(restartable)

Definition at line 54 of file RepeatableRayStudyBase.h.

Referenced by RepeatableRayStudyBase::generateRays().

◆ _start_points

const std::vector<Point> RepeatableRayStudy::_start_points
protectedinherited

The points to start the Rays from.

Definition at line 32 of file RepeatableRayStudy.h.

Referenced by RepeatableRayStudy::defineRays(), and RepeatableRayStudy::RepeatableRayStudy().

◆ _tolerate_failure

const bool RayTracingStudy::_tolerate_failure
protectedinherited

Whether or not to tolerate a Ray Tracing failure.

Definition at line 876 of file RayTracingStudy.h.

Referenced by RayTracingStudy::executeStudy(), and RayTracingStudy::tolerateFailure().

◆ _use_internal_sidesets

const bool RayTracingStudy::_use_internal_sidesets
protectedinherited

Whether or not to use the internal sidesets in ray tracing.

Definition at line 874 of file RayTracingStudy.h.

Referenced by RayTracingStudy::internalSidesetSetup().

◆ _use_ray_registration

const bool RayTracingStudy::_use_ray_registration
protectedinherited

◆ _verify_rays

const bool RayTracingStudy::_verify_rays
protectedinherited

Whether or not to verify if Rays have valid information before being traced.

Definition at line 893 of file RayTracingStudy.h.

Referenced by RayTracingStudy::verifyRays().

◆ _verify_trace_intersections

const bool RayTracingStudy::_verify_trace_intersections
protectedinherited

Whether or not to verify the trace intersections in devel and dbg modes.

Definition at line 896 of file RayTracingStudy.h.

Referenced by RayTracingStudy::verifyTraceIntersections().

◆ _warn_non_planar

const bool RayTracingStudy::_warn_non_planar
protectedinherited

Whether not to warn if non-planar faces are found.

Definition at line 870 of file RayTracingStudy.h.

Referenced by RayTracingStudy::nonPlanarSideSetup(), and RayTracingStudy::warnNonPlanar().


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