https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SingleTraceLineSourceTest.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
11#include "NonlinearSystemBase.h"
12#include "SystemBase.h"
13
15
18{
19 auto params = RepeatableRayStudy::validParams();
20 params.addParam<TagName>("residual_vector_tag",
21 "the vector tag for the residual tag you will accumulate into");
22 params.set<bool>("allow_other_flags_with_prekernels") = true;
23 return params;
24}
25
27 : RepeatableRayStudy(parameters),
28 _residual_tag_name(getParam<TagName>("residual_vector_tag")),
29 _has_traced(false)
30{
31}
32
33void
35{
37 {
38 _has_traced = false;
39 return;
40 }
41
43 {
45 "Should be computing jacobian but is not.");
46 return;
47 }
48
49 const auto contribution_tag_id = _fe_problem.getVectorTagID(_residual_tag_name);
51 auto & contribution_vec = nl.getVector(contribution_tag_id);
52 if (!_has_traced)
53 {
54 contribution_vec.zero();
56 contribution_vec.close();
57 _has_traced = true;
58 }
59
60 auto & residual_vec = nl.getVector(nl.residualVectorTag());
61 residual_vec.close();
62 residual_vec += contribution_vec;
63}
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