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

Base class for a MooseObject used in ray tracing. More...

#include <RayTracingObject.h>

Inheritance diagram for RayTracingObject:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 RayTracingObject (const InputParameters &params)
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
RayTracingStudystudy ()
 The RayTracingStudy associated with this object. More...
 
const RayTracingStudystudy () const
 The RayTracingStudy associated with this object. More...
 
template<typename T >
T & getStudy ()
 Casts the RayTracingStudy associated with this object to a study of type T with a meaningful error message if it fails. More...
 
virtual void preExecuteStudy ()
 Insertion point called immediately before executing the RayTracingStudy. More...
 
virtual void postExecuteStudy ()
 Insertion point called immediately after executing the RayTracingStudy. More...
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
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
 
virtual void meshChanged ()
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 

Static Public Member Functions

static InputParameters validParams ()
 
static 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)
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

const std::shared_ptr< Ray > & currentRay () const
 Gets the current Ray that this is working on. More...
 
void dependsOn (const std::string name)
 Add an object of this classes base type that this class depends on. More...
 
NonlinearSystemBasegetNonlinearSystem ()
 Get the right nonlinear system. More...
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const
 
virtual void addUserObjectDependencyHelper (const UserObject &) const
 

Protected Attributes

const THREAD_ID _tid
 The thread id. More...
 
FEProblemBase_fe_problem
 The FEProblemBase. More...
 
RayTracingStudy_study
 The RayTracingStudy associated with this object. More...
 
const TraceRay_trace_ray
 The TraceRay object associated with this thread. More...
 
NonlinearSystemBase_nl
 The nonlinear system, we might not have one. More...
 
AuxiliarySystem_aux
 The aux system. More...
 
MooseMesh_mesh
 The MooseMesh. More...
 
const Elem *const & _current_elem
 The current Elem that _current_ray is tracing through. More...
 
const SubdomainID_current_subdomain_id
 The subdomain ID of the _current_elem that the ray is tracing through. More...
 
const unsigned short & _current_intersected_side
 The side that _current_ray intersects (if any) More...
 
const ElemExtrema_current_intersected_extrema
 The elem extrema (vertex/edge) that _current_ray intersects (if any) More...
 
const bool & _enabled
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
const Parallel::Communicator & _communicator
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
FEProblemBase_mci_feproblem
 
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
 

Private Attributes

std::set< std::string > _depend_names
 The names of the objects this depends on. More...
 
std::set< std::string > _supplied_names
 The names of the supplied objects: just this one. More...
 
const std::shared_ptr< Ray > *const & _current_ray
 The current Ray that the action is being applied to. More...
 

Detailed Description

Base class for a MooseObject used in ray tracing.

Definition at line 36 of file RayTracingObject.h.

Constructor & Destructor Documentation

◆ RayTracingObject()

RayTracingObject::RayTracingObject ( const InputParameters params)

Definition at line 38 of file RayTracingObject.C.

