13#include "libmesh/string_to_enum.h"
22 "Populate an auxiliary variable with the residual contribution of a variable's equation.");
24 "debug_variable",
"The variable whose equation residual is being output.");
30 _debug_var(_nl_sys.getVariable(_tid, getParam<NonlinearVariableName>(
"debug_variable"))),
31 _residual_copy(_nl_sys.residualGhosted())
34 for (
const auto block_id :
blockIDs())
38 const auto block_description =
45 "', whose equation we want to output the residual of, is not defined on block ",
47 ", where DebugResidualAux '",
57 if (var_order != debug_order || var_family != debug_family)
59 "A mismatch was found between family and order parameters for ",
63 if (!
_nodal && debug_order > 0)
64 mooseWarning(
"Residual output is approximate for variable order " +
registerMooseObject("MooseApp", DebugResidualAux)
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
MooseMesh & _mesh
Mesh this kernel is active on.
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
const Node *const & _current_node
Current node (valid only for nodal kernels)
const bool _nodal
Flag indicating if the AuxKernel is nodal.
MooseVariableField< Real > & _var
This is a regular kernel so we cast to a regular MooseVariable, hides base _var.
static InputParameters validParams()
bool hasBlocks(const SubdomainName &name) const
Test if the supplied block name is valid for this object.
virtual const std::set< SubdomainID > & blockIDs() const
Return the block subdomain ids for this object Note, if this is not block restricted,...
Auxiliary kernel for debugging convergence.
virtual Real computeValue() override
Compute and return the value of the aux variable.
MooseVariableFEBase & _debug_var
static InputParameters validParams()
NumericVector< Number > & _residual_copy
DebugResidualAux(const InputParameters ¶meters)
const std::string & name() const
Get the name of the class.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
const std::string & getSubdomainName(SubdomainID subdomain_id) const
Return the name of a block given an id.
unsigned int number() const
Get variable number coming from libMesh.
unsigned int number() const
Gets the number of this system.
std::string stringify(const T &t)
conversion to string