www.mooseframework.org
Console.h
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 #ifndef CONSOLE_H
16 #define CONSOLE_H
17 
18 // MOOSE includes
19 #include "TableOutput.h"
20 
21 // Forward declarations
22 class Console;
23 
24 template <>
26 
30 class Console : public TableOutput
31 {
32 public:
37 
41  virtual ~Console();
42 
48  virtual void initialSetup() override;
49 
60  virtual void output(const ExecFlagType & type) override;
61 
67  virtual std::string filename() override;
68 
72  static void petscSetupOutput();
73 
77  void meshChanged() override;
78 
83  {
85  mooseError(
86  "accessing console system information flags is not allowed after console initial setup");
87  return _system_info_flags;
88  }
89 
90 protected:
94  void init();
95 
99  virtual void outputInput() override;
100 
104  virtual void outputScalarVariables() override;
105 
109  virtual void outputPostprocessors() override;
110 
114  virtual void outputVectorPostprocessors() override
115  {
116  mooseError("Can't currently output VectorPostprocessors to the screen");
117  };
118 
122  virtual void outputSystemInformation() override;
123 
129  std::string outputNorm(const Real & old_norm, const Real & norm);
130 
135 
141  void write(std::string message, bool indent = true);
142 
151  void writeStreamToFile(bool append = true);
152 
156  void writeVariableNorms();
157 
159  unsigned int _max_rows;
160 
163 
166 
169 
172 
174  bool _verbose;
175 
177  std::stringstream _file_output_stream;
178 
180  bool _perf_log;
181 
183  unsigned int _perf_log_interval;
184 
187 
190 
193 
196 
199 
201  std::vector<Real> _outlier_multiplier;
202 
204  unsigned int _precision;
205 
206 private:
217  void mooseConsole(const std::string & message);
218 
220  const std::ostringstream & _console_buffer;
221 
224 
227 
230 
233 
234  friend class OutputWarehouse;
235 
236 private:
239 };
240 
241 #endif /* CONSOLE_H */
InputParameters validParams< Console >()
Definition: Console.C:30
std::string indent(unsigned int spaces)
Create empty string for indenting.
Definition: ConsoleUtils.C:34
bool _libmesh_log
Control the display libMesh performance log.
Definition: Console.h:189
unsigned int _precision
Number of significant digits.
Definition: Console.h:204
static void petscSetupOutput()
Output string for setting up PETSC output.
Definition: Console.C:674
void writeVariableNorms()
Print the L2-norms for each variable.
Definition: Console.C:449
virtual void outputSystemInformation() override
Print system information.
Definition: Console.C:595
MooseEnum _fit_mode
The FormattedTable fit mode.
Definition: Console.h:162
bool _all_variable_norms
Flag for writing all variable norms.
Definition: Console.h:195
An output object for writing to the console (screen)
Definition: Console.h:30
bool _verbose
Flag for writing detailed time step information.
Definition: Console.h:174
bool _write_screen
Flag for controlling outputting console information to screen.
Definition: Console.h:171
const std::ostringstream & _console_buffer
Reference to cached messages from calls to _console.
Definition: Console.h:220
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
MultiMooseEnum & systemInfoFlags()
Return system information flags.
Definition: Console.h:82
bool _allow_changing_sysinfo_flag
A boolean for protecting _system_info_flags from being changed undesirably.
Definition: Console.h:238
virtual void output(const ExecFlagType &type) override
Customizes the order of output for the various components as well as adds additional output such as t...
Definition: Console.C:312
bool _outlier_variable_norms
Flag for writing outlier variable norms.
Definition: Console.h:198
bool _perf_header
State for the performance log header information.
Definition: Console.h:192
MultiMooseEnum _system_info_flags
Flags for controlling the what simulations information is shown.
Definition: Console.h:232
virtual std::string filename() override
Creates the output file name Appends the user-supplied &#39;file_base&#39; input parameter with a &#39;...
Definition: Console.C:306
virtual void outputPostprocessors() override
Prints the postprocessor table to the screen.
Definition: Console.C:562
bool _solve_log
State for solve performance log.
Definition: Console.h:186
std::stringstream _file_output_stream
Stream for storing information to be written to a file.
Definition: Console.h:177
void write(std::string message, bool indent=true)
Write message to screen and/or file.
Definition: Console.C:644
unsigned int _perf_log_interval
The interval at which the performance log is printed.
Definition: Console.h:183
virtual void initialSetup() override
Initial setup function Prints the system information, this is done here so that the system informatio...
Definition: Console.C:251
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
virtual void outputInput() override
Print the input file at the beginning of the simulation.
Definition: Console.C:549
virtual void outputScalarVariables() override
Prints the aux scalar variables table to the screen.
Definition: Console.C:577
void mooseConsole(const std::string &message)
Add a message to the output streams.
Definition: Console.C:664
unsigned int _max_rows
The max number of table rows.
Definition: Console.h:159
Class for storing and utilizing output objects.
Real _old_nonlinear_norm
Storage for the old non linear residual (needed for color output and only when used when printing to ...
Definition: Console.h:226
bool _write_file
Flag for controlling outputting console information to a file.
Definition: Console.h:168
virtual ~Console()
Destructor.
Definition: Console.C:228
bool _perf_log
State for all performance logging.
Definition: Console.h:180
void writeStreamToFile(bool append=true)
Write the file stream to the file.
Definition: Console.C:377
virtual void outputVectorPostprocessors() override
Not implemented.
Definition: Console.h:114
std::vector< Real > _outlier_multiplier
Multipliers for coloring variable residual norms (default [2, 0.8])
Definition: Console.h:201
MatType type
void meshChanged() override
Performs console related printing when the mesh is changed.
Definition: Console.C:627
Real _old_linear_norm
Storage for the old linear residual (needed for color output and only when used when printing to the ...
Definition: Console.h:223
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
void writeTimestepInformation()
Prints the time step information for the screen output.
Definition: Console.C:401
Base class for scalar variables and postprocessors output objects.
Definition: TableOutput.h:39
bool _scientific_time
Toggle for outputting time in time and dt in scientific notation.
Definition: Console.h:165
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
bool _print_mesh_changed_info
Flag for printing mesh information when the mesh changes.
Definition: Console.h:229
void init()
Adds the printing of system information to the init() method.
std::string outputNorm(const Real &old_norm, const Real &norm)
A helper function for outputting norms in color.
Definition: Console.C:531
Console(const InputParameters &parameters)
Class constructor.
Definition: Console.C:152