18#include "libmesh/transient_system.h"
19#include "libmesh/enum_norm_type.h"
32 params.
addParam<NonlinearSystemName>(
33 "nl_sys",
"nl0",
"The nonlinear system that we should output information for.");
40 _nl(_problem_ptr->getNonlinearSystemBase(
41 _problem_ptr->nlSysNum(getParam<NonlinearSystemName>(
"nl_sys")))),
54 std::ostringstream oss;
57 unsigned int max_name_size = 0;
58 for (
unsigned int var_num = 0; var_num <
_sys.
n_vars(); var_num++)
61 if (var_name_size > max_name_size)
62 max_name_size = var_name_size;
66 oss <<
" |residual|_2 of individual variables:\n";
67 for (
unsigned int var_num = 0; var_num <
_sys.
n_vars(); var_num++)
70 oss << std::setw(27 - max_name_size) <<
" "
71 << std::setw(max_name_size + 2)
const ExecFlagType EXEC_NONLINEAR
registerMooseObject("MooseApp", VariableResidualNormsDebugOutput)
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
A MultiMooseEnum object to hold "execute_on" flags.
NonlinearSystemBase & currentNonlinearSystem()
virtual NumericVector< Number > & RHS()=0
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Adds the ability to output on every nonlinear and/or linear residual.
static InputParameters validParams()
unsigned int number() const
Gets the number of this system.
A class for producing various debug related outputs.
VariableResidualNormsDebugOutput(const InputParameters ¶meters)
Class constructor.
static InputParameters validParams()
NonlinearSystemBase & _nl
Reference to MOOSE's nonlinear system.
virtual void output() override
Perform the debugging output.
libMesh::System & _sys
Reference to libMesh system.
const std::string & variable_name(const unsigned int i) const
Real calculate_norm(const NumericVector< Number > &v, unsigned int var, FEMNormType norm_type, std::set< unsigned int > *skip_dimensions=nullptr) const
unsigned int n_vars() const