https://mooseframework.inl.gov
SingleTraceLineSourceTest.C
Go to the documentation of this file.
2 #include "NonlinearSystemBase.h"
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 
24 void
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 }
virtual TagID getVectorTagID(const TagName &tag_name) const
SingleTraceLineSourceTest(const InputParameters &parameters)
const ExecFlagType & _current_execute_flag
const TagName & _residual_tag_name
the name of the tag that stores the residuals calculated by ray kernels
virtual void zero()=0
bool _has_traced
whether or not the raytracing study has moved the rays on the current time step
const ExecFlagType EXEC_TIMESTEP_BEGIN
registerMooseObject("RayTracingTestApp", SingleTraceLineSourceTest)
virtual void execute() override
Executes the study (generates and propagates Rays)
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
SystemBase & _sys
unsigned int number() const
static InputParameters validParams()
const ExecFlagType EXEC_NONLINEAR
static InputParameters validParams()
FEProblemBase & _fe_problem
const bool & currentlyComputingJacobian() const
A RayTracingStudy in which the user defines a set of Rays that can be traced repeatedly.
virtual NumericVector< Number > & getVector(const std::string &name)
virtual void execute() override
Executes the study (generates and propagates Rays)