https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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 | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
RepeatableRayStudyDefineNoClaimTest Class Reference

#include <RepeatableRayStudyBaseTest.h>

Inheritance diagram for RepeatableRayStudyDefineNoClaimTest:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 RepeatableRayStudyDefineNoClaimTest (const InputParameters &params)
 
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)
 
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.
 
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.
 
virtual void postOnSegment (const THREAD_ID tid, const std::shared_ptr< Ray > &ray)
 Called at the end of a Ray segment.
 
virtual void preTrace (const THREAD_ID, const std::shared_ptr< Ray > &)
 Called at the beginning of a trace for a ray.
 
void executeStudy ()
 Method for executing the study so that it can be called out of the standard UO execute()
 
unsigned long long int endingProcessorCrossings () const
 Total number of processor crossings for Rays that finished on this processor.
 
unsigned int endingMaxProcessorCrossings () const
 Max number of total processor crossings for Rays that finished on this processor.
 
unsigned long long int totalProcessorCrossings () const
 Total number of processor crossings.
 
unsigned int maxProcessorCrossings () const
 Max number of processor crossings for all Rays.
 
unsigned long long int endingIntersections () const
 Total number of Ray/element intersections for Rays that finished on this processor.
 
unsigned int endingMaxIntersections () const
 Max number of intersections for Rays that finished on this processor.
 
unsigned long long int totalIntersections () const
 Total number of Ray/element intersections.
 
unsigned int maxIntersections () const
 Max number of intersections for a Ray.
 
unsigned int maxTrajectoryChanges () const
 Max number of trajectory changes for a Ray.
 
Real endingDistance () const
 Total amount of distance traveled by the rays that end on this processor.
 
Real totalDistance () const
 Total distance traveled by all Rays.
 
unsigned long long int localTraceRayResult (const int result) const
 
const ParallelRayStudy & parallelRayStudy () const
 
Real rayMaxDistance () const
 Max distance any Ray can travel.
 
Real executionTime ()
 Duration for execute() in seconds.
 
Real executionTimeNano ()
 Duration for execute() in nanoseconds.
 
Real generationTime () const
 Duration for creation of all Rays in seconds.
 
Real propagationTime () const
 Duration for creation of all Rays in seconds.
 
bool tolerateFailure () const
 Whether or not to tolerate failure.
 
bool bankRaysOnCompletion () const
 Whether or not to bank Rays on completion.
 
bool rayDependentSubdomainSetup () const
 Whether or not to use Ray dependent subdomain setup.
 
RayDataIndex registerRayData (const std::string &name)
 Register a value to be filled in the data on a Ray with a given name.
 
std::vector< RayDataIndex > registerRayData (const std::vector< std::string > &names)
 Register values to be filled in the data on a Ray with a given name.
 
RayDataIndex getRayDataIndex (const std::string &name, const bool graceful=false) const
 Gets the index associated with a registered value in the Ray data.
 
std::vector< RayDataIndex > getRayDataIndices (const std::vector< std::string > &names, const bool graceful=false) const
 Gets the indices associated with registered values in the Ray data.
 
const std::string & getRayDataName (const RayDataIndex index) const
 Gets the name associated with a registered value in the Ray data.
 
std::vector< std::string > getRayDataNames (const std::vector< RayDataIndex > &indices) const
 Gets the names associated with registered values in the Ray data.
 
std::size_t rayDataSize () const
 The registered size of values in the Ray data.
 
bool hasRayData () const
 Whether or not any Ray data are registered.
 
const std::vector< std::string > & rayDataNames () const
 The Ray data names.
 
RayDataIndex registerRayAuxData (const std::string &name)
 Register a value to be filled in the aux data on a Ray with a given name.
 
std::vector< RayDataIndex > registerRayAuxData (const std::vector< std::string > &names)
 Register values to be filled in the aux data on a Ray with a given name.
 
RayDataIndex getRayAuxDataIndex (const std::string &name, const bool graceful=false) const
 Gets the index associated with a registered value in the Ray aux data.
 
std::vector< RayDataIndex > getRayAuxDataIndices (const std::vector< std::string > &names, const bool graceful=false) const
 Gets the indices associated with registered values in the Ray aux data.
 
const std::string & getRayAuxDataName (const RayDataIndex index) const
 Gets the name associated with a registered value in the Ray aux data.
 
std::vector< std::string > getRayAuxDataNames (const std::vector< RayDataIndex > &indices) const
 Gets the names associated with registered values in the Ray aux data.
 
std::size_t rayAuxDataSize () const
 The registered size of values in the Ray aux data.
 
bool hasRayAuxData () const
 Whether or not any Ray aux data are registered.
 
const std::vector< std::string > & rayAuxDataNames () const
 The Ray aux data names.
 
bool hasRayKernels (const THREAD_ID tid)
 Whether or not there are currently any active RayKernel objects.
 
void getRayKernels (std::vector< RayKernelBase * > &result, SubdomainID id, THREAD_ID tid)
 Fills the active RayKernels associated with this study and a block into result.
 
template<typename T >
void getRayKernels (std::vector< T * > &result, THREAD_ID tid)
 Fills the active RayKernels associated with this study into result.
 
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.
 
void getRayBCs (std::vector< RayBoundaryConditionBase * > &result, BoundaryID id, THREAD_ID tid)
 Fills the active RayBCs associated with this study and a boundary into result.
 
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.
 
template<typename T >
void getRayBCs (std::vector< T * > &result, THREAD_ID tid)
 Fills the active RayBCs associated with this study into result.
 
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.
 
const std::vector< RayKernelBase * > & currentRayKernels (THREAD_ID tid) const
 Gets the current RayKernels for a thread, which are set in segmentSubdomainSetup()
 
const BoundingBox & boundingBox () const
 Get the nodal bounding box for the domain.
 
const BoundingBox & looseBoundingBox () const
 Get the loose nodal bounding box for the domain.
 
Real domainMaxLength () const
 Get the inflated maximum length across the domain.
 
Real totalVolume () const
 Get the current total volume of the domain.
 
bool isRectangularDomain () const
 Whether or not the domain is rectangular (if it is prefectly encompassed by its bounding box)
 
bool hasInternalSidesets () const
 Whether or not the local mesh has internal sidesets that have RayBCs on them.
 
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.
 
const std::set< BoundaryID > & getInternalSidesets () const
 Gets the internal sidesets (that have RayBCs) within the local domain.
 
bool sideIsNonPlanar (const Elem *elem, const unsigned short s) const
 Whether or not the side \s on elem elem is non-planar.
 
bool hasSameLevelActiveElems () const
 Whether or not the mesh has active elements of the same level.
 
void moveRayToBufferDuringTrace (std::shared_ptr< Ray > &ray, const THREAD_ID tid, const AcquireMoveDuringTraceKey &)
 INTERNAL method for moving a Ray into the buffer during tracing.
 
MeshBase & meshBase () const
 Access to the libMesh MeshBase.
 
MooseMesh & mesh ()
 
virtual const Point & getSideNormal (const Elem *elem, const unsigned short side, const THREAD_ID tid)
 Get the outward normal for a given element side.
 
virtual const Point * getElemNormals (const Elem *, const THREAD_ID)
 Gets the outward normals for a given element.
 
RayData getBankedRayData (const RayID ray_id, const RayDataIndex index) const
 Gets the data value for a banked ray with a given ID.
 
RayData getBankedRayAuxData (const RayID ray_id, const RayDataIndex index) const
 Gets the data value for a banked ray with a given ID.
 
RayID registeredRayID (const std::string &name, const bool graceful=false) const
 Gets the ID of a registered ray.
 
const std::string & registeredRayName (const RayID ray_id) const
 Gets the name of a registered ray.
 
bool useRayRegistration () const
 Whether or not ray registration is being used.
 
bool dataOnCacheTraces () const
 Whether or not to store the Ray data on the cached Ray traces.
 
bool auxDataOnCacheTraces () const
 Whether or not to store the Ray aux data on the cached Ray traces.
 
bool segmentsOnCacheTraces () const
 Whether or not to cache individual element segments when _cache_traces = true.
 
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).
 
TraceData & initThreadedCachedTrace (const std::shared_ptr< Ray > &ray, THREAD_ID tid)
 Initialize a Ray in the threaded cached trace map to be filled with segments.
 
const std::vector< TraceData > & getCachedTraces () const
 Get the cached trace data structure.
 
Real subdomainHmax (const SubdomainID subdomain_id) const
 Get the cached hmax for all elements in a subdomain.
 
virtual void onCompleteRay (const std::shared_ptr< Ray > &ray)
 Entry point for acting on a ray when it is completed (shouldContinue() == false)
 
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.
 
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.
 
bool currentlyPropagating () const
 Whether or not the study is propagating (tracing Rays)
 
bool currentlyGenerating () const
 Whether or not the study is generating.
 
bool verifyRays () const
 Whether or not to verify if Rays have valid information before being traced.
 
bool verifyTraceIntersections () const
 Whether or not trace verification is enabled in devel/dbg modes.
 
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.
 
bool warnNonPlanar () const
 Whether or not to produce a warning when interacting with a non-planar mesh.
 
ParallelStudy< std::shared_ptr< Ray >, Ray > * parallelStudy ()
 The underlying parallel study: used for the context for calling the packed range routines.
 
const libMesh::Elem & elemSide (const libMesh::Elem &elem, const unsigned int s, const THREAD_ID tid=0)
 Get an element's side pointer without excessive memory allocation.
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObject * primaryThreadCopy ()
 
SubProblem & getSubProblem () 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< MooseObject > getSharedPtr ()
 
std::shared_ptr< const MooseObject > getSharedPtr () const
 
bool isKokkosObject () const
 
MooseApp & getMooseApp () 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 InputParameters & parameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") 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 ExecFlagEnum & getExecuteOnEnum () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBase & getUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBase & getUserObjectBaseByName (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< SubdomainID > getMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryID > getMaterialPropertyBoundaryIDs (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)
 
MaterialBase & getMaterial (const std::string &name)
 
MaterialBase & getMaterial (const std::string &name)
 