39  : MooseObject(params),
40  SetupInterface(this),
41  FunctionInterface(this),
44  MeshChangedInterface(params),
45  TransientInterface(this),
46  UserObjectInterface(this),
48  _tid(params.get<THREAD_ID>("_tid")),
49  _fe_problem(*params.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
50  _study(*params.getCheckedPointerParam<RayTracingStudy *>("_ray_tracing_study")),
51  _trace_ray(const_cast<const RayTracingStudy &>(_study).traceRay(_tid)),
60 {
61  // Supplies only itself
62  _supplied_names.insert(name());
63 }
const unsigned short & _current_intersected_side
The side that _current_ray intersects (if any)
FunctionInterface(const MooseObject *moose_object)
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
std::set< std::string > _supplied_names
The names of the supplied objects: just this one.
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
FEProblemBase & _fe_problem
The FEProblemBase.
MooseObject(const InputParameters &parameters)
const Elem *const & currentElem() const
Gets the element that the current Ray is being traced in.
Definition: TraceRay.h:114
VectorPostprocessorInterface(const MooseObject *moose_object, bool broadcast_by_default=false)
virtual const std::string & name() const
const SubdomainID & currentSubdomainID() const
Gets the subdomain of the current element that the Ray is being traced in.
Definition: TraceRay.h:159
TransientInterface(const MooseObject *moose_object)
MooseMesh & _mesh
The MooseMesh.
const unsigned short & currentIntersectedSide() const
Gets the side that the current Ray intersected.
Definition: TraceRay.h:140
const Elem *const & _current_elem
The current Elem that _current_ray is tracing through.
MeshChangedInterface(const InputParameters &params)
const THREAD_ID _tid
The thread id.
SetupInterface(const MooseObject *moose_object)
AuxiliarySystem & getAuxiliarySystem()
NonlinearSystemBase * _nl
The nonlinear system, we might not have one.
const TraceRay & _trace_ray
The TraceRay object associated with this thread.
NonlinearSystemBase * getNonlinearSystem()
Get the right nonlinear system.
AuxiliarySystem & _aux
The aux system.
virtual MooseMesh & mesh() override
const ElemExtrema & _current_intersected_extrema
The elem extrema (vertex/edge) that _current_ray intersects (if any)
PostprocessorInterface(const MooseObject *moose_object)
const SubdomainID & _current_subdomain_id
The subdomain ID of the _current_elem that the ray is tracing through.
RayTracingStudy & _study
The RayTracingStudy associated with this object.
const std::shared_ptr< Ray > *const & currentRay() const
Gets the current Ray that is being traced.
Definition: TraceRay.h:110
const ElemExtrema & currentIntersectedExtrema() const
Gets the element extrema (vertex/edge) that the current Ray intersected.
Definition: TraceRay.h:144
const std::shared_ptr< Ray > *const & _current_ray
The current Ray that the action is being applied to.
unsigned int THREAD_ID
UserObjectInterface(const MooseObject *moose_object)
Base class for Ray tracing studies that will generate Rays and then propagate all of them to terminat...

Member Function Documentation

◆ currentRay()

const std::shared_ptr<Ray>& RayTracingObject::currentRay ( ) const
inlineprotected

◆ dependsOn()

void RayTracingObject::dependsOn ( const std::string  name)
inlineprotected

Add an object of this classes base type that this class depends on.

Definition at line 88 of file RayTracingObject.h.

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

88 { _depend_names.insert(name); }
virtual const std::string & name() const
std::set< std::string > _depend_names
The names of the objects this depends on.

◆ getNonlinearSystem()

NonlinearSystemBase * RayTracingObject::getNonlinearSystem ( )
protected

Get the right nonlinear system.

Some simulations might not have one, if some user objects only operate on aux variables we need a special treatment

Definition at line 66 of file RayTracingObject.C.

67 {
68  // If this object actually operates with a nonlinear variable that belongs to a system
69  // we use the variable's system
72 
73  // If the user operates on auxiliary variables we just use the first nonlinear
74  // system if there is any
77 
78  return nullptr;
79 }
virtual std::size_t numNonlinearSystems() const override
FEProblemBase & _fe_problem
The FEProblemBase.
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
RayTracingStudy & _study
The RayTracingStudy associated with this object.
unsigned int systemNumber() const

◆ getRequestedItems()

const std::set<std::string>& RayTracingObject::getRequestedItems ( )
inlineoverridevirtual

Implements DependencyResolverInterface.

Definition at line 51 of file RayTracingObject.h.

51 { return _depend_names; }
std::set< std::string > _depend_names
The names of the objects this depends on.

◆ getStudy()

template<typename T >
T & RayTracingObject::getStudy ( )

Casts the RayTracingStudy associated with this object to a study of type T with a meaningful error message if it fails.

Definition at line 137 of file RayTracingObject.h.

138 {
139  static_assert(std::is_base_of<RayTracingStudy, T>::value, "Not derived from a RayTracingStudy");
140 
141  if (T * cast_study = dynamic_cast<T *>(&_study))
142  return *cast_study;
143 
144  std::stringstream err;
145  err << "Supplied study of type " << _study.type() << " is not the required study type "
146  << MooseUtils::prettyCppType<T>();
147  if (isParamValid("study"))
148  paramError("study", err.str());
149  else
150  mooseError(err.str());
151 }
OStreamProxy err
bool isParamValid(const std::string &name) const
const std::string & type() const
void paramError(const std::string &param, Args... args) const
void mooseError(Args &&... args) const
RayTracingStudy & _study
The RayTracingStudy associated with this object.

◆ getSuppliedItems()

const std::set<std::string>& RayTracingObject::getSuppliedItems ( )
inlineoverridevirtual

Implements DependencyResolverInterface.

Definition at line 52 of file RayTracingObject.h.

52 { return _supplied_names; }
std::set< std::string > _supplied_names
The names of the supplied objects: just this one.

◆ postExecuteStudy()

virtual void RayTracingObject::postExecuteStudy ( )
inlinevirtual

Insertion point called immediately after executing the RayTracingStudy.

Definition at line 77 of file RayTracingObject.h.

77 {};

◆ preExecuteStudy()

virtual void RayTracingObject::preExecuteStudy ( )
inlinevirtual

Insertion point called immediately before executing the RayTracingStudy.

Reimplemented in IntegralRayKernelBase.

Definition at line 73 of file RayTracingObject.h.

73 {};

◆ study() [1/2]

RayTracingStudy& RayTracingObject::study ( )
inline

The RayTracingStudy associated with this object.

Definition at line 57 of file RayTracingObject.h.

Referenced by AttribRayTracingStudy::initFrom().

57 { return _study; }
RayTracingStudy & _study
The RayTracingStudy associated with this object.

◆ study() [2/2]

const RayTracingStudy& RayTracingObject::study ( ) const
inline

The RayTracingStudy associated with this object.

Definition at line 61 of file RayTracingObject.h.

61 { return _study; }
RayTracingStudy & _study
The RayTracingStudy associated with this object.

◆ validParams()

InputParameters RayTracingObject::validParams ( )
static

Definition at line 15 of file RayTracingObject.C.

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

16 {
17  auto params = MooseObject::validParams();
18  params += SetupInterface::validParams();
21 
22  params.addParam<UserObjectName>("study",
23  "The RayTracingStudy associated with this object. If none "
24  "provided, this will default to the one study that exists.");
25  params.addParam<std::vector<std::string>>(
26  "rays",
27  "The name of the Rays associated with this object; only used if Ray registration is enabled "
28  "within the study. If no Rays are supplied, this object will be applied to all Rays.");
29 
30  params.addPrivateParam<RayTracingStudy *>("_ray_tracing_study");
31 
32  // Execute flags don't make sense here because the RayTracingStudy calls this object
33  params.suppressParameter<ExecFlagEnum>("execute_on");
34 
35  return params;
36 }
static InputParameters validParams()
static InputParameters validParams()
static InputParameters validParams()
static InputParameters validParams()
Base class for Ray tracing studies that will generate Rays and then propagate all of them to terminat...

Member Data Documentation

◆ _aux

AuxiliarySystem& RayTracingObject::_aux
protected

The aux system.

Definition at line 111 of file RayTracingObject.h.

◆ _current_elem

const Elem* const& RayTracingObject::_current_elem
protected

◆ _current_intersected_extrema

const ElemExtrema& RayTracingObject::_current_intersected_extrema
protected

The elem extrema (vertex/edge) that _current_ray intersects (if any)

Definition at line 123 of file RayTracingObject.h.

◆ _current_intersected_side

const unsigned short& RayTracingObject::_current_intersected_side
protected

The side that _current_ray intersects (if any)

Definition at line 121 of file RayTracingObject.h.

Referenced by RayBoundaryConditionBase::acquireRay(), and ReflectRayBC::onBoundary().

◆ _current_ray

const std::shared_ptr<Ray>* const& RayTracingObject::_current_ray
private

The current Ray that the action is being applied to.

Definition at line 132 of file RayTracingObject.h.

Referenced by currentRay().

◆ _current_subdomain_id

const SubdomainID& RayTracingObject::_current_subdomain_id
protected

The subdomain ID of the _current_elem that the ray is tracing through.

Definition at line 119 of file RayTracingObject.h.

◆ _depend_names

std::set<std::string> RayTracingObject::_depend_names
private

The names of the objects this depends on.

Definition at line 127 of file RayTracingObject.h.

Referenced by dependsOn(), and getRequestedItems().

◆ _fe_problem

FEProblemBase& RayTracingObject::_fe_problem
protected

◆ _mesh

MooseMesh& RayTracingObject::_mesh
protected

◆ _nl

NonlinearSystemBase* RayTracingObject::_nl
protected

The nonlinear system, we might not have one.

Definition at line 109 of file RayTracingObject.h.

◆ _study

RayTracingStudy& RayTracingObject::_study
protected

◆ _supplied_names

std::set<std::string> RayTracingObject::_supplied_names
private

The names of the supplied objects: just this one.

Definition at line 129 of file RayTracingObject.h.

Referenced by getSuppliedItems(), and RayTracingObject().

◆ _tid

const THREAD_ID RayTracingObject::_tid
protected

◆ _trace_ray

const TraceRay& RayTracingObject::_trace_ray
protected

The TraceRay object associated with this thread.

Definition at line 106 of file RayTracingObject.h.


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