https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AuxRayKernel.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 "AuxRayKernel.h"
11
12// MOOSE includes
13#include "AuxiliarySystem.h"
14
17{
18 auto params = RayKernelBase::validParams();
19
20 params.addRequiredParam<AuxVariableName>(
21 "variable", "The name of the aux variable that this AuxRayKernel applies to");
22
23 return params;
24}
25
26// Static mutex definition
27Threads::spin_mutex AuxRayKernel::_add_value_mutex;
28
30 : RayKernelBase(params),
31 MooseVariableInterface<Real>(this,
32 _fe_problem.getAuxiliarySystem()
33 .getVariable(_tid, params.get<AuxVariableName>("variable"))
34 .isNodal(),
35 "variable",
36 Moose::VarKindType::VAR_AUXILIARY,
37 Moose::VarFieldType::VAR_FIELD_STANDARD),
38 _aux(_fe_problem.getAuxiliarySystem()),
39 _var(*mooseVariable())
40{
41 if (_var.feType() != FEType(CONSTANT, MONOMIAL))
42 paramError("variable", "Only CONSTANT MONOMIAL variables are supported");
43
45}
46
47void
48AuxRayKernel::addValue(const Real value)
49{
50 // TODO: this is horribly inefficient. Consider caching and adding later
51 Threads::spin_mutex::scoped_lock lock(_add_value_mutex);
54}
AuxRayKernel(const InputParameters &params)
static Threads::spin_mutex _add_value_mutex
Spin mutex object for adding values.
static InputParameters validParams()
AuxiliarySystem & _aux
The aux system.
void addValue(const Real value)
Use to accumulate a value into the corresponding AuxVariable from this AuxRayKernel.
MooseVariableFE< Real > & _var
The AuxVariable this AuxRayKernel contributes to.
void paramError(const std::string &param, Args... args) const
const libMesh::FEType & feType() const
void addMooseVariableDependency(MooseVariableFieldBase *var)
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
virtual void setNodalValue(const OutputType &value, unsigned int idx=0) override
virtual const OutputTools< T >::VariableValue & value()
MooseVariableFE< T > * mooseVariable() const
Base object for the RayKernel syntax.
static InputParameters validParams()
NumericVector< Number > & solution()