MaterialBase & getMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBase & getMaterialByName (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 Function & getFunction (const std::string &name) const
 
const Function & getFunctionByName (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 T & getKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const T & getKokkosFunctionByName (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 VectorPostprocessorValue & getVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOldByName (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
 
T & getSampler (const std::string &name)
 
Sampler & getSampler (const std::string &name)
 
T & getSamplerByName (const SamplerName &name)
 
Sampler & getSamplerByName (const SamplerName &name)
 
virtual void meshDisplaced ()
 
PerfGraph & perfGraph ()
 
const PostprocessorValue & getPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValue & getPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValue & getPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOlderByName (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 Distribution & getDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const Distribution & getDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const Distribution & getDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const Distribution & getDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (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< Ray > acquireRayDuringTrace (const THREAD_ID tid, const AcquireMoveDuringTraceKey &)
 INTERNAL methods for acquiring a Ray during a trace in RayKernels and RayBCs.
 
std::shared_ptr< Ray > acquireRayInternal (const RayID id, const std::size_t data_size, const std::size_t aux_data_size, const bool reset, const AcquireRayInternalKey &)
 
TraceRay & traceRay (const THREAD_ID tid)
 Gets the threaded TraceRay object for tid.
 
const TraceRay & traceRay (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

void defineRays () override
 Entry point for the user to create Rays.
 
virtual void meshChanged () override
 
virtual void generateRays () override
 Subclasses should override this to determine how to generate Rays.
 
virtual void preExecuteStudy ()
 Entry point before study execution.
 
virtual void postExecuteStudy ()
 Entry point after study execution.
 
Real computeTotalVolume ()
 Helper function for computing the total domain volume.
 
std::vector< RayKernelBase * > & currentRayKernelsWrite (THREAD_ID tid)
 Gets the writeable current RayKernels for a thread.
 
void reserveRayBuffer (const std::size_t size)
 Reserve size entires in the Ray buffer.
 
bool sameLevelActiveElems () const
 Determine whether or not the mesh currently has active elements that are all the same level.
 
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.
 
const std::vector< std::shared_ptr< Ray > > & rayBank () const
 Get the Ray bank.
 
std::shared_ptr< Ray > getBankedRay (const RayID ray_id) const
 Gets the Ray with the ID ray_id from the Ray bank.
 
void resetUniqueRayIDs ()
 Resets the generation of unique RayIDs via generateUniqueRayID() to the beginning of the range.
 
void resetReplicatedRayIDs ()
 Resets the generation of unique replicated RayIDs accessed via generateReplicatedRayID().
 
std::vector< RayTracingObject * > getRayTracingObjects ()
 Gets all of the currently active RayTracingObjects.
 
virtual RayID generateUniqueRayID (const THREAD_ID tid)
 Generates a unique RayID to be used for a Ray.
 
RayID generateReplicatedRayID ()
 Generates a Ray ID that is replicated across all processors.
 
void moveRayToBuffer (std::shared_ptr< Ray > &ray)
 Moves a ray to the buffer to be traced during generateRays().
 
void moveRaysToBuffer (std::vector< std::shared_ptr< Ray > > &rays)
 Moves rays to the buffer to be traced during generateRays().
 
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 ReporterContextBase & getReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterName & getReporterName (const std::string &param_name) const
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (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 VariableValue & coupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValue & adCoupledScalarValue (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 VariableValue & coupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
const VariableValue & coupledMatrixTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValue & adCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagScalarValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::Scalar< const Real > kokkosCoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalar * getScalarVar (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 T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
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< Ray > acquireRay ()
 User APIs for constructing Rays within the RayTracingStudy.
 
std::shared_ptr< Ray > acquireUnsizedRay ()
 Acquire a Ray from the pool of Rays within generateRays(), without resizing the data (sizes the data to zero).
 
std::shared_ptr< Ray > acquireReplicatedRay ()
 Acquire a Ray from the pool of Rays within generateRays() in a replicated fashion.
 
std::shared_ptr< Ray > acquireCopiedRay (const Ray &ray)
 Acquires a Ray that that is copied from another Ray within generateRays().
 
std::shared_ptr< Ray > acquireRegisteredRay (const std::string &name)
 Acquires a Ray with a given name within generateRays().
 

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.
 
const std::vector< Point > _start_points
 The points to start the Rays from.
 
const std::vector< Point > *const _end_points
 The Ray end points (if defined)
 
const std::vector< Point > *const _directions
 The Ray directions (if defined)
 
const std::vector< Real > *const _max_distances
 The Ray max distances (if defined)
 
const std::vector< RayDataIndex > _ray_data_indices
 The Ray data indices (if defined)
 
const std::vector< std::vector< Real > > *const _initial_ray_data
 The initial Ray data to set (if defined)
 
const std::vector< RayDataIndex > _ray_aux_data_indices
 The Ray aux data indices (if defined)
 
const std::vector< std::vector< Real > > *const _initial_ray_aux_data
 The initial Ray data to set (if defined)
 
std::vector< std::shared_ptr< Ray > > & _rays
 Vector of Rays that the user will fill into in defineRays() (restartable)
 
const bool _define_rays_replicated
 Whether or not the Rays filled into _rays are replicated across all processors.
 
const bool _claim_after_define_rays
 Whether or not Rays need to be claimed after defineRays()
 
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.
 
MooseMesh & _mesh
 The Mesh.
 
const Parallel::Communicator & _comm
 The Communicator.
 
const processor_id_type _pid
 The rank of this processor (this actually takes time to lookup - so just do it once)
 
const bool _ray_kernel_coverage_check
 Whether or not to perform coverage checks on RayKernels.
 
const bool _warn_non_planar
 Whether not to warn if non-planar faces are found.
 
const bool _use_ray_registration
 Whether or not to use Ray registration.
 
const bool _use_internal_sidesets
 Whether or not to use the internal sidesets in ray tracing.
 
const bool _tolerate_failure
 Whether or not to tolerate a Ray Tracing failure.
 
const bool _bank_rays_on_completion
 Whether or not to bank rays on completion.
 
const bool _ray_dependent_subdomain_setup
 Whether or not subdomain setup is dependent on the Ray.
 
bool _always_cache_traces
 Whether or not to cache traces on every trace execution.
 
const bool _data_on_cache_traces
 Whether or not to store the Ray data on the cache traces.
 
const bool _aux_data_on_cache_traces
 Whether or not to store the Ray aux data on the cache traces.
 
const bool _segments_on_cache_traces
 Whether or not to cache individual element segments when caching.
 
const Real _ray_max_distance
 Max distance a Ray can travel before being killed (can change)
 
const bool _verify_rays
 Whether or not to verify if Rays have valid information before being traced.
 
const bool _verify_trace_intersections
 Whether or not to verify the trace intersections in devel and dbg modes.
 
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
 

Private Member Functions

void claimRaysInternal ()
 
void defineRaysInternal ()
 
void verifyReplicatedRays ()
 Verifies that the Rays in _rays are replicated across processors.
 
void coverageChecks ()
 Perform coverage checks (coverage of RayMaterials and RayKernels, if enabled)
 
void dependencyChecks ()
 Perform checks to see if the listed dependencies in the RayTracingObjects exist.
 
void verifyDependenciesExist (const std::vector< RayTracingObject * > &rtos)
 Verifies that the dependencies exist for a set of RayTracingObjects.
 
void traceableMeshChecks ()
 Check for if all of the element types in the mesh are supported by ray tracing.
 
void periodicBoundaryChecks ()
 Check for overlapping PeriodicRayBC boundaries and check for cases in which ghosting may not be sufficient with distributed mesh for overlapping periodic boundaries.
 
void internalSidesetSetup ()
 Does the setup for internal sidesets.
 
void nonPlanarSideSetup ()
 Sets up the caching of whether or not each element side is non-planar, which is stored in _non_planar_sides.
 
void localElemIndexSetup ()
 Sets up the _elem_index_helper, which is used for obtaining a contiguous index for all elements that this processor knows about.
 
void registeredRaySetup ()
 Sets up the maps from Ray to associated RayTracingObjects if _use_ray_registration.
 
void zeroAuxVariables ()
 Zero the AuxVariables that the registered AuxRayKernels contribute to.
 
void subdomainHMaxSetup ()
 Caches the hmax for all elements in each subdomain.
 
RayDataIndex registerRayDataInternal (const std::string &name, const bool aux)
 Internal method for registering Ray data or Ray aux data with a name.
 
std::vector< RayDataIndex > registerRayDataInternal (const std::vector< std::string > &names, const bool aux)
 Internal method for registering Ray data or Ray aux data with names.
 
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.
 
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.
 
const std::string & getRayDataNameInternal (const RayDataIndex index, const bool aux) const
 Internal method for getting the name of Ray data or Ray aux data.
 
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's data or aux data from the Ray banks.
 
RayID registerRay (const std::string &name)
 Registers a Ray with a given name.
 
const Moose::FunctionBase * getKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBase & getUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const T & castUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const VectorPostprocessorValue & getVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
 
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool vectorPostprocessorsAdded () const
 
bool reportersAdded () const
 
void possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string &param_name="") const
 
RestartableDataValue & registerRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValue & getMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 
const VariableValue * getDefaultValue (const std::string &var_name) const
 
const ADVariableValue * getADDefaultValue (const std::string &var_name) const
 
void checkVar (const std::string &var_name) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagScalarVariable (const std::string &var_name, const std::string &tag_name, unsigned int comp) const
 
Moose::MaterialDataType getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const
 
unsigned int getMaxQps () const
 
void addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name)
 
const PostprocessorValue & getPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

std::vector< std::shared_ptr< Ray > > & _local_rays
 Storage for all of the Rays this processor is responsible for (restartable)
 
ClaimRays _claim_rays
 The object used to claim Rays.
 
bool & _should_claim_rays
 Whether or not we should call claimRays() on the next generateRays() (restartable)
 
std::vector< libMesh::ElemSideBuilder > _threaded_elem_side_builders
 Threaded helpers for building element sides without extraneous allocation.
 
std::chrono::steady_clock::time_point _execution_start_time
 Timing.
 
std::chrono::steady_clock::duration _execution_time
 
std::chrono::steady_clock::duration _generation_time
 
std::chrono::steady_clock::duration _propagation_time
 
std::unordered_map< std::string, RayDataIndex > _ray_data_map
 The map from Ray data names to index.
 
std::unordered_map< std::string, RayDataIndex > _ray_aux_data_map
 The map from Ray aux data names to index.
 
std::vector< std::string > _ray_data_names
 The names for each Ray data entry.
 
std::vector< std::string > _ray_aux_data_names
 The names for each Ray aux data entry.
 
std::unordered_map< std::string, RayID > & _registered_ray_map
 Map from registered Ray name to ID.
 
std::vector< std::string > & _reverse_registered_ray_map
 Map from registered Ray ID to name.
 
std::vector< TraceData > _cached_traces
 Storage for the cached traces.
 
std::vector< std::vector< TraceData > > _threaded_cached_traces
 The threaded storage for cached traces.
 
std::vector< std::size_t > _num_cached
 Number of currently cached objects for Jacobian/residual for each thread.
 
std::set< BoundaryID > _internal_sidesets
 The BoundaryIDs on the local mesh that have internal RayBCs.
 
std::vector< std::vector< std::vector< BoundaryID > > > _internal_sidesets_map
 Internal sideset data, if internal sidesets exist (indexed with getLocalElemIndex())
 
bool _has_non_planar_sides
 Whether or not the local mesh has elements with non-planar sides.
 
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 here to avoid a std::vector<bool>; 0 = false, otherwise true.
 
bool _has_same_level_active_elems
 Whether or not the mesh has active elements of the same level.
 
libMesh::BoundingBox _b_box
 Nodal bounding box for the domain.
 
libMesh::BoundingBox _loose_b_box
 Loose nodal bounding box for the domain.
 
Real _domain_max_length
 An inflated max distance for the domain.
 
Real _total_volume
 The total volume of the domain.
 
std::vector< TheWarehouse::QueryCache< AttribSubdomains > > _threaded_cache_ray_kernel
 Threaded cached subdomain query for RayKernelBase objects pertaining to this study.
 
std::vector< TheWarehouse::QueryCache< AttribBoundaries > > _threaded_cache_ray_bc
 Threaded cached boundary query for RayBC objects pertaining to this study.
 
std::vector< std::vector< std::set< const RayTracingObject * > > > _threaded_ray_object_registration
 Threaded storage for all of the RayTracingObjects associated with a single Ray.
 
std::vector< std::vector< RayKernelBase * > > _threaded_current_ray_kernels
 The current RayKernel objects for each thread.
 
std::vector< std::shared_ptr< TraceRay > > _threaded_trace_ray
 The TraceRay objects for each thread (they do the physical tracing)
 
std::vector< std::unique_ptr< libMesh::FEBase > > _threaded_fe_face
 Face FE used for computing face normals for each thread.
 
std::vector< std::unique_ptr< libMesh::QBase > > _threaded_q_face
 Face quadrature 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.
 
std::vector< std::shared_ptr< Ray > > _ray_bank
 Cumulative Ray bank - stored only when _bank_rays_on_completion.
 
std::vector< RayID > _threaded_next_ray_id
 Storage for the next available unique RayID, obtained via generateUniqueRayID()
 
RayID _replicated_next_ray_id
 Storage for the next available replicated RayID, obtained via generateReplicatedRayID()
 
const std::unique_ptr< ParallelRayStudy > _parallel_ray_study
 The study that used is to actually execute (trace) the Rays.
 
std::unique_ptr< libMesh::QBase > _segment_qrule
 Quadrature rule for laying points across a 1D ray segment.
 
unsigned long long int _ending_processor_crossings
 Total number of processor crossings 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 _total_processor_crossings
 Total number of processor crossings.
 
unsigned int _max_processor_crossings
 Max number of processor crossings for all Rays.
 
unsigned long long int _ending_intersections
 Total number of Ray/element intersections for Rays that finished on this processor.
 
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 long long int _total_intersections
 Total number of Ray/element intersections.
 
unsigned int _max_intersections
 Max number of intersections for a single Ray.
 
unsigned int _max_trajectory_changes
 Max number of trajectory changes for a single Ray.
 
Real _ending_distance
 Total distance traveled by Rays that end on this processor.
 
Real _total_distance
 Total distance traveled by all Rays.
 
std::vector< unsigned long long int > _local_trace_ray_results
 Cumulative results on this processor from the threaded TraceRay objects.
 
std::unordered_map< SubdomainID, Real > _subdomain_hmax
 The cached hmax for all elements in a subdomain.
 
bool _called_initial_setup
 Whether or not we've called initial setup - used to stop from late registration.
 
ElemIndexHelper _elem_index_helper
 Helper for defining a local contiguous index for each element.
 
Threads::spin_mutex _spin_mutex
 Spin mutex object for locks.
 
UserObject * _primary_thread_copy
 
std::set< std::string > _supplied_uo
 
const ParallelParamObject & _parent
 
const MooseBase & _si_moose_base
 
const FEProblemBase * _si_problem
 
ExecFlagEnum _empty_execute_enum
 
const MooseObject & _fni_object
 
const InputParameters & _fni_params
 
FEProblemBase & _fni_feproblem
 
const THREAD_ID _fni_tid
 
const MooseObject & _uoi_moose_object
 
const FEProblemBase & _uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const MooseObject & _ppi_moose_object
 
const InputParameters & _ppi_params
 
const FEProblemBase & _ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const bool _broadcast_by_default
 
const MooseObject & _vpi_moose_object
 
const FEProblemBase & _vpi_feproblem
 
const THREAD_ID _vpi_tid
 
const InputParameters & _ri_params
 
FEProblemBase & _ri_fe_problem_base
 
const ReporterData & _ri_reporter_data
 
const MooseObject & _ri_moose_object
 
const InputParameters & _dni_params
 
FEProblemBase & _dni_feproblem
 
const MooseObject *const _dni_moose_object_ptr
 
const InputParameters & _si_params
 
FEProblemBase & _si_feproblem
 
THREAD_ID _si_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
MooseApp & _meta_data_app
 
const MooseObject *const _meta_data_object
 
const InputParameters & _sc_parameters
 
const std::string & _sc_name
 
const bool _sc_is_implicit
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 
std::unordered_map< std::string, std::unique_ptr< VariableValue > > _default_value
 
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > _dual_default_value
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _sc_coupled_vars
 
std::set< TagID > _sc_coupleable_vector_tags
 
std::set< TagID > _sc_coupleable_matrix_tags
 
const MooseObject & _mi_moose_object
 
const bool _mi_boundary_restricted
 
const std::set< SubdomainID > & _mi_block_ids
 
const std::set< BoundaryID > & _mi_boundary_ids
 
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
 
const std::string _ti_name
 

Detailed Description

Definition at line 25 of file RepeatableRayStudyBaseTest.h.

Constructor & Destructor Documentation

◆ RepeatableRayStudyDefineNoClaimTest()

RepeatableRayStudyDefineNoClaimTest::RepeatableRayStudyDefineNoClaimTest ( const InputParameters &  params)

Definition at line 55 of file RepeatableRayStudyBaseTest.C.

58{
59}
const InputParameters & parameters() const
A RayTracingStudy in which the user defines a set of Rays that can be traced repeatedly.

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 1842 of file RayTracingStudy.C.

1843{
1844 mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1845 return _parallel_ray_study->acquireParallelData(
1846 /* tid = */ 0, &ray, Ray::ConstructRayKey());
1847}
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.
Class that is used as a parameter to the public constructors/reset methods.
Definition Ray.h:100

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

◆ 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 1778 of file RayTracingStudy.C.

1779{
1780 mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1781
1782 return _parallel_ray_study->acquireParallelData(
1783 /* tid = */ 0,
1784 this,
1785 generateUniqueRayID(/* tid = */ 0),
1786 rayDataSize(),
1788 /* reset = */ true,
1790}
std::size_t rayDataSize() const
The registered size of values in the Ray data.
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.

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

◆ 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 1850 of file RayTracingStudy.C.

1851{
1852 mooseAssert(currentlyPropagating(), "Can only use during propagation");
1853 return _parallel_ray_study->acquireParallelData(tid,
1854 this,
1856 rayDataSize(),
1858 /* reset = */ true,
1860}
bool currentlyPropagating() const
Whether or not the study is propagating (tracing Rays)

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

◆ 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.

494 {
495 return _parallel_ray_study->acquireParallelData(
496 0, this, id, data_size, aux_data_size, reset, Ray::ConstructRayKey());
497 }

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

◆ 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 1823 of file RayTracingStudy.C.

1824{
1825 mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1826
1827 // Either register a Ray or get an already registered Ray id
1828 const RayID id = registerRay(name);
1829
1830 // Acquire a Ray with the properly sized data initialized to zero
1831 return _parallel_ray_study->acquireParallelData(
1832 /* tid = */ 0,
1833 this,
1834 id,
1835 rayDataSize(),
1837 /* reset = */ true,
1839}
unsigned long int RayID
Type for a Ray's ID.
Definition Ray.h:44
const std::string & name() const
RayID registerRay(const std::string &name)
Registers a Ray with a given name.

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

◆ 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 1807 of file RayTracingStudy.C.

1808{
1809 mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1810 libmesh_parallel_only(comm());
1811
1812 return _parallel_ray_study->acquireParallelData(
1813 /* tid = */ 0,
1814 this,
1816 rayDataSize(),
1818 /* reset = */ true,
1820}
RayID generateReplicatedRayID()
Generates a Ray ID that is replicated across all processors.
const Parallel::Communicator & comm() const

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

◆ 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 1793 of file RayTracingStudy.C.

1794{
1795 mooseAssert(currentlyGenerating(), "Can only use during generateRays()");
1796
1797 return _parallel_ray_study->acquireParallelData(/* tid = */ 0,
1798 this,
1799 generateUniqueRayID(/* tid = */ 0),
1800 /* data_size = */ 0,
1801 /* aux_data_size = */ 0,
1802 /* reset = */ true,
1804}

Referenced by LotsOfRaysRayStudy::defineRay().

◆ 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.

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

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

◆ bankRaysOnCompletion()

bool RayTracingStudy::bankRaysOnCompletion ( ) const
inlineinherited

Whether or not to bank Rays on completion.

Definition at line 214 of file RayTracingStudy.h.

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

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

◆ boundingBox()

const BoundingBox & RayTracingStudy::boundingBox ( ) const
inlineinherited

Get the nodal bounding box for the domain.

Definition at line 422 of file RayTracingStudy.h.

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

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

◆ 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 821 of file RayTracingStudy.C.

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

Referenced by RayTracingStudy::reinitSegment().

◆ claimRaysInternal()

void RepeatableRayStudyBase::claimRaysInternal ( )
privateinherited

Definition at line 138 of file RepeatableRayStudyBase.C.

139{
140 TIME_SECTION("claimRaysInternal", 2, "Claiming Rays");
141
143}
void claim()
Claim the Rays.
Definition ClaimRays.C:40
ClaimRays _claim_rays
The object used to claim Rays.

Referenced by RepeatableRayStudyBase::generateRays().

◆ computeTotalVolume()

Real RayTracingStudy::computeTotalVolume ( )
protectedinherited

Helper function for computing the total domain volume.

Definition at line 1498 of file RayTracingStudy.C.

1499{
1500 Real volume = 0;
1501 for (const auto & elem : *_mesh.getActiveLocalElementRange())
1502 volume += elem->volume();
1503 _communicator.sum(volume);
1504 return volume;
1505}
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

◆ coverageChecks()

void RayTracingStudy::coverageChecks ( )
privateinherited

Perform coverage checks (coverage of RayMaterials and RayKernels, if enabled)

Definition at line 326 of file RayTracingStudy.C.

327{
328 // Check for coverage of RayKernels on domain
330 {
331 std::vector<RayKernelBase *> ray_kernels;
332 getRayKernels(ray_kernels, 0);
333
334 std::set<SubdomainID> ray_kernel_blocks;
335 for (const auto & rk : ray_kernels)
336 ray_kernel_blocks.insert(rk->blockIDs().begin(), rk->blockIDs().end());
337
338 std::set<SubdomainID> missing;
339 std::set_difference(_mesh.meshSubdomains().begin(),
340 _mesh.meshSubdomains().end(),
341 ray_kernel_blocks.begin(),
342 ray_kernel_blocks.end(),
343 std::inserter(missing, missing.begin()));
344
345 if (!missing.empty() && !ray_kernel_blocks.count(Moose::ANY_BLOCK_ID))
346 {
347 std::ostringstream error;
348 error << "Subdomains { ";
349 std::copy(missing.begin(), missing.end(), std::ostream_iterator<SubdomainID>(error, " "));
350 error << "} do not have RayKernels defined!";
351
352 mooseError(error.str());
353 }
354 }
355}
void mooseError(Args &&... args) const
const std::set< SubdomainID > & meshSubdomains() const
void getRayKernels(std::vector< RayKernelBase * > &result, SubdomainID id, THREAD_ID tid)
Fills the active RayKernels associated with this study and a block into result.
const bool _ray_kernel_coverage_check
Whether or not to perform coverage checks on RayKernels.
const SubdomainID ANY_BLOCK_ID

Referenced by RayTracingStudy::initialSetup().

◆ 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.

415 {
417 }
std::vector< std::vector< RayKernelBase * > > _threaded_current_ray_kernels
The current RayKernel objects for each thread.

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

◆ 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 {
724 }

◆ 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.

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

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

◆ defineRays()

void RepeatableRayStudyDefineNoClaimTest::defineRays ( )
inlineoverrideprotectedvirtual

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.

Reimplemented from RepeatableRayStudy.

Definition at line 33 of file RepeatableRayStudyBaseTest.h.

33{}

◆ defineRaysInternal()

void RepeatableRayStudyBase::defineRaysInternal ( )
privateinherited

Definition at line 146 of file RepeatableRayStudyBase.C.

147{
148 {
149 TIME_SECTION("defineRaysInternal", 2, "Defining Rays");
150
151 _rays.clear();
152 _local_rays.clear();
153
154 defineRays();
155 }
156
157 // Do we actually have Rays
158 auto num_rays = _rays.size();
159 _communicator.sum(num_rays);
160 if (!num_rays)
161 mooseError("No Rays were moved to _rays in defineRays()");
162 for (const auto & ray : _rays)
163 if (!ray)
164 mooseError("A nullptr Ray was found in _rays after defineRays().");
165
166 // The Rays in _rays are ready to go as is: they have their starting element
167 // set, their incoming set (if any), and are on the processor that owns said
168 // starting element. Therefore, we move them right into _local_rays and
169 // set that we don't need to claim.
171 {
172 _local_rays.reserve(_rays.size());
173 for (const std::shared_ptr<Ray> & ray : _rays)
174 _local_rays.emplace_back(ray);
175
176 _should_claim_rays = false;
177 }
178 // Claiming is required after defining. The Rays in _rays should not
179 // have their starting elems or incoming sides set - verify that.
180 else
181 {
182 for (const std::shared_ptr<Ray> & ray : _rays)
183 if (ray->currentElem() || !ray->invalidCurrentIncomingSide())
185 "A Ray was found in _rays after defineRays() that has a starting element or "
186 "incoming side set.\n\n",
187 "With the mode in which the private param '_claim_after_define_rays' == true,",
188 "\nthe defined Rays at this point should not have their starting elem/side set.\n",
189 "\nTheir starting information will be set internally using a claiming process.\n\n",
190 ray->getInfo());
191 }
192
193 // Sanity checks on if the Rays are actually replicated
196}
bool verifyRays() const
Whether or not to verify if Rays have valid information before being traced.
std::vector< std::shared_ptr< Ray > > & _rays
Vector of Rays that the user will fill into in defineRays() (restartable)
void verifyReplicatedRays()
Verifies that the Rays in _rays are replicated across processors.
const bool _claim_after_define_rays
Whether or not Rays need to be claimed after defineRays()
std::vector< std::shared_ptr< Ray > > & _local_rays
Storage for all of the Rays this processor is responsible for (restartable)
bool & _should_claim_rays
Whether or not we should call claimRays() on the next generateRays() (restartable)
const bool _define_rays_replicated
Whether or not the Rays filled into _rays are replicated across all processors.
virtual void defineRays()=0
Entry point for the user to create Rays.
if(subdm)

Referenced by RepeatableRayStudyBase::generateRays().

◆ dependencyChecks()

void RayTracingStudy::dependencyChecks ( )
privateinherited

Perform checks to see if the listed dependencies in the RayTracingObjects exist.

Definition at line 358 of file RayTracingStudy.C.

359{
360 std::vector<RayTracingObject *> ray_tracing_objects;
361
362 getRayKernels(ray_tracing_objects, 0);
363 verifyDependenciesExist(ray_tracing_objects);
364
365 getRayBCs(ray_tracing_objects, 0);
366 verifyDependenciesExist(ray_tracing_objects);
367}
void verifyDependenciesExist(const std::vector< RayTracingObject * > &rtos)
Verifies that the dependencies exist for a set of RayTracingObjects.
void getRayBCs(std::vector< RayBoundaryConditionBase * > &result, BoundaryID id, THREAD_ID tid)
Fills the active RayBCs associated with this study and a boundary into result.

Referenced by RayTracingStudy::initialSetup().

◆ domainMaxLength()

Real RayTracingStudy::domainMaxLength ( ) const
inlineinherited

Get the inflated maximum length across the domain.

Definition at line 433 of file RayTracingStudy.h.

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

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

◆ 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.

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.

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

◆ 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.

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.

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 320 of file RayTracingStudy.C.

321{
322 executeStudy();
323}
void executeStudy()
Method for executing the study so that it can be called out of the standard UO execute()

Referenced by SingleTraceLineSourceTest::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 882 of file RayTracingStudy.C.

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

Referenced by RayTracingStudy::execute().

◆ 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(); }

◆ 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 }

◆ 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}
std::shared_ptr< Ray > acquireCopiedRay(const Ray &ray)
Acquires a Ray that that is copied from another Ray within generateRays().
void moveRayToBuffer(std::shared_ptr< Ray > &ray)
Moves a ray to the buffer to be traced during generateRays().
void reserveRayBuffer(const std::size_t size)
Reserve size entires in the Ray buffer.
bool & _should_define_rays
Whether or not we should call defineRays() on the next generateRays() Can be set to true in derived c...

◆ generateReplicatedRayID()

RayID RayTracingStudy::generateReplicatedRayID ( )
protectedinherited

Generates a Ray ID that is replicated across all processors.

Definition at line 1761 of file RayTracingStudy.C.

1762{
1763 return _replicated_next_ray_id++;
1764}
RayID _replicated_next_ray_id
Storage for the next available replicated RayID, obtained via generateReplicatedRayID()

Referenced by RayTracingStudy::acquireReplicatedRay().

◆ 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 1736 of file RayTracingStudy.C.

1737{
1738 // Get the current ID to return
1739 const auto id = _threaded_next_ray_id[tid];
1740
1741 // Advance so that the next call has the correct ID
1743
1744 return id;
1745}
std::vector< RayID > _threaded_next_ray_id
Storage for the next available unique RayID, obtained via generateUniqueRayID()
processor_id_type n_processors() const

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

◆ generationTime()

Real RayTracingStudy::generationTime ( ) const
inlineinherited

Duration for creation of all Rays in seconds.

Definition at line 200 of file RayTracingStudy.h.

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

Referenced by PerProcessorRayTracingResultsVectorPostprocessor::execute().

◆ 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 1388 of file RayTracingStudy.C.

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

Referenced by RayTracingStudy::getBankedRayDataInternal().

◆ 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 1432 of file RayTracingStudy.C.

1433{
1434 return getBankedRayDataInternal(ray_id, index, /* aux = */ true);
1435}
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's data or aux data ...

Referenced by RayDataValue::getValue().

◆ 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 1426 of file RayTracingStudy.C.

1427{
1428 return getBankedRayDataInternal(ray_id, index, /* aux = */ false);
1429}

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

◆ getBankedRayDataInternal()

RayData RayTracingStudy::getBankedRayDataInternal ( const RayID  ray_id,
const RayDataIndex  index,
const bool  aux 
) const
privateinherited

Internal method for getting the value (replicated across all processors) in a Ray's data or aux data from the Ray banks.

Definition at line 1413 of file RayTracingStudy.C.

1416{
1417 // Will be a nullptr shared_ptr if this processor doesn't own the Ray
1418 const std::shared_ptr<Ray> ray = getBankedRay(ray_id);
1419
1420 Real value = ray ? (aux ? ray->auxData(index) : ray->data(index)) : 0;
1421 _communicator.sum(value);
1422 return value;
1423}
std::shared_ptr< Ray > getBankedRay(const RayID ray_id) const
Gets the Ray with the ID ray_id from the Ray bank.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

Referenced by RayTracingStudy::getBankedRayAuxData(), and RayTracingStudy::getBankedRayData().

◆ getCachedTraces()

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

◆ 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.

532 {
533 mooseError("Unimplemented element normal caching in ", type(), "::getElemNormals()");
534 }

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

◆ getInternalSidesets() [1/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.

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

Referenced by ViewFactorRayStudy::initialSetup().

◆ getInternalSidesets() [2/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)

Definition at line 1508 of file RayTracingStudy.C.

1509{
1510 mooseAssert(_use_internal_sidesets, "Not using internal sidesets");
1511 mooseAssert(hasInternalSidesets(), "Processor does not have internal sidesets");
1512 mooseAssert(_internal_sidesets_map.size() > _elem_index_helper.getIndex(elem),
1513 "Internal sideset map not initialized");
1514
1515 const auto index = _elem_index_helper.getIndex(elem);
1516 return _internal_sidesets_map[index];
1517}
libMesh::dof_id_type getIndex(const libMesh::Elem *elem) const
Get the index associated with the element elem.
const bool _use_internal_sidesets
Whether or not to use the internal sidesets in ray tracing.
std::vector< std::vector< std::vector< BoundaryID > > > _internal_sidesets_map
Internal sideset data, if internal sidesets exist (indexed with getLocalElemIndex())
ElemIndexHelper _elem_index_helper
Helper for defining a local contiguous index for each element.
bool hasInternalSidesets() const
Whether or not the local mesh has internal sidesets that have RayBCs on them.

Referenced by TraceRay::applyOnInternalBoundary().

◆ 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 1221 of file RayTracingStudy.C.

1223{
1224 return getRayDataIndexInternal(name, /* aux = */ true, graceful);
1225}
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.

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

◆ 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 1228 of file RayTracingStudy.C.

1230{
1231 return getRayDataIndicesInternal(names, /* aux = */ true, graceful);
1232}
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 1235 of file RayTracingStudy.C.

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

Referenced by Ray::getInfo().

◆ 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 1299 of file RayTracingStudy.C.

1302{
1303 // If the cache doesn't have any attributes yet, it means that we haven't set
1304 // the conditions yet. We do this so that it can be generated on the fly on first use.
1305 if (!_threaded_cache_ray_bc[tid].numAttribs())
1306 {
1308 mooseError("Should not call getRayBCs() before initialSetup()");
1309
1311 .query()
1312 .condition<AttribRayTracingStudy>(this)
1313 .condition<AttribSystem>("RayBoundaryCondition")
1314 .condition<AttribThread>(tid);
1315 _threaded_cache_ray_bc[tid] = query.clone();
1316 }
1317
1318 _threaded_cache_ray_bc[tid].queryInto(result, std::make_tuple(id, false));
1319}
Attribute for the RayTracingStudy a RayTracingObject is associated with.
TheWarehouse & theWarehouse() const
std::vector< TheWarehouse::QueryCache< AttribBoundaries > > _threaded_cache_ray_bc
Threaded cached boundary query for RayBC objects pertaining to this study.
Query query()
query_obj query

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

◆ getRayBCs() [2/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 1322 of file RayTracingStudy.C.

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

◆ getRayBCs() [3/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 }

◆ getRayBCs() [4/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 }

◆ 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 1190 of file RayTracingStudy.C.

1191{
1192 return getRayDataIndexInternal(name, /* aux = */ false, graceful);
1193}

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

◆ getRayDataIndexInternal()

RayDataIndex RayTracingStudy::getRayDataIndexInternal ( const std::string &  name,
const bool  aux,
const bool  graceful 
) const
privateinherited

Internal method for getting the index of Ray data or Ray aux data.

Definition at line 1126 of file RayTracingStudy.C.

1129{
1130 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1131
1132 const auto & map = aux ? _ray_aux_data_map : _ray_data_map;
1133 const auto find = map.find(name);
1134 if (find != map.end())
1135 return find->second;
1136
1137 if (graceful)
1139
1140 const auto & other_map = aux ? _ray_data_map : _ray_aux_data_map;
1141 if (other_map.find(name) != other_map.end())
1142 mooseError("Ray data with name '",
1143 name,
1144 "' was not found.\n\n",
1145 "However, Ray ",
1146 (aux ? "non-aux" : "aux"),
1147 " data with said name was found.\n",
1148 "Did you mean to use ",
1149 (aux ? "getRayDataIndex()/getRayDataIndices()?"
1150 : "getRayAuxDataIndex()/getRayAuxDataIndices()"),
1151 "?");
1152
1153 mooseError("Unknown Ray ", (aux ? "aux " : ""), "data with name ", name);
1154}
std::unordered_map< std::string, RayDataIndex > _ray_aux_data_map
The map from Ray aux data names to index.
Threads::spin_mutex _spin_mutex
Spin mutex object for locks.
std::unordered_map< std::string, RayDataIndex > _ray_data_map
The map from Ray data names to index.
static const RayDataIndex INVALID_RAY_DATA_INDEX
Invalid index into a Ray's data.
Definition Ray.h:212
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)

Referenced by RayTracingStudy::getRayAuxDataIndex(), RayTracingStudy::getRayDataIndex(), and RayTracingStudy::getRayDataIndicesInternal().

◆ 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 1196 of file RayTracingStudy.C.

1198{
1199 return getRayDataIndicesInternal(names, /* aux = */ false, graceful);
1200}

◆ getRayDataIndicesInternal()

std::vector< RayDataIndex > RayTracingStudy::getRayDataIndicesInternal ( const std::vector< std::string > &  names,
const bool  aux,
const bool  graceful 
) const
privateinherited

Internal method for getting the indicies of Ray data or Ray aux data.

Definition at line 1157 of file RayTracingStudy.C.

1160{
1161 std::vector<RayDataIndex> indices(names.size());
1162 for (std::size_t i = 0; i < names.size(); ++i)
1163 indices[i] = getRayDataIndexInternal(names[i], aux, graceful);
1164 return indices;
1165}

Referenced by RayTracingStudy::getRayAuxDataIndices(), and RayTracingStudy::getRayDataIndices().

◆ 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 1203 of file RayTracingStudy.C.

1204{
1205 return getRayDataNameInternal(index, /* aux = */ false);
1206}

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

◆ getRayDataNameInternal()

const std::string & RayTracingStudy::getRayDataNameInternal ( const RayDataIndex  index,
const bool  aux 
) const
privateinherited

Internal method for getting the name of Ray data or Ray aux data.

Definition at line 1168 of file RayTracingStudy.C.

1169{
1170 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1171
1172 if ((aux ? rayAuxDataSize() : rayDataSize()) < index)
1173 mooseError("Unknown Ray ", aux ? "aux " : "", "data with index ", index);
1174 return aux ? _ray_aux_data_names[index] : _ray_data_names[index];
1175}
std::vector< std::string > _ray_aux_data_names
The names for each Ray aux data entry.
std::vector< std::string > _ray_data_names
The names for each Ray data entry.

Referenced by RayTracingStudy::getRayAuxDataName(), and RayTracingStudy::getRayDataName().

◆ 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 1249 of file RayTracingStudy.C.

1250{
1251 // If the cache doesn't have any attributes yet, it means that we haven't set
1252 // the conditions yet. We do this so that it can be generated on the fly on first use.
1253 if (!_threaded_cache_ray_kernel[tid].numAttribs())
1254 {
1256 mooseError("Should not call getRayKernels() before initialSetup()");
1257
1259 .query()
1260 .condition<AttribRayTracingStudy>(this)
1261 .condition<AttribSystem>("RayKernel")
1262 .condition<AttribThread>(tid);
1263 _threaded_cache_ray_kernel[tid] = query.clone();
1264 }
1265
1266 _threaded_cache_ray_kernel[tid].queryInto(result, id);
1267}
std::vector< TheWarehouse::QueryCache< AttribSubdomains > > _threaded_cache_ray_kernel
Threaded cached subdomain query for RayKernelBase objects pertaining to this study.

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

◆ getRayKernels() [2/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 1270 of file RayTracingStudy.C.

1274{
1275 // No Ray registration: no need to sift through objects
1277 {
1278 getRayKernels(result, id, tid);
1279 }
1280 // Has Ray registration: only pick the objects associated with ray_id
1281 else
1282 {
1283 // Get all of the kernels on this block
1284 std::vector<RayKernelBase *> rkbs;
1285 getRayKernels(rkbs, id, tid);
1286
1287 // The RayTracingObjects associated with this ray
1288 const auto & ray_id_rtos = _threaded_ray_object_registration[tid][ray_id];
1289
1290 // The result is the union of all of the kernels and the objects associated with this Ray
1291 result.clear();
1292 for (auto rkb : rkbs)
1293 if (ray_id_rtos.count(rkb))
1294 result.push_back(rkb);
1295 }
1296}

◆ getRayKernels() [3/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 }

◆ getRayTracingObjects()

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

Gets all of the currently active RayTracingObjects.

Definition at line 1368 of file RayTracingStudy.C.

1369{
1370 std::vector<RayTracingObject *> result;
1371 _fe_problem.theWarehouse().query().condition<AttribRayTracingStudy>(this).queryInto(result);
1372 return result;
1373}

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

◆ 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 1661 of file RayTracingStudy.C.

1662{
1663 std::unordered_map<std::pair<const Elem *, unsigned short>, Point> & cache =
1665
1666 // See if we've already cached this side normal
1667 const auto elem_side_pair = std::make_pair(elem, side);
1668 const auto search = cache.find(elem_side_pair);
1669
1670 // Haven't cached this side normal: compute it and then cache it
1671 if (search == cache.end())
1672 {
1673 _threaded_fe_face[tid]->reinit(elem, side);
1674 const auto & normal = _threaded_fe_face[tid]->get_normals()[0];
1675 cache.emplace(elem_side_pair, normal);
1676 return normal;
1677 }
1678
1679 // Have cached this side normal: simply return it
1680 return search->second;
1681}
std::vector< std::unique_ptr< libMesh::FEBase > > _threaded_fe_face
Face FE used for computing face normals for each thread.

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

◆ 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.

449{ return _internal_sidesets.size(); }

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

◆ 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(); }

◆ hasRayData()

bool RayTracingStudy::hasRayData ( ) const
inlineinherited

Whether or not any Ray data are registered.

Definition at line 276 of file RayTracingStudy.h.

276{ return _ray_data_names.size(); }

Referenced by RayTracingMeshOutput::fillFields().

◆ hasRayKernels()

bool RayTracingStudy::hasRayKernels ( const THREAD_ID  tid)
inherited

Whether or not there are currently any active RayKernel objects.

Definition at line 1241 of file RayTracingStudy.C.

1242{
1243 std::vector<RayKernelBase *> result;
1244 getRayKernels(result, tid);
1245 return result.size();
1246}

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

◆ 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.

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

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

◆ 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 ViewFactorRayStudy, and BackfaceCullingStudyTest.

Definition at line 233 of file RayTracingStudy.C.

234{
235 // Keep track of initialSetup call to avoid registration of various things
237
238 // Sets up a local index for each elem this proc knows about
240
241 // Check for RayKernel coverage
243
244 // Make sure the dependencies exist, if any
246
247 // Check for traceable element types
249
250 // Check for sane periodic boundaries
252
253 // Setup for internal sidesets
255
257
258 // Setup approximate hmax for each subdomain
260
261 // Call initial setup on all of the objects
262 for (auto & rto : getRayTracingObjects())
263 rto->initialSetup();
264
265 // Check for proper exec flags with RayKernels
266 std::vector<RayKernelBase *> ray_kernels;
267 getRayKernels(ray_kernels, 0);
268 for (const auto & rkb : ray_kernels)
269 if (dynamic_cast<RayKernel *>(rkb) && !_execute_enum.isValueSet(EXEC_PRE_KERNELS))
270 mooseError("This study has RayKernel objects that contribute to residuals and Jacobians.",
271 "\nIn this case, the study must use the execute_on = PRE_KERNELS");
272
273 // Build 1D quadrature rule for along a segment
274 _segment_qrule = QBase::build(
276}
const ExecFlagType EXEC_PRE_KERNELS
virtual const SystemBase & getSystemBase(const unsigned int sys_num) const
Base class for a ray kernel that contributes to the residual and/or Jacobian.
Definition RayKernel.h:34
void traceableMeshChecks()
Check for if all of the element types in the mesh are supported by ray tracing.
void nonPlanarSideSetup()
Sets up the caching of whether or not each element side is non-planar, which is stored in _non_planar...
virtual void initialSetup() override
void subdomainHMaxSetup()
Caches the hmax for all elements in each subdomain.
void localElemIndexSetup()
Sets up the _elem_index_helper, which is used for obtaining a contiguous index for all elements that ...
void internalSidesetSetup()
Does the setup for internal sidesets.
void coverageChecks()
Perform coverage checks (coverage of RayMaterials and RayKernels, if enabled)
void dependencyChecks()
Perform checks to see if the listed dependencies in the RayTracingObjects exist.
void periodicBoundaryChecks()
Check for overlapping PeriodicRayBC boundaries and check for cases in which ghosting may not be suffi...
const ExecFlagEnum & _execute_enum
unsigned int number() const
virtual libMesh::Order getMinQuadratureOrder()
SystemBase & _sys

Referenced by ViewFactorRayStudy::initialSetup().

◆ 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 1520 of file RayTracingStudy.C.

1521{
1522 mooseAssert(shouldCacheTrace(ray), "Not caching trace");
1523 mooseAssert(currentlyPropagating(), "Should only use while tracing");
1524
1525 _threaded_cached_traces[tid].emplace_back(ray);
1526 return _threaded_cached_traces[tid].back();
1527}
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).

Referenced by TraceRay::trace().

◆ internalSidesetSetup()

void RayTracingStudy::internalSidesetSetup ( )
privateinherited

Does the setup for internal sidesets.

This includes:

  • Setting if the local mesh has internal sidesets that have RayBCs and on which boundary (stored in _internal_sidesets)
  • Sets up the internal sideset mapping that maps element sides to the BoundaryIDs on said side that have internal sidesets that have RayBCs (stored in _internal_sidesets_map)

If _use_internal_sidesets == false, this will still check to make sure that the user does not have internal sidesets with RayBCs on them, and will report an error if so.

Definition at line 523 of file RayTracingStudy.C.

524{
525 // Even if we have _use_internal_sidesets == false, we will make sure the user didn't add RayBCs
526 // on internal boundaries
527
528 // Clear the data structures and size the map based on the elements that we know about
529 _internal_sidesets.clear();
532
533 // First, we are going to store all elements with internal sidesets (if any) that have active
534 // RayBCs on them as elem -> vector of (side, vector of boundary ids)
535 for (const auto & bnd_elem : *_mesh.getBoundaryElementRange())
536 {
537 Elem * elem = bnd_elem->_elem;
538 const unsigned int side = bnd_elem->_side;
539 const auto bnd_id = bnd_elem->_bnd_id;
540
541 // Not internal
542 const Elem * const neighbor = elem->neighbor_ptr(side);
543 if (!neighbor || neighbor == remote_elem)
544 continue;
545
546 // No RayBCs on this sideset
547 std::vector<RayBoundaryConditionBase *> result;
548 getRayBCs(result, bnd_id, 0);
549 if (result.empty())
550 continue;
551
552 if (neighbor->subdomain_id() == elem->subdomain_id())
553 mooseError("RayBCs exist on internal sidesets that are not bounded by a different",
554 "\nsubdomain on each side.",
555 "\n\nIn order to use RayBCs on internal sidesets, said sidesets must have",
556 "\na different subdomain on each side.");
557
558 // Mark that this boundary is an internal sideset with RayBC(s)
559 _internal_sidesets.insert(bnd_id);
560
561 // Get elem's entry in the internal sidset data structure
562 const auto index = _elem_index_helper.getIndex(elem);
563 auto & entry = _internal_sidesets_map[index];
564
565 // Initialize this elem's sides if they have not been already
566 if (entry.empty())
567 entry.resize(elem->n_sides(), std::vector<BoundaryID>());
568
569 // Add the internal boundary to the side entry
570 entry[side].push_back(bnd_id);
571 }
572
574 mooseError("RayBCs are defined on internal sidesets, but the study is not set to use ",
575 "internal sidesets during tracing.",
576 "\n\nSet the parameter use_internal_sidesets = true to enable this capability.");
577}
libMesh::dof_id_type maxIndex() const
Gets the maximum index generated using this object.

Referenced by RayTracingStudy::initialSetup(), and RayTracingStudy::meshChanged().

◆ 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 1712 of file RayTracingStudy.C.

1713{
1714 Real bbox_volume = 1;
1715 for (unsigned int d = 0; d < _mesh.dimension(); ++d)
1716 bbox_volume *= std::abs(_b_box.max()(d) - _b_box.min()(d));
1717
1718 return MooseUtils::absoluteFuzzyEqual(bbox_volume, totalVolume(), TOLERANCE);
1719}
virtual unsigned int dimension() const
Real totalVolume() const
Get the current total volume of the domain.
const Point & max() const
const Point & min() const

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

◆ jacobianSetup()

void RayTracingStudy::jacobianSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 289 of file RayTracingStudy.C.

290{
291 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
292 mooseAssert(_num_cached[tid] == 0, "Cached residuals/Jacobians not empty");
293
294 for (auto & rto : getRayTracingObjects())
295 rto->jacobianSetup();
296}
virtual void jacobianSetup() override

◆ localElemIndexSetup()

void RayTracingStudy::localElemIndexSetup ( )
privateinherited

Sets up the _elem_index_helper, which is used for obtaining a contiguous index for all elements that this processor knows about.

Said index is used for quickly accessing things like internal sidesets and checking if an element side is non-planar during tracing.

Definition at line 515 of file RayTracingStudy.C.

516{
517 // TODO: We could probably minimize this to local active elements followed by
518 // boundary point neighbors, but if using distibuted mesh it really shouldn't matter
519 _elem_index_helper.initialize(_mesh.getMesh().active_element_ptr_range());
520}
void initialize(const libMesh::SimpleRange< libMesh::MeshBase::element_iterator > elems)
Initializes the indices in a contiguous manner for the given element range.
MeshBase & getMesh()

Referenced by RayTracingStudy::initialSetup(), and RayTracingStudy::meshChanged().

◆ localTraceRayResult()

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

Definition at line 174 of file RayTracingStudy.h.

175 {
176 return _local_trace_ray_results[result];
177 }

Referenced by PerProcessorRayTracingResultsVectorPostprocessor::execute().

◆ 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.

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

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

◆ 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; }

◆ maxProcessorCrossings()

unsigned int RayTracingStudy::maxProcessorCrossings ( ) const
inlineinherited

Max number of processor crossings for all Rays.

Definition at line 142 of file RayTracingStudy.h.

142{ return _max_processor_crossings; }

Referenced by RayTracingStudyResult::getValue().

◆ 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; }

◆ 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; }

◆ 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.

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}
virtual void meshChanged() override

◆ 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 1626 of file RayTracingStudy.C.

1627{
1628 mooseAssert(currentlyGenerating(), "Can only use while generating");
1629#ifndef NDEBUG
1630 for (const std::shared_ptr<Ray> & ray : rays)
1631 {
1632 mooseAssert(ray, "Null ray");
1633 mooseAssert(ray->shouldContinue(), "Ray is not continuing");
1634 }
1635#endif
1636
1637 _parallel_ray_study->moveWorkToBuffer(rays, /* tid = */ 0);
1638}

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

◆ 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 1616 of file RayTracingStudy.C.

1617{
1618 mooseAssert(currentlyGenerating(), "Can only use while generating");
1619 mooseAssert(ray, "Null ray");
1620 mooseAssert(ray->shouldContinue(), "Ray is not continuing");
1621
1622 _parallel_ray_study->moveWorkToBuffer(ray, /* tid = */ 0);
1623}

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

◆ 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 1641 of file RayTracingStudy.C.

1644{
1645 mooseAssert(ray, "Null ray");
1646 mooseAssert(currentlyPropagating(), "Can only use while tracing");
1647
1648 _parallel_ray_study->moveWorkToBuffer(ray, tid);
1649}

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

◆ nonPlanarSideSetup()

void RayTracingStudy::nonPlanarSideSetup ( )
privateinherited

Sets up the caching of whether or not each element side is non-planar, which is stored in _non_planar_sides.

This is done because this check is made within TraceRay, and determining whether or not a side is non planar is quite expensive and we don't want to call it mid-trace.

Definition at line 580 of file RayTracingStudy.C.

581{
582 _has_non_planar_sides = false;
583 bool warned = !_warn_non_planar;
584
585 // Nothing to do here for 2D or 1D
586 if (_mesh.dimension() != 3)
587 return;
588
589 // Clear the data structure and size it based on the elements that we know about
590 _non_planar_sides.clear();
592
593 for (const Elem * elem : _mesh.getMesh().active_element_ptr_range())
594 {
595 const auto index = _elem_index_helper.getIndex(elem);
596 auto & entry = _non_planar_sides[index];
597 entry.resize(elem->n_sides(), 0);
598
599 for (const auto s : elem->side_index_range())
600 {
601 const auto & side = elemSide(*elem, s);
602 if (side.n_vertices() < 4)
603 continue;
604
605 if (!side.has_affine_map())
606 {
607 entry[s] = 1;
609
610 if (!warned)
611 {
612 mooseWarning("The mesh contains non-planar faces.\n\n",
613 "Ray tracing on non-planar faces is an approximation and may fail.\n\n",
614 "Use at your own risk! You can disable this warning by setting the\n",
615 "parameter 'warn_non_planar' to false.");
616 warned = true;
617 }
618 }
619 }
620 }
621}
const libMesh::Elem & elemSide(const libMesh::Elem &elem, const unsigned int s, const THREAD_ID tid=0)
Get an element's side pointer without excessive memory allocation.
bool _has_non_planar_sides
Whether or not the local mesh has elements with non-planar sides.
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...
const bool _warn_non_planar
Whether not to warn if non-planar faces are found.
T & getMesh(MooseMesh &mesh)
function to cast mesh
Definition SCM.h:35

Referenced by RayTracingStudy::initialSetup(), and RayTracingStudy::meshChanged().

◆ 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 1065 of file RayTracingStudy.C.

1066{
1067 mooseAssert(currentlyPropagating(), "Should only be called during Ray propagation");
1068
1069 _ending_processor_crossings += ray->processorCrossings();
1071 std::max(_ending_max_processor_crossings, ray->processorCrossings());
1072 _ending_intersections += ray->intersections();
1073 _ending_max_intersections = std::max(_ending_max_intersections, ray->intersections());
1075 std::max(_ending_max_trajectory_changes, ray->trajectoryChanges());
1076 _ending_distance += ray->distance();
1077
1078#ifdef NDEBUG
1079 // In non-opt modes, we will always bank the Rays for debugging
1081#endif
1082 _ray_bank.emplace_back(ray);
1083}

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

◆ parallelRayStudy()

const ParallelRayStudy & RayTracingStudy::parallelRayStudy ( ) const
inlineinherited

◆ 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.

678{ return _parallel_ray_study.get(); }

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

◆ periodicBoundaryChecks()

void RayTracingStudy::periodicBoundaryChecks ( )
privateinherited

Check for overlapping PeriodicRayBC boundaries and check for cases in which ghosting may not be sufficient with distributed mesh for overlapping periodic boundaries.

Definition at line 408 of file RayTracingStudy.C.

409{
410 // Collect the PeriodicRayBCs
411 std::vector<const RayBoundaryConditionBase *> rbc_ptrs;
412 getRayBCs(rbc_ptrs, 0);
413 std::vector<const PeriodicRayBC *> prbc_ptrs;
414 for (const auto rbc_ptr : rbc_ptrs)
415 if (const auto prbc_ptr = dynamic_cast<const PeriodicRayBC *>(rbc_ptr))
416 prbc_ptrs.push_back(prbc_ptr);
417 if (prbc_ptrs.empty())
418 return;
419
420 // Collect each of the periodic boundaries
421 std::map<boundary_id_type,
422 std::tuple<const PeriodicRayBC *,
424 std::unordered_set<dof_id_type>>>
425 boundary_map;
426 for (const auto prbc_ptr : prbc_ptrs)
427 {
428 for (const auto & [bid, pb] : prbc_ptr->getPeriodicBoundaries())
429 {
430 const auto [it, inserted] = boundary_map.emplace(
431 std::piecewise_construct,
432 std::tuple{bid},
433 std::forward_as_tuple(prbc_ptr, pb.get(), std::unordered_set<dof_id_type>()));
434 if (!inserted)
435 prbc_ptr->mooseError("The periodic boundary '",
437 "' has been defined in both ",
438 prbc_ptr->typeAndName(),
439 " and ",
440 std::get<0>(it->second)->typeAndName());
441 }
442 }
443
444 // Because we don't have ghosting setup correctly yet, we need to check if any
445 // of the periodic boundaries are neighbors with distributed mesh. If the
446 // mesh is replicated, we don't need to check this. See #31280.
447 if (comm().size() == 1 || !_mesh.isDistributedMesh())
448 return;
449
450 // Collect all of the nodes that are on each periodic boundary
451 const auto & sideset_map = _mesh.getMesh().get_boundary_info().get_sideset_map();
452 for (const auto & [elem, side_bid_pair] : sideset_map)
453 {
454 const auto [side, bid] = side_bid_pair;
455 if (auto it = boundary_map.find(bid); it != boundary_map.end())
456 for (const auto n : elem->nodes_on_side(side))
457 std::get<2>(it->second).insert(elem->node_ref(n).id());
458 }
459
460 // Distributed meshes have distributed boundary information, so sync
461 for (auto & bid_tuple_pair : boundary_map)
462 comm().set_union(std::get<2>(bid_tuple_pair.second));
463
464 // Check for periodic boundaries that share nodes
465 std::map<std::pair<boundary_id_type, boundary_id_type>,
466 std::pair<const PeriodicRayBC *, const PeriodicRayBC *>>
467 warn_boundaries;
468 for (auto it = boundary_map.begin(); it != boundary_map.end(); ++it)
469 {
470 const auto & [bid, tup] = *it;
471 const auto [prbc_ptr, pb, node_ids] = tup;
472
473 for (auto other_it = std::next(it); other_it != boundary_map.end(); ++other_it)
474 {
475 const auto & [other_bid, other_tup] = *other_it;
476
477 // Don't check against boundaries that are paried together
478 if (pb->pairedboundary == other_bid)
479 continue;
480
481 const auto other_prbc_ptr = std::get<0>(other_tup);
482 const auto & other_node_ids = std::get<2>(other_tup);
483 for (const auto node_id : node_ids)
484 if (other_node_ids.count(node_id))
485 {
486 if (!warn_boundaries.count(std::make_pair(other_bid, bid)))
487 warn_boundaries.emplace(std::make_pair(bid, other_bid),
488 std::make_pair(prbc_ptr, other_prbc_ptr));
489 break;
490 }
491 }
492 }
493
494 if (warn_boundaries.size())
495 {
496 std::ostringstream oss;
497 oss << warn_boundaries.size()
498 << " ray tracing periodic boundaries were found to be neighbors:\n\n";
499 for (const auto & [bids_pair, prbc_ptrs_pair] : warn_boundaries)
500 {
501 const auto [bid, paired_bid] = bids_pair;
502 const auto [prbc_ptr, paired_prbc_ptr] = prbc_ptrs_pair;
503 oss << " '" << _mesh.getBoundaryString(bid) << "' (in " << prbc_ptr->typeAndName()
504 << ") <-> '" << _mesh.getBoundaryString(paired_bid) << "' (in "
505 << paired_prbc_ptr->typeAndName() << ")\n";
506 }
507 oss << "\nThe periodic propagation of rays at points where two or more periodic"
508 << "\nboundaries meet is not fully supported with a distributed mesh."
509 << "\n\nIf you encounter trace failures, you should use a replicated mesh.";
510 mooseWarning(oss.str());
511 }
512}
virtual bool isDistributedMesh() const
std::string getBoundaryString(const BoundaryID boundary_id) const
RayBC that enforces periodic boundaries.
processor_id_type size() const
const Elem & get(const ElemType type_in)
int8_t boundary_id_type

Referenced by RayTracingStudy::initialSetup().

◆ postExecuteStudy()

virtual void RayTracingStudy::postExecuteStudy ( )
inlineprotectedvirtualinherited

Entry point after study execution.

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

Definition at line 709 of file RayTracingStudy.h.

709{}

Referenced by RayTracingStudy::executeStudy().

◆ 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 849 of file RayTracingStudy.C.

850{
851 mooseAssert(currentlyPropagating(), "Should not call while not propagating");
853 mooseAssert(_num_cached[tid] == 0,
854 "Values should only be cached when computing Jacobian/residual");
855
856 // Fill into cached Jacobian/residuals if necessary
858 {
860
861 if (++_num_cached[tid] == 20)
862 {
863 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
865 _num_cached[tid] = 0;
866 }
867 }
869 {
871
872 if (++_num_cached[tid] == 20)
873 {
874 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
876 _num_cached[tid] = 0;
877 }
878 }
879}
virtual void cacheResidual(const THREAD_ID tid) override
virtual void cacheJacobian(const THREAD_ID tid) override

Referenced by TraceRay::trace().

◆ preExecuteStudy()

virtual void RayTracingStudy::preExecuteStudy ( )
inlineprotectedvirtualinherited

Entry point before study execution.

Reimplemented in ViewFactorRayStudy.

Definition at line 705 of file RayTracingStudy.h.

705{}

Referenced by RayTracingStudy::executeStudy().

◆ 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.

120{}

Referenced by TraceRay::trace().

◆ propagationTime()

Real RayTracingStudy::propagationTime ( ) const
inlineinherited

Duration for creation of all Rays in seconds.

Definition at line 204 of file RayTracingStudy.h.

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

Referenced by PerProcessorRayTracingResultsVectorPostprocessor::execute().

◆ rayAuxDataNames()

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

The Ray aux data names.

Definition at line 340 of file RayTracingStudy.h.

340{ return _ray_aux_data_names; }

Referenced by RayTracingMeshOutput::setupEquationSystem().

◆ rayAuxDataSize()

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

◆ 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 1376 of file RayTracingStudy.C.

1377{
1379 mooseError("The Ray bank is not available because the private parameter "
1380 "'_bank_rays_on_completion' is set to false.");
1382 mooseError("Cannot get the Ray bank during generation or propagation.");
1383
1384 return _ray_bank;
1385}

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

◆ rayDataNames()

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

◆ rayDataSize()

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

◆ rayDependentSubdomainSetup()

bool RayTracingStudy::rayDependentSubdomainSetup ( ) const
inlineinherited

Whether or not to use Ray dependent subdomain setup.

Definition at line 219 of file RayTracingStudy.h.

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

Referenced by TraceRay::trace().

◆ rayMaxDistance()

Real RayTracingStudy::rayMaxDistance ( ) const
inlineinherited

Max distance any Ray can travel.

Definition at line 184 of file RayTracingStudy.h.

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

Referenced by TraceRay::trace().

◆ 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 1462 of file RayTracingStudy.C.

1463{
1464 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1465
1467 mooseError("Should not use registeredRayID() with Ray registration disabled");
1468
1469 const auto search = _registered_ray_map.find(name);
1470 if (search != _registered_ray_map.end())
1471 return search->second;
1472
1473 if (graceful)
1474 return Ray::INVALID_RAY_ID;
1475
1476 mooseError("Attempted to obtain ID of registered Ray ",
1477 name,
1478 ", but a Ray with said name is not registered.");
1479}
std::unordered_map< std::string, RayID > & _registered_ray_map
Map from registered Ray name to ID.
static const RayID INVALID_RAY_ID
Invalid Ray ID.
Definition Ray.h:214

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

◆ 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 1482 of file RayTracingStudy.C.

1483{
1484 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1485
1487 mooseError("Should not use registeredRayName() with Ray registration disabled");
1488
1489 if (_reverse_registered_ray_map.size() > ray_id)
1490 return _reverse_registered_ray_map[ray_id];
1491
1492 mooseError("Attempted to obtain name of registered Ray with ID ",
1493 ray_id,
1494 ", but a Ray with said ID is not registered.");
1495}
std::vector< std::string > & _reverse_registered_ray_map
Map from registered Ray ID to name.

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

◆ registeredRaySetup()

void RayTracingStudy::registeredRaySetup ( )
privateinherited

Sets up the maps from Ray to associated RayTracingObjects if _use_ray_registration.

If ray registration is disabled, this makes sure no RayTracingObjects provided rays.

Definition at line 678 of file RayTracingStudy.C.

679{
680 // First, clear the objects associated with each Ray on each thread
681 const auto num_rays = _registered_ray_map.size();
682 for (auto & entry : _threaded_ray_object_registration)
683 {
684 entry.clear();
685 entry.resize(num_rays);
686 }
687
688 const auto rtos = getRayTracingObjects();
689
691 {
692 // All of the registered ray names - used when a RayTracingObject did not specify
693 // any Rays so it should be associated with all Rays.
694 std::vector<std::string> all_ray_names;
695 all_ray_names.reserve(_registered_ray_map.size());
696 for (const auto & pair : _registered_ray_map)
697 all_ray_names.push_back(pair.first);
698
699 for (auto & rto : rtos)
700 {
701 // The Ray names associated with this RayTracingObject
702 const auto & ray_names = rto->parameters().get<std::vector<std::string>>("rays");
703 // The registration for RayTracingObjects for the thread rto is on
704 const auto tid = rto->parameters().get<THREAD_ID>("_tid");
705 auto & registration = _threaded_ray_object_registration[tid];
706
707 // Register each Ray for this object in the registration
708 for (const auto & ray_name : (ray_names.empty() ? all_ray_names : ray_names))
709 {
710 const auto id = registeredRayID(ray_name, /* graceful = */ true);
711 if (ray_names.size() && id == Ray::INVALID_RAY_ID)
712 rto->paramError(
713 "rays", "Supplied ray '", ray_name, "' is not a registered Ray in ", typeAndName());
714 registration[id].insert(rto);
715 }
716 }
717 }
718 // Not using Ray registration
719 else
720 {
721 for (const auto & rto : rtos)
722 if (rto->parameters().get<std::vector<std::string>>("rays").size())
723 rto->paramError(
724 "rays",
725 "Rays cannot be supplied when the study does not require Ray registration.\n\n",
726 type(),
727 " does not require Ray registration.");
728 }
729}
std::string typeAndName() const
void paramError(const std::string &param, Args... args) const
RayID registeredRayID(const std::string &name, const bool graceful=false) const
Gets the ID of a registered ray.

Referenced by RayTracingStudy::executeStudy().

◆ registerRay()

RayID RayTracingStudy::registerRay ( const std::string &  name)
privateinherited

Registers a Ray with a given name.

This is for internal use only and is an internal map for replicated Ray IDs -> names for easy access for studies that have a small number of rays to generate.

Parameters
nameThe name to register
Returns
The allocated ID for the registered ray

Definition at line 1438 of file RayTracingStudy.C.

1439{
1440 libmesh_parallel_only(comm());
1441
1442 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1443
1445 mooseError("Cannot use registerRay() with Ray registration disabled");
1446
1447 // This is parallel only for now. We could likely stagger the ID building like we do with
1448 // the unique IDs, but it would require a sync point which isn't there right now
1449 libmesh_parallel_only(comm());
1450
1451 const auto & it = _registered_ray_map.find(name);
1452 if (it != _registered_ray_map.end())
1453 return it->second;
1454
1455 const auto id = _reverse_registered_ray_map.size();
1456 _registered_ray_map.emplace(name, id);
1458 return id;
1459}

Referenced by RayTracingStudy::acquireRegisteredRay().

◆ 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 1209 of file RayTracingStudy.C.

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

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

◆ 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 1215 of file RayTracingStudy.C.

1216{
1217 return registerRayDataInternal(names, /* aux = */ true);
1218}

◆ 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 1178 of file RayTracingStudy.C.

1179{
1180 return registerRayDataInternal(name, /* aux = */ false);
1181}

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

◆ 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 1184 of file RayTracingStudy.C.

1185{
1186 return registerRayDataInternal(names, /* aux = */ false);
1187}

◆ registerRayDataInternal() [1/2]

RayDataIndex RayTracingStudy::registerRayDataInternal ( const std::string &  name,
const bool  aux 
)
privateinherited

Internal method for registering Ray data or Ray aux data with a name.

Definition at line 1086 of file RayTracingStudy.C.

1087{
1088 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1089
1091 mooseError("Cannot register Ray ", (aux ? "aux " : ""), "data after initialSetup()");
1092
1093 auto & map = aux ? _ray_aux_data_map : _ray_data_map;
1094 const auto find = map.find(name);
1095 if (find != map.end())
1096 return find->second;
1097
1098 auto & other_map = aux ? _ray_data_map : _ray_aux_data_map;
1099 if (other_map.find(name) != other_map.end())
1100 mooseError("Cannot register Ray aux data with name ",
1101 name,
1102 " because Ray ",
1103 (aux ? "(non-aux)" : "aux"),
1104 " data already exists with said name.");
1105
1106 // Add into the name -> index map
1107 map.emplace(name, map.size());
1108
1109 // Add into the index -> names vector
1110 auto & vector = aux ? _ray_aux_data_names : _ray_data_names;
1111 vector.push_back(name);
1112
1113 return map.size() - 1;
1114}

Referenced by RayTracingStudy::registerRayAuxData(), RayTracingStudy::registerRayAuxData(), RayTracingStudy::registerRayData(), RayTracingStudy::registerRayData(), and RayTracingStudy::registerRayDataInternal().

◆ registerRayDataInternal() [2/2]

std::vector< RayDataIndex > RayTracingStudy::registerRayDataInternal ( const std::vector< std::string > &  names,
const bool  aux 
)
privateinherited

Internal method for registering Ray data or Ray aux data with names.

Definition at line 1117 of file RayTracingStudy.C.

1118{
1119 std::vector<RayDataIndex> indices(names.size());
1120 for (std::size_t i = 0; i < names.size(); ++i)
1121 indices[i] = registerRayDataInternal(names[i], aux);
1122 return indices;
1123}

◆ 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 785 of file RayTracingStudy.C.

787{
788 mooseAssert(MooseUtils::absoluteFuzzyEqual((start - end).norm(), length), "Invalid length");
789 mooseAssert(currentlyPropagating(), "Should not call while not propagating");
790
792
793 // If we have any variables or material properties that are active, we definitely need to reinit
796 // If not, make sure that the RayKernels have not requested a reinit (this could happen when a
797 // RayKernel doesn't have variables or materials but still does an integration and needs qps)
798 if (!reinit)
799 for (const RayKernelBase * rk : currentRayKernels(tid))
800 if (rk->needSegmentReinit())
801 {
802 reinit = true;
803 break;
804 }
805
806 if (reinit)
807 {
808 _fe_problem.prepare(elem, tid);
809
810 std::vector<Point> points;
811 std::vector<Real> weights;
812 buildSegmentQuadrature(start, end, length, points, weights);
813 _fe_problem.reinitElemPhys(elem, points, tid);
815
816 _fe_problem.reinitMaterials(elem->subdomain_id(), tid);
817 }
818}
void modifyArbitraryWeights(const std::vector< Real > &weights)
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid) override
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override
bool hasActiveMaterialProperties(const THREAD_ID tid) const
Base object for the RayKernel syntax.
const std::vector< RayKernelBase * > & currentRayKernels(THREAD_ID tid) const
Gets the current RayKernels for a thread, which are set in segmentSubdomainSetup()
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
auto norm(const T &a)

Referenced by TraceRay::onSegment().

◆ 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 1652 of file RayTracingStudy.C.

1653{
1654 if (!currentlyGenerating())
1655 mooseError("Can only reserve in Ray buffer during generateRays()");
1656
1657 _parallel_ray_study->reserveBuffer(size);
1658}

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

◆ resetReplicatedRayIDs()

void RayTracingStudy::resetReplicatedRayIDs ( )
protectedinherited

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

Definition at line 1748 of file RayTracingStudy.C.

1749{
1750 libmesh_parallel_only(comm());
1751
1752 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1753
1754 mooseAssert(!currentlyGenerating() && !currentlyPropagating(),
1755 "Cannot be reset during generation or propagation");
1756
1758}

Referenced by RayTracingStudy::RayTracingStudy().

◆ resetUniqueRayIDs()

void RayTracingStudy::resetUniqueRayIDs ( )
protectedinherited

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

Definition at line 1722 of file RayTracingStudy.C.

1723{
1724 libmesh_parallel_only(comm());
1725
1726 Threads::spin_mutex::scoped_lock lock(_spin_mutex);
1727
1728 mooseAssert(!currentlyGenerating() && !currentlyPropagating(),
1729 "Cannot be reset during generation or propagation");
1730
1731 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
1733}
const processor_id_type _pid
The rank of this processor (this actually takes time to lookup - so just do it once)

Referenced by RayTracingStudy::RayTracingStudy().

◆ residualSetup()

void RayTracingStudy::residualSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 279 of file RayTracingStudy.C.

280{
281 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
282 mooseAssert(_num_cached[tid] == 0, "Cached residuals/Jacobians not empty");
283
284 for (auto & rto : getRayTracingObjects())
285 rto->residualSetup();
286}
virtual void residualSetup() override

◆ 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 1684 of file RayTracingStudy.C.

1685{
1686 unsigned int min_level = std::numeric_limits<unsigned int>::max();
1687 unsigned int max_level = std::numeric_limits<unsigned int>::min();
1688
1689 for (const auto & elem : *_mesh.getActiveLocalElementRange())
1690 {
1691 const auto level = elem->level();
1692 min_level = std::min(level, min_level);
1693 max_level = std::max(level, max_level);
1694 }
1695
1696 _communicator.min(min_level);
1697 _communicator.max(max_level);
1698
1699 return min_level == max_level;
1700}
void min(const T &r, T &o, Request &req) const

Referenced by RayTracingStudy::meshChanged().

◆ 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.

const bool _segments_on_cache_traces
Whether or not to cache individual element segments when caching.

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

◆ 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 750 of file RayTracingStudy.C.

753{
754 mooseAssert(currentlyPropagating(), "Should not call while not propagating");
755
756 // Call subdomain setup on FE
757 _fe_problem.subdomainSetup(subdomain, tid);
758
759 std::set<MooseVariableFEBase *> needed_moose_vars;
760 std::unordered_set<unsigned int> needed_mat_props;
761
762 // Get RayKernels and their dependencies and call subdomain setup
763 getRayKernels(_threaded_current_ray_kernels[tid], subdomain, tid, ray_id);
764 for (auto & rkb : _threaded_current_ray_kernels[tid])
765 {
766 rkb->subdomainSetup();
767
768 const auto & mv_deps = rkb->getMooseVariableDependencies();
769 needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
770
771 const auto & mp_deps = rkb->getMatPropDependencies();
772 needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
773 }
774
775 // Prepare aux vars
776 for (auto & var : needed_moose_vars)
777 if (var->kind() == Moose::VarKindType::VAR_AUXILIARY)
778 var->prepareAux();
779
780 _fe_problem.setActiveElementalMooseVariables(needed_moose_vars, tid);
781 _fe_problem.prepareMaterials(needed_mat_props, subdomain, tid);
782}
void prepareMaterials(const std::unordered_set< unsigned int > &consumer_needed_mat_props, const SubdomainID blk_id, const THREAD_ID tid)
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase * > &moose_vars, const THREAD_ID tid) override
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)

Referenced by TraceRay::onSubdomainChanged().

◆ 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.

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

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

◆ 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 1767 of file RayTracingStudy.C.

1771{
1772 const auto & normal = getSideNormal(elem, side, tid);
1773 const auto dot = normal * direction;
1774 return dot < TraceRayTools::TRACE_TOLERANCE;
1775}
virtual const Point & getSideNormal(const Elem *elem, const unsigned short side, const THREAD_ID tid)
Get the outward normal for a given element side.
const Real TRACE_TOLERANCE
The standard tolerance to use in tracing.

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

◆ sideIsNonPlanar()

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

Whether or not the side \s 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.

466 {
468 }

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

◆ 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 1703 of file RayTracingStudy.C.

1704{
1705 const auto find = _subdomain_hmax.find(subdomain_id);
1706 if (find == _subdomain_hmax.end())
1707 mooseError("Subdomain ", subdomain_id, " not found in subdomain hmax map");
1708 return find->second;
1709}
std::unordered_map< SubdomainID, Real > _subdomain_hmax
The cached hmax for all elements in a subdomain.

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

◆ subdomainHMaxSetup()

void RayTracingStudy::subdomainHMaxSetup ( )
privateinherited

Caches the hmax for all elements in each subdomain.

Definition at line 624 of file RayTracingStudy.C.

625{
626 // Setup map with subdomain keys
627 _subdomain_hmax.clear();
628 for (const auto subdomain_id : _mesh.meshSubdomains())
629 _subdomain_hmax[subdomain_id] = std::numeric_limits<Real>::min();
630
631 // Set local max for each subdomain
632 for (const auto & elem : *_mesh.getActiveLocalElementRange())
633 {
634 auto & entry = _subdomain_hmax.at(elem->subdomain_id());
635 entry = std::max(entry, elem->hmax());
636 }
637
638 // Accumulate global max for each subdomain
640
641 if (getParam<bool>("warn_subdomain_hmax"))
642 {
643 const auto warn_prefix = type() + " '" + name() + "': ";
644 const auto warn_suffix =
645 "\n\nRay tracing uses an approximate element size for each subdomain to scale the\n"
646 "tolerances used in computing ray intersections. This warning suggests that the\n"
647 "approximate element size is not a good approximation. This is likely due to poor\n"
648 "element aspect ratios.\n\n"
649 "This warning is only output for the first element affected.\n"
650 "To disable this warning, set warn_subdomain_hmax = false.\n";
651
652 for (const auto & elem : *_mesh.getActiveLocalElementRange())
653 {
654 const auto hmin = elem->hmin();
655 const auto hmax = elem->hmax();
656 const auto max_hmax = subdomainHmax(elem->subdomain_id());
657
658 const auto hmax_rel = hmax / max_hmax;
659 if (hmax_rel < 1.e-2 || hmax_rel > 1.e2)
660 mooseDoOnce(mooseWarning(warn_prefix,
661 "Element hmax varies significantly from subdomain hmax.\n",
662 warn_suffix,
663 "First element affected:\n",
664 Moose::stringify(*elem)););
665
666 const auto h_rel = max_hmax / hmin;
667 if (h_rel > 1.e2)
668 mooseDoOnce(mooseWarning(warn_prefix,
669 "Element hmin varies significantly from subdomain hmax.\n",
670 warn_suffix,
671 "First element affected:\n",
672 Moose::stringify(*elem)););
673 }
674 }
675}
Real subdomainHmax(const SubdomainID subdomain_id) const
Get the cached hmax for all elements in a subdomain.
auto min(const L &left, const R &right)
std::string stringify(const T &t)

Referenced by RayTracingStudy::initialSetup(), and RayTracingStudy::meshChanged().

◆ timestepSetup()

void RayTracingStudy::timestepSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 299 of file RayTracingStudy.C.

300{
301 for (auto & rto : getRayTracingObjects())
302 rto->timestepSetup();
303}
virtual void timestepSetup() override

◆ tolerateFailure()

bool RayTracingStudy::tolerateFailure ( ) const
inlineinherited

Whether or not to tolerate failure.

Definition at line 209 of file RayTracingStudy.h.

209{ return _tolerate_failure; }

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

◆ totalDistance()

Real RayTracingStudy::totalDistance ( ) const
inlineinherited

Total distance traveled by all Rays.

Definition at line 172 of file RayTracingStudy.h.

172{ return _total_distance; }

Referenced by RayTracingStudyResult::getValue().

◆ 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; }

◆ 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().

◆ totalVolume()

Real RayTracingStudy::totalVolume ( ) const
inlineinherited

Get the current total volume of the domain.

Definition at line 437 of file RayTracingStudy.h.

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

Referenced by RayTracingStudy::isRectangularDomain().

◆ traceableMeshChecks()

void RayTracingStudy::traceableMeshChecks ( )
privateinherited

Check for if all of the element types in the mesh are supported by ray tracing.

Definition at line 389 of file RayTracingStudy.C.

390{
391 for (const auto & elem : *_mesh.getActiveLocalElementRange())
392 {
394 {
396 mooseError("Element type ",
397 Utility::enum_to_string(elem->type()),
398 " is not supported in ray tracing with adaptivity");
399 }
400 else if (!TraceRayTools::isTraceableElem(elem))
401 mooseError("Element type ",
402 Utility::enum_to_string(elem->type()),
403 " is not supported in ray tracing");
404 }
405}
bool isOn()
Adaptivity & adaptivity()
bool isAdaptivityTraceableElem(const Elem *elem)
bool isTraceableElem(const Elem *elem)

Referenced by RayTracingStudy::initialSetup().

◆ 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.

647{ return *_threaded_trace_ray[tid]; }

Referenced by BackfaceCullingStudyTest::BackfaceCullingStudyTest().

◆ 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]; }

