https://mooseframework.inl.gov
ForcingFunctionAux.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 "ForcingFunctionAux.h"
11 #include "Function.h"
12 
14 
17 {
19  params.addClassDescription("Auxiliary Kernel that adds a forcing function to the value of an "
20  "AuxVariable from the previous time step.");
21  return params;
22 }
23 
25  : FunctionAux(parameters), _u_old(uOld())
26 {
27  if (isNodal())
28  paramError("variable", "The variable must be elemental");
29 }
30 
31 Real
33 {
34  return _u_old[_qp] + _dt * _func.value(_t, _q_point[_qp]);
35 }
const VariableValue & _u_old
AuxVariable value at previous time step.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Real & _dt
Time step size.
Add a forcing function to the previous time step value of an AuxVariable.
Function auxiliary value.
Definition: FunctionAux.h:19
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
static InputParameters validParams()
registerMooseObject("MooseApp", ForcingFunctionAux)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeValue() override
Compute and return the value of the aux variable.
static InputParameters validParams()
Definition: FunctionAux.C:16
unsigned int _qp
Quadrature point index.
Definition: AuxKernel.h:230
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
const Function & _func
Function being used to compute the value of this kernel.
Definition: FunctionAux.h:34
virtual Real value(Real t, const Point &p) const
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:44
const MooseArray< Point > & _q_point
Active quadrature points.
Definition: AuxKernel.h:196
ForcingFunctionAux(const InputParameters &parameters)
bool isNodal() const
Nodal or elemental kernel?
Definition: AuxKernel.h:86