https://mooseframework.inl.gov
IterationInfo.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 "IterationInfo.h"
11 #include "SubProblem.h"
12 #include "Transient.h"
13 
15 
18 {
20  params.addClassDescription("Report the time and iteration information for the simulation.");
21 
22  MultiMooseEnum items(
23  "time timestep num_linear_iterations num_nonlinear_iterations num_fixed_point_iterations");
24  params.addParam<MultiMooseEnum>(
25  "items",
26  items,
27  "The iteration information to output, if nothing is provided everything will be output.");
28  params.addParam<NonlinearSystemName>(
29  "nl_sys", "nl0", "The nonlinear system that this should report iteration info for.");
30  return params;
31 }
32 
34  : GeneralReporter(parameters),
35  _items(getParam<MultiMooseEnum>("items")),
36  _time_value(declareHelper<Real>("time", _dummy_real)),
37  _time_step_value(declareHelper<unsigned int>("timestep", _dummy_unsigned_int)),
38  _num_linear(declareHelper<unsigned int>("num_linear_iterations", _dummy_unsigned_int)),
39  _num_nonlinear(declareHelper<unsigned int>("num_nonlinear_iterations", _dummy_unsigned_int)),
40  _num_fixed_point(
41  declareHelper<unsigned int>("num_fixed_point_iterations", _dummy_unsigned_int)),
42  _nl_sys_num(_subproblem.nlSysNum(getParam<NonlinearSystemName>("nl_sys")))
43 {
44 }
45 
46 void
48 {
49  _time_value = _t;
54 }
unsigned int & _num_nonlinear
Definition: IterationInfo.h:34
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const
Definition: SubProblem.C:761
Reporter object that has a single execution of the "execute" method for each execute flag...
unsigned int & _num_linear
Definition: IterationInfo.h:33
static InputParameters validParams()
Definition: IterationInfo.C:17
Real & _time_value
Definition: IterationInfo.h:31
const unsigned int _nl_sys_num
The nonlinear system that this should report iteration info for.
Definition: IterationInfo.h:38
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
unsigned int & _time_step_value
Definition: IterationInfo.h:32
static InputParameters validParams()
unsigned int numFixedPointIts() const
Get the number of fixed point iterations performed Because this returns the number of fixed point ite...
virtual void execute() override
Execute method.
Definition: IterationInfo.C:47
IterationInfo(const InputParameters &parameters)
Definition: IterationInfo.C:33
int & _t_step
The number of the time step.
virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const
Definition: SubProblem.C:767
unsigned int & _num_fixed_point
Definition: IterationInfo.h:35
SubProblem & _subproblem
Reference to the Subproblem for this user object.
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:385
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.C:1815
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Report the time and iteration information for the simulation.
Definition: IterationInfo.h:18
registerMooseObject("MooseApp", IterationInfo)
FixedPointSolve & fixedPointSolve()
Definition: Executioner.h:124
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...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
void ErrorVector unsigned int