◆ useRayRegistration()

bool RayTracingStudy::useRayRegistration ( ) const
inlineinherited

Whether or not ray registration is being used.

Definition at line 564 of file RayTracingStudy.h.

564{ return _use_ray_registration; }

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

◆ validParams()

InputParameters RepeatableRayStudyDefineNoClaimTest::validParams ( )
static

Definition at line 43 of file RepeatableRayStudyBaseTest.C.

44{
45 auto params = RepeatableRayStudy::validParams();
46 params.set<bool>("_claim_after_define_rays") = false;
47 return params;
48}
static InputParameters validParams()

◆ verifyDependenciesExist()

void RayTracingStudy::verifyDependenciesExist ( const std::vector< RayTracingObject * > &  rtos)
privateinherited

Verifies that the dependencies exist for a set of RayTracingObjects.

Definition at line 370 of file RayTracingStudy.C.

371{
372 for (const auto & rto : rtos)
373 for (const auto & dep_name : rto->getRequestedItems())
374 {
375 bool found = false;
376 for (const auto & rto_search : rtos)
377 if (rto_search->name() == dep_name)
378 {
379 found = true;
380 break;
381 }
382
383 if (!found)
384 rto->paramError("depends_on", "The ", rto->getBase(), " '", dep_name, "' does not exist");
385 }
386}
const std::set< std::string > & getRequestedItems() override

