www.mooseframework.org
DebugResidualAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "DebugResidualAux.h"
16 #include "NonlinearSystem.h"
17 
18 template <>
21 {
23  params.addRequiredParam<NonlinearVariableName>("debug_variable",
24  "The variable that is being debugged.");
25  return params;
26 }
27 
29  : AuxKernel(parameters),
30  _debug_var(_nl_sys.getVariable(_tid, getParam<NonlinearVariableName>("debug_variable"))),
31  _residual_copy(_nl_sys.residualGhosted())
32 {
33  if (!_nodal)
34  mooseError("Cannot use DebugResidualAux on elemental variables");
35 }
36 
37 Real
39 {
40  dof_id_type dof = _current_node->dof_number(_nl_sys.number(), _debug_var.number(), 0);
41  return _residual_copy(dof);
42 }
NumericVector< Number > & _residual_copy
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
SystemBase & _nl_sys
Definition: AuxKernel.h:141
InputParameters validParams< AuxKernel >()
Definition: AuxKernel.C:30
const Node *& _current_node
Current node (valid only for nodal kernels)
Definition: AuxKernel.h:186
virtual Real computeValue() override
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:51
DebugResidualAux(const InputParameters &parameters)
bool _nodal
true if the kernel is nodal, false if it is elemental
Definition: AuxKernel.h:150
virtual unsigned int number()
Gets the number of this system.
Definition: SystemBase.C:604
unsigned int number() const
Get variable number coming from libMesh.
InputParameters validParams< DebugResidualAux >()
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
MooseVariable & _debug_var