https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RayTracingObject.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "RayTracingObject.h"
11
12#include "TraceRay.h"
13
16{
17 auto params = MooseObject::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}
37
39 : MooseObject(params),
40 SetupInterface(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)),
52 _nl(getNonlinearSystem()),
53 _aux(_fe_problem.getAuxiliarySystem()),
54 _mesh(_fe_problem.mesh()),
55 _current_elem(_trace_ray.currentElem()),
56 _current_subdomain_id(_trace_ray.currentSubdomainID()),
57 _current_intersected_side(_trace_ray.currentIntersectedSide()),
58 _current_intersected_extrema(_trace_ray.currentIntersectedExtrema()),
59 _current_ray(_trace_ray.currentRay())
60{
61 // Supplies only itself
62 _supplied_names.insert(name());
63}
64
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}
unsigned int THREAD_ID
virtual std::size_t numNonlinearSystems() const override
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
static InputParameters validParams()
const std::string & name() const
static InputParameters validParams()
static InputParameters validParams()
FEProblemBase & _fe_problem
The FEProblemBase.
RayTracingStudy & _study
The RayTracingStudy associated with this object.
NonlinearSystemBase * getNonlinearSystem()
Get the right nonlinear system.
std::set< std::string > _supplied_names
The names of the supplied objects: just this one.
RayTracingObject(const InputParameters &params)
Base class for Ray tracing studies that will generate Rays and then propagate all of them to terminat...
static InputParameters validParams()
static InputParameters validParams()
unsigned int systemNumber() const
MeshBase & mesh