Referenced by RayTracingStudy::dependencyChecks().

◆ 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.

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

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

◆ verifyReplicatedRays()

void RepeatableRayStudyBase::verifyReplicatedRays ( )
privateinherited

Verifies that the Rays in _rays are replicated across processors.

In optimized mode, this compares the sizes across all processors. In non-optimized modes, this communicates the Rays from all processors to the root and compares the Rays.

Definition at line 199 of file RepeatableRayStudyBase.C.

200{
201 TIME_SECTION("verifyReplicatedRays", 2, "Verifying Replicated Rays");
202
203 const std::string error_suffix =
204 "\n\nThe Rays added in defineRays() must be replicated across all processors\nwith the "
205 "private param '_define_rays_replicated' == true.";
206
207 // First, verify that our _rays have unique IDs beacuse we will do mapping based on Ray ID
209 _rays.end(),
210 /* global = */ false,
211 "in _rays after calling defineRays()." + error_suffix);
212
213 // Tag for sending rays from rank 0 -> all other ranks
214 const auto tag = comm().get_unique_tag();
215
216 // Send a copy of the rays on rank 0 to all other processors for verification
217 if (_pid == 0)
218 {
219 std::vector<Parallel::Request> requests(n_processors() - 1);
220 auto request_it = requests.begin();
221
222 for (processor_id_type pid = 0; pid < n_processors(); ++pid)
223 if (pid != 0)
225 pid, parallelStudy(), _rays.begin(), _rays.end(), *request_it++, tag);
226
227 Parallel::wait(requests);
228 }
229 // All other processors will receive and verify that their rays match the rays on rank 0
230 else
231 {
232 // Map of RayID -> Ray for comparison from the Rays on rank 0 to the local rays
233 std::unordered_map<RayID, const Ray *> ray_map;
234 ray_map.reserve(_rays.size());
235 for (const auto & ray : _rays)
236 ray_map.emplace(ray->id(), ray.get());
237
238 // Receive the duplicated rays from rank 0
239 std::vector<std::shared_ptr<Ray>> rank_0_rays;
240 rank_0_rays.reserve(_rays.size());
242 0, parallelStudy(), std::back_inserter(rank_0_rays), (std::shared_ptr<Ray> *)nullptr, tag);
243
244 // The sizes better match
245 if (rank_0_rays.size() != _rays.size())
246 mooseError("The size of _rays on rank ",
247 _pid,
248 " does not match the size of rays on rank 0.",
249 error_suffix);
250
251 // Make sure we have a matching local ray for each ray from rank 0
252 for (const auto & ray : rank_0_rays)
253 {
254 const auto find = ray_map.find(ray->id());
255 if (find == ray_map.end())
256 mooseError("A Ray was found on rank ",
257 _pid,
258 " with an ID that does not exist on rank 0.",
259 error_suffix,
260 "\n\n",
261 ray->getInfo());
262
263 const Ray * root_ray = find->second;
264 if (*root_ray != *ray)
265 {
266 mooseError("A Ray was found on rank ",
267 _pid,
268 " that does not exist on rank 0.",
269 error_suffix,
270 "\n\nLocal ray:\n\n",
271 ray->getInfo(),
272 "\n\nRank 0 ray:\n\n",
273 root_ray->getInfo());
274 }
275 }
276 }
277}
ParallelStudy< std::shared_ptr< Ray >, Ray > * parallelStudy()
The underlying parallel study: used for the context for calling the packed range routines.
Basic datastructure for a ray that will traverse the mesh.
Definition Ray.h:58
std::string getInfo() const
Helper function for getting information about the Ray.
Definition Ray.C:481
MessageTag get_unique_tag(int tagvalue=MessageTag::invalid_tag) const
void receive_packed_range(const unsigned int dest_processor_id, Context *context, OutputIter out, const T *output_type, const MessageTag &tag=any_tag) const
void send_packed_range(const unsigned int dest_processor_id, const Context *context, Iter range_begin, const Iter range_end, const MessageTag &tag=no_tag, std::size_t approx_buffer_size=1000000) const

