https://mooseframework.inl.gov
Loading...
Searching...
No Matches
IterationInfo.h
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#pragma once
11
12#include "GeneralReporter.h"
13class Transient;
14
19{
20public:
23 virtual void initialize() override {}
24 virtual void finalize() override {}
25 virtual void execute() override;
26
27protected:
29
30 // Reporter values to return (all are computed as "replicated" values)
32 unsigned int & _time_step_value;
33 unsigned int & _num_linear;
34 unsigned int & _num_nonlinear;
35 unsigned int & _num_fixed_point;
36
38 const unsigned int _nl_sys_num;
39
40 // Used to allow for optional declare
41 Real _dummy_real = 0;
42 unsigned int _dummy_unsigned_int = 0;
43
44 // Helper to perform optional declaration based on "_items"
45 template <typename T>
46 T & declareHelper(const std::string & item_name, T & _dummy, bool extra_check = true);
47};
48
49template <typename T>
50T &
51IterationInfo::declareHelper(const std::string & item_name, T & dummy, bool extra_check)
52{
53 return (extra_check && (!_items.isValid() || _items.isValueSet(item_name)))
54 ? declareValueByName<T>(item_name, REPORTER_MODE_REPLICATED)
55 : dummy;
56}
const ReporterMode REPORTER_MODE_REPLICATED
Reporter object that has a single execution of the "execute" method for each execute flag.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Report the time and iteration information for the simulation.
virtual void execute() override
Execute method.
T & declareHelper(const std::string &item_name, T &_dummy, bool extra_check=true)
static InputParameters validParams()
unsigned int & _num_nonlinear
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
unsigned int & _num_fixed_point
const unsigned int _nl_sys_num
The nonlinear system that this should report iteration info for.
virtual void finalize() override
Finalize.
unsigned int _dummy_unsigned_int
unsigned int & _num_linear
unsigned int & _time_step_value
const MultiMooseEnum & _items
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
bool isValueSet(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
virtual bool isValid() const override
IsValid.
Transient executioners usually loop through a number of timesteps... calling solve() for each timeste...
Definition Transient.h:21