https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SingleTraceLineSourceTest.C
Go to the documentation of this file.
3#include "SystemBase.h"
4
6
9{
10 auto params = RepeatableRayStudy::validParams();
11 params.addParam<TagName>("residual_vector_tag",
12 "the vector tag for the residual tag you will accumulate into");
13 params.set<bool>("allow_other_flags_with_prekernels") = true;
14 return params;
15}
16
18 : RepeatableRayStudy(parameters),
19 _residual_tag_name(getParam<TagName>("residual_vector_tag")),
20 _has_traced(false)
21{
22}
23
24void
26{
28 {
29 _has_traced = false;
30 return;
31 }
32
34 {
36 "Should be computing jacobian but is not.");
37 return;
38 }
39
40 const auto contribution_tag_id = _fe_problem.getVectorTagID(_residual_tag_name);
42 auto & contribution_vec = nl.getVector(contribution_tag_id);
43 if (!_has_traced)
44 {
45 contribution_vec.zero();
47 contribution_vec.close();
48 _has_traced = true;
49 }
50
51 auto & residual_vec = nl.getVector(nl.residualVectorTag());
52 residual_vec.close();
53 residual_vec += contribution_vec;
54}
const ExecFlagType EXEC_TIMESTEP_BEGIN
const ExecFlagType EXEC_NONLINEAR
registerMooseObject("RayTracingTestApp", SingleTraceLineSourceTest)
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
virtual void execute() override
Executes the study (generates and propagates Rays)
A RayTracingStudy in which the user defines a set of Rays that can be traced repeatedly.
static InputParameters validParams()
const ExecFlagType & _current_execute_flag
const TagName & _residual_tag_name
the name of the tag that stores the residuals calculated by ray kernels
static InputParameters validParams()
virtual void execute() override
Executes the study (generates and propagates Rays)
bool _has_traced
whether or not the raytracing study has moved the rays on the current time step
SingleTraceLineSourceTest(const InputParameters &parameters)
const bool & currentlyComputingJacobian() const
virtual TagID getVectorTagID(const TagName &tag_name) const
unsigned int number() const
virtual NumericVector< Number > & getVector(const std::string &name)
FEProblemBase & _fe_problem
SystemBase & _sys
virtual void zero()=0