Referenced by RepeatableRayStudyBase::defineRaysInternal().

◆ 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.

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

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

◆ 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 1530 of file RayTracingStudy.C.

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

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

◆ 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 1602 of file RayTracingStudy.C.

1605{
1606 std::set<const Ray *> rays;
1607 for (const std::shared_ptr<Ray> & ray : as_range(begin, end))
1608 if (!rays.insert(ray.get()).second) // false if not inserted into rays
1609 mooseError("Multiple shared_ptrs were found that point to the same Ray ",
1610 error_suffix,
1611 "\n\nOffending Ray:\n",
1612 ray->getInfo());
1613}

Referenced by RayTracingStudy::executeStudy().

◆ 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; }

◆ zeroAuxVariables()

void RayTracingStudy::zeroAuxVariables ( )
privateinherited

Zero the AuxVariables that the registered AuxRayKernels contribute to.

Definition at line 732 of file RayTracingStudy.C.

733{
734 std::set<std::string> vars_to_be_zeroed;
735 std::vector<RayKernelBase *> ray_kernels;
736 getRayKernels(ray_kernels, 0);
737 for (auto & rk : ray_kernels)
738 {
739 AuxRayKernel * aux_rk = dynamic_cast<AuxRayKernel *>(rk);
740 if (aux_rk)
741 vars_to_be_zeroed.insert(aux_rk->variable().name());
742 }
743
744 std::vector<std::string> vars_to_be_zeroed_vec(vars_to_be_zeroed.begin(),
745 vars_to_be_zeroed.end());
746 _fe_problem.getAuxiliarySystem().zeroVariables(vars_to_be_zeroed_vec);
747}
MooseVariableFE< Real > & variable()
Gets the variable this AuxRayKernel contributes to.
virtual void zeroVariables(std::vector< std::string > &vars_to_be_zeroed)

Referenced by RayTracingStudy::executeStudy().

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().

◆ _b_box

libMesh::BoundingBox RayTracingStudy::_b_box
privateinherited

Nodal bounding box for the domain.

Definition at line 1067 of file RayTracingStudy.h.

Referenced by RayTracingStudy::boundingBox(), RayTracingStudy::isRectangularDomain(), and RayTracingStudy::RayTracingStudy().

◆ _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().

◆ _cached_traces

std::vector<TraceData> RayTracingStudy::_cached_traces
privateinherited

Storage for the cached traces.

Definition at line 1047 of file RayTracingStudy.h.

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

◆ _called_initial_setup

bool RayTracingStudy::_called_initial_setup
privateinherited

Whether or not we've called initial setup - used to stop from late registration.

Definition at line 1139 of file RayTracingStudy.h.

Referenced by RayTracingStudy::executeStudy(), RayTracingStudy::getRayBCs(), RayTracingStudy::getRayKernels(), RayTracingStudy::initialSetup(), and RayTracingStudy::registerRayDataInternal().

◆ _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().

◆ _claim_rays

ClaimRays RepeatableRayStudyBase::_claim_rays
privateinherited

The object used to claim Rays.

Definition at line 73 of file RepeatableRayStudyBase.h.

Referenced by RepeatableRayStudyBase::claimRaysInternal().

◆ _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().

◆ _domain_max_length

Real RayTracingStudy::_domain_max_length
privateinherited

An inflated max distance for the domain.

Definition at line 1071 of file RayTracingStudy.h.

Referenced by RayTracingStudy::domainMaxLength().

◆ _elem_index_helper

ElemIndexHelper RayTracingStudy::_elem_index_helper
privateinherited

◆ _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().

◆ _ending_distance

Real RayTracingStudy::_ending_distance
privateinherited

Total distance traveled by Rays that end on this processor.

Definition at line 1128 of file RayTracingStudy.h.

Referenced by RayTracingStudy::endingDistance(), RayTracingStudy::executeStudy(), and RayTracingStudy::onCompleteRay().

◆ _ending_intersections

unsigned long long int RayTracingStudy::_ending_intersections
privateinherited

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

Definition at line 1115 of file RayTracingStudy.h.

Referenced by RayTracingStudy::endingIntersections(), RayTracingStudy::executeStudy(), and RayTracingStudy::onCompleteRay().

◆ _ending_max_intersections

unsigned int RayTracingStudy::_ending_max_intersections
privateinherited

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

Definition at line 1117 of file RayTracingStudy.h.

Referenced by RayTracingStudy::endingMaxIntersections(), RayTracingStudy::executeStudy(), and RayTracingStudy::onCompleteRay().

◆ _ending_max_processor_crossings

unsigned int RayTracingStudy::_ending_max_processor_crossings
privateinherited

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

Definition at line 1108 of file RayTracingStudy.h.

Referenced by RayTracingStudy::endingMaxProcessorCrossings(), RayTracingStudy::executeStudy(), and RayTracingStudy::onCompleteRay().

◆ _ending_max_trajectory_changes

unsigned int RayTracingStudy::_ending_max_trajectory_changes
privateinherited

Max number of trajectory changes for Rays that finished on this processor.

Definition at line 1119 of file RayTracingStudy.h.

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

◆ _ending_processor_crossings

unsigned long long int RayTracingStudy::_ending_processor_crossings
privateinherited

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

Definition at line 1106 of file RayTracingStudy.h.

Referenced by RayTracingStudy::endingProcessorCrossings(), RayTracingStudy::executeStudy(), and RayTracingStudy::onCompleteRay().

◆ _execution_start_time

std::chrono::steady_clock::time_point RayTracingStudy::_execution_start_time
privateinherited

Timing.

Definition at line 1025 of file RayTracingStudy.h.

Referenced by RayTracingStudy::executeStudy().

◆ _execution_time

std::chrono::steady_clock::duration RayTracingStudy::_execution_time
privateinherited

◆ _generation_time

std::chrono::steady_clock::duration RayTracingStudy::_generation_time
privateinherited

◆ _has_non_planar_sides

bool RayTracingStudy::_has_non_planar_sides
privateinherited

Whether or not the local mesh has elements with non-planar sides.

Definition at line 1059 of file RayTracingStudy.h.

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

◆ _has_same_level_active_elems

bool RayTracingStudy::_has_same_level_active_elems
privateinherited

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

Definition at line 1064 of file RayTracingStudy.h.

Referenced by RayTracingStudy::hasSameLevelActiveElems(), and RayTracingStudy::meshChanged().

◆ _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().

◆ _internal_sidesets

std::set<BoundaryID> RayTracingStudy::_internal_sidesets
privateinherited

The BoundaryIDs on the local mesh that have internal RayBCs.

Definition at line 1055 of file RayTracingStudy.h.

Referenced by RayTracingStudy::getInternalSidesets(), RayTracingStudy::hasInternalSidesets(), and RayTracingStudy::internalSidesetSetup().

◆ _internal_sidesets_map

std::vector<std::vector<std::vector<BoundaryID> > > RayTracingStudy::_internal_sidesets_map
privateinherited

Internal sideset data, if internal sidesets exist (indexed with getLocalElemIndex())

Definition at line 1057 of file RayTracingStudy.h.

Referenced by RayTracingStudy::getInternalSidesets(), and RayTracingStudy::internalSidesetSetup().

◆ _local_rays

std::vector<std::shared_ptr<Ray> >& RepeatableRayStudyBase::_local_rays
privateinherited

Storage for all of the Rays this processor is responsible for (restartable)

Definition at line 70 of file RepeatableRayStudyBase.h.

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

◆ _local_trace_ray_results

std::vector<unsigned long long int> RayTracingStudy::_local_trace_ray_results
privateinherited

Cumulative results on this processor from the threaded TraceRay objects.

Definition at line 1133 of file RayTracingStudy.h.

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

◆ _loose_b_box

libMesh::BoundingBox RayTracingStudy::_loose_b_box
privateinherited

Loose nodal bounding box for the domain.

Definition at line 1069 of file RayTracingStudy.h.

Referenced by RayTracingStudy::looseBoundingBox(), and RayTracingStudy::RayTracingStudy().

◆ _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().

◆ _max_intersections

unsigned int RayTracingStudy::_max_intersections
privateinherited

Max number of intersections for a single Ray.

Definition at line 1123 of file RayTracingStudy.h.

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

◆ _max_processor_crossings

unsigned int RayTracingStudy::_max_processor_crossings
privateinherited

Max number of processor crossings for all Rays.

Definition at line 1112 of file RayTracingStudy.h.

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

◆ _max_trajectory_changes

unsigned int RayTracingStudy::_max_trajectory_changes
privateinherited

Max number of trajectory changes for a single Ray.

Definition at line 1125 of file RayTracingStudy.h.

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

◆ _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().

◆ _non_planar_sides

std::vector<std::vector<unsigned short> > RayTracingStudy::_non_planar_sides
privateinherited

Non planar side data, which is for quick checking if an elem side is non-planar We use unsigned short here to avoid a std::vector<bool>; 0 = false, otherwise true.

Definition at line 1062 of file RayTracingStudy.h.

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

◆ _num_cached

std::vector<std::size_t> RayTracingStudy::_num_cached
privateinherited

Number of currently cached objects for Jacobian/residual for each thread.

Definition at line 1052 of file RayTracingStudy.h.

Referenced by RayTracingStudy::executeStudy(), RayTracingStudy::jacobianSetup(), RayTracingStudy::postOnSegment(), and RayTracingStudy::residualSetup().

◆ _parallel_ray_study

const std::unique_ptr<ParallelRayStudy> RayTracingStudy::_parallel_ray_study
privateinherited

◆ _pid

const processor_id_type RayTracingStudy::_pid
protectedinherited

◆ _propagation_time

std::chrono::steady_clock::duration RayTracingStudy::_propagation_time
privateinherited

◆ _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_aux_data_map

std::unordered_map<std::string, RayDataIndex> RayTracingStudy::_ray_aux_data_map
privateinherited

The map from Ray aux data names to index.

Definition at line 1034 of file RayTracingStudy.h.

Referenced by RayTracingStudy::getRayDataIndexInternal(), and RayTracingStudy::registerRayDataInternal().

◆ _ray_aux_data_names

std::vector<std::string> RayTracingStudy::_ray_aux_data_names
privateinherited

◆ _ray_bank

std::vector<std::shared_ptr<Ray> > RayTracingStudy::_ray_bank
privateinherited

Cumulative Ray bank - stored only when _bank_rays_on_completion.

Definition at line 1093 of file RayTracingStudy.h.

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

◆ _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_data_map

std::unordered_map<std::string, RayDataIndex> RayTracingStudy::_ray_data_map
privateinherited

The map from Ray data names to index.

Definition at line 1032 of file RayTracingStudy.h.

Referenced by RayTracingStudy::getRayDataIndexInternal(), and RayTracingStudy::registerRayDataInternal().

◆ _ray_data_names

std::vector<std::string> RayTracingStudy::_ray_data_names
privateinherited

◆ _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

◆ _registered_ray_map

std::unordered_map<std::string, RayID>& RayTracingStudy::_registered_ray_map
privateinherited

Map from registered Ray name to ID.

Definition at line 1042 of file RayTracingStudy.h.

Referenced by RayTracingStudy::registeredRayID(), RayTracingStudy::registeredRaySetup(), and RayTracingStudy::registerRay().

◆ _replicated_next_ray_id

RayID RayTracingStudy::_replicated_next_ray_id
privateinherited

Storage for the next available replicated RayID, obtained via generateReplicatedRayID()

Definition at line 1097 of file RayTracingStudy.h.

Referenced by RayTracingStudy::generateReplicatedRayID(), and RayTracingStudy::resetReplicatedRayIDs().

◆ _reverse_registered_ray_map

std::vector<std::string>& RayTracingStudy::_reverse_registered_ray_map
privateinherited

Map from registered Ray ID to name.

Definition at line 1044 of file RayTracingStudy.h.

Referenced by RayTracingStudy::registeredRayName(), and RayTracingStudy::registerRay().

◆ _segment_qrule

std::unique_ptr<libMesh::QBase> RayTracingStudy::_segment_qrule
privateinherited

Quadrature rule for laying points across a 1D ray segment.

Definition at line 1103 of file RayTracingStudy.h.

Referenced by RayTracingStudy::buildSegmentQuadrature(), and RayTracingStudy::initialSetup().

◆ _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_claim_rays

bool& RepeatableRayStudyBase::_should_claim_rays
privateinherited

Whether or not we should call claimRays() on the next generateRays() (restartable)

Definition at line 76 of file RepeatableRayStudyBase.h.

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

◆ _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().

◆ _spin_mutex

Threads::spin_mutex RayTracingStudy::_spin_mutex
mutableprivateinherited

◆ _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().

◆ _subdomain_hmax

std::unordered_map<SubdomainID, Real> RayTracingStudy::_subdomain_hmax
privateinherited

The cached hmax for all elements in a subdomain.

Definition at line 1136 of file RayTracingStudy.h.

Referenced by RayTracingStudy::subdomainHmax(), and RayTracingStudy::subdomainHMaxSetup().

◆ _threaded_cache_ray_bc

std::vector<TheWarehouse::QueryCache<AttribBoundaries> > RayTracingStudy::_threaded_cache_ray_bc
privateinherited

Threaded cached boundary query for RayBC objects pertaining to this study.

Definition at line 1078 of file RayTracingStudy.h.

Referenced by RayTracingStudy::getRayBCs().

◆ _threaded_cache_ray_kernel

std::vector<TheWarehouse::QueryCache<AttribSubdomains> > RayTracingStudy::_threaded_cache_ray_kernel
privateinherited

Threaded cached subdomain query for RayKernelBase objects pertaining to this study.

Definition at line 1076 of file RayTracingStudy.h.

Referenced by RayTracingStudy::getRayKernels().

◆ _threaded_cached_normals

std::vector<std::unordered_map<std::pair<const Elem *, unsigned short>, Point> > RayTracingStudy::_threaded_cached_normals
privateinherited

Threaded cache for side normals that have been computed already during tracing.

Definition at line 1091 of file RayTracingStudy.h.

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

◆ _threaded_cached_traces

std::vector<std::vector<TraceData> > RayTracingStudy::_threaded_cached_traces
privateinherited

The threaded storage for cached traces.

Definition at line 1049 of file RayTracingStudy.h.

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

◆ _threaded_current_ray_kernels

std::vector<std::vector<RayKernelBase *> > RayTracingStudy::_threaded_current_ray_kernels
privateinherited

◆ _threaded_elem_side_builders

std::vector<libMesh::ElemSideBuilder> RayTracingStudy::_threaded_elem_side_builders
privateinherited

Threaded helpers for building element sides without extraneous allocation.

Definition at line 1021 of file RayTracingStudy.h.

Referenced by RayTracingStudy::elemSide().

◆ _threaded_fe_face

std::vector<std::unique_ptr<libMesh::FEBase> > RayTracingStudy::_threaded_fe_face
privateinherited

Face FE used for computing face normals for each thread.

Definition at line 1086 of file RayTracingStudy.h.

Referenced by RayTracingStudy::getSideNormal(), and RayTracingStudy::RayTracingStudy().

◆ _threaded_next_ray_id

std::vector<RayID> RayTracingStudy::_threaded_next_ray_id
privateinherited

Storage for the next available unique RayID, obtained via generateUniqueRayID()

Definition at line 1095 of file RayTracingStudy.h.

Referenced by RayTracingStudy::generateUniqueRayID(), and RayTracingStudy::resetUniqueRayIDs().

◆ _threaded_q_face

std::vector<std::unique_ptr<libMesh::QBase> > RayTracingStudy::_threaded_q_face
privateinherited

Face quadrature used for computing face normals for each thread.

Definition at line 1088 of file RayTracingStudy.h.

Referenced by RayTracingStudy::RayTracingStudy().

◆ _threaded_ray_object_registration

std::vector<std::vector<std::set<const RayTracingObject *> > > RayTracingStudy::_threaded_ray_object_registration
privateinherited

Threaded storage for all of the RayTracingObjects associated with a single Ray.

Definition at line 1080 of file RayTracingStudy.h.

Referenced by RayTracingStudy::getRayBCs(), RayTracingStudy::getRayKernels(), and RayTracingStudy::registeredRaySetup().

◆ _threaded_trace_ray

std::vector<std::shared_ptr<TraceRay> > RayTracingStudy::_threaded_trace_ray
privateinherited

The TraceRay objects for each thread (they do the physical tracing)

Definition at line 1084 of file RayTracingStudy.h.

Referenced by RayTracingStudy::executeStudy(), RayTracingStudy::meshChanged(), RayTracingStudy::RayTracingStudy(), RayTracingStudy::traceRay(), and RayTracingStudy::traceRay().

◆ _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().

◆ _total_distance

Real RayTracingStudy::_total_distance
privateinherited

Total distance traveled by all Rays.

Definition at line 1130 of file RayTracingStudy.h.

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

◆ _total_intersections

unsigned long long int RayTracingStudy::_total_intersections
privateinherited

Total number of Ray/element intersections.

Definition at line 1121 of file RayTracingStudy.h.

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

◆ _total_processor_crossings

unsigned long long int RayTracingStudy::_total_processor_crossings
privateinherited

Total number of processor crossings.

Definition at line 1110 of file RayTracingStudy.h.

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

◆ _total_volume

Real RayTracingStudy::_total_volume
privateinherited

The total volume of the domain.

Definition at line 1073 of file RayTracingStudy.h.

Referenced by RayTracingStudy::totalVolume().

◆ _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::getInternalSidesets(), and 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: