www.mooseframework.org
Console.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 // MOOSE includes
11 #include "Console.h"
12 #include "ConsoleUtils.h"
13 #include "FEProblem.h"
14 #include "EigenProblem.h"
15 #include "Postprocessor.h"
16 #include "PetscSupport.h"
17 #include "Executioner.h"
18 #include "MooseApp.h"
19 #include "Moose.h"
20 #include "FormattedTable.h"
21 #include "NonlinearSystem.h"
22 
23 // libMesh includes
24 #include "libmesh/enum_norm_type.h"
25 
26 registerMooseObject("MooseApp", Console);
27 
28 template <>
31 {
32  // Enum for selecting the fit mode for the table when printed to the screen
34 
35  // Get the parameters from the base class
37  params.addClassDescription("Object for screen output.");
38 
39  params += TableOutput::enableOutputTypes("system_information scalar postprocessor input");
40 
41  // Screen and file output toggles
42  params.addParam<bool>("output_screen", true, "Output to the screen");
43  params.addParam<bool>("output_file", false, "Output to the file");
44  params.addParam<bool>(
45  "show_multiapp_name", false, "Indent multiapp output using the multiapp name");
46 
47  // Table fitting options
48  params.addParam<unsigned int>("max_rows",
49  15,
50  "The maximum number of postprocessor/scalar values "
51  "displayed on screen during a timestep (set to 0 "
52  "for unlimited)");
53  params.addParam<MooseEnum>("fit_mode",
54  pps_fit_mode,
55  "Specifies the wrapping mode for post-processor tables that are "
56  "printed to the screen (ENVIRONMENT: Read \"MOOSE_PPS_WIDTH\" for "
57  "desired width, AUTO: Attempt to determine width automatically "
58  "(serial only), <n>: Desired width");
59 
60  // Verbosity
61  params.addParam<bool>("verbose", false, "Print detailed diagnostics on timestep calculation");
62 
63  // Basic table output controls
64  params.addParam<bool>(
65  "scientific_time", false, "Control the printing of time and dt in scientific notation");
66  params.addParam<unsigned int>(
67  "time_precision",
68  "The number of significant digits that are printed on time related outputs");
69 
70  // Performance Logging
71  params.addDeprecatedParam<bool>("perf_log",
72  false,
73  "If true, all performance logs will be printed. The "
74  "individual log settings will override this option.",
75  "Use PerfGraphOutput");
76  params.addDeprecatedParam<unsigned int>(
77  "perf_log_interval",
78  0,
79  "If set, the performance log will be printed every n time steps",
80  "Use PerfGraphOutput instead");
81  params.addParam<bool>("solve_log", "Toggles the printing of the 'Moose Test Performance' log");
82  params.addDeprecatedParam<bool>(
83  "perf_header",
84  "Print the libMesh performance log header (requires that 'perf_log = true')",
85  "Use PerfGraphOutput instead");
86 
87  params.addParam<bool>(
88  "libmesh_log",
89  true,
90  "Print the libMesh performance log, requires libMesh to be configured with --enable-perflog");
91 
92  // Toggle printing of mesh information on adaptivity steps
93  params.addParam<bool>("print_mesh_changed_info",
94  false,
95  "When true, each time the mesh is changed the mesh information is printed");
96 
97  // Toggle for printing variable norms
98  params.addParam<bool>("outlier_variable_norms",
99  true,
100  "If true, outlier variable norms will be printed after each solve");
101  params.addParam<bool>(
102  "all_variable_norms", false, "If true, all variable norms will be printed after each solve");
103 
104  // Multipliers for coloring of variable residual norms
105  std::vector<Real> multiplier;
106  multiplier.push_back(0.8);
107  multiplier.push_back(2);
108  params.addParam<std::vector<Real>>("outlier_multiplier",
109  multiplier,
110  "Multiplier utilized to determine if a residual norm is an "
111  "outlier. If the variable residual is less than "
112  "multiplier[0] times the total residual it is colored red. "
113  "If the variable residual is less than multiplier[1] times "
114  "the average residual it is colored yellow.");
115 
116  // System information controls
117  MultiMooseEnum info("framework mesh aux nonlinear relationship execution output",
118  "framework mesh aux nonlinear relationship execution");
119  params.addParam<MultiMooseEnum>("system_info",
120  info,
121  "List of information types to display "
122  "('framework', 'mesh', 'aux', 'nonlinear', 'relationship', "
123  "'execution', 'output')");
124 
125  // Advanced group
126  params.addParamNamesToGroup("max_rows verbose show_multiapp_name system_info", "Advanced");
127 
128  // Performance log group
129  params.addParamNamesToGroup("perf_log solve_log perf_header", "Perf Log");
130  params.addParamNamesToGroup("libmesh_log", "Performance Log");
131 
132  // Variable norms group
133  params.addParamNamesToGroup("outlier_variable_norms all_variable_norms outlier_multiplier",
134  "Norms");
135 
136  /*
137  * The following modifies the default behavior from base class parameters. Notice the extra flag
138  * on
139  * the set method. This enables "quiet mode". This is done to allow for the proper detection
140  * of user-modified parameters
141  */
142  // By default set System Information to output on initial
143  params.set<ExecFlagEnum>("execute_system_information_on", /*quite_mode=*/true) = EXEC_INITIAL;
144 
145  // Change the default behavior of 'execute_on' to included nonlinear iterations and failed
146  // timesteps
147  params.set<ExecFlagEnum>("execute_on", /*quiet_mode=*/true) = {
149 
150  // By default postprocessors and scalar are only output at the end of a timestep
151  params.set<ExecFlagEnum>("execute_postprocessors_on", /*quiet_mode=*/true) = {EXEC_INITIAL,
153  params.set<ExecFlagEnum>("execute_vector_postprocessors_on",
154  /*quiet_mode=*/true) = {EXEC_INITIAL, EXEC_TIMESTEP_END};
155  params.set<ExecFlagEnum>("execute_scalars_on", /*quiet_mode=*/true) = {EXEC_INITIAL,
157 
158  return params;
159 }
160 
162  : TableOutput(parameters),
163  _max_rows(getParam<unsigned int>("max_rows")),
164  _fit_mode(getParam<MooseEnum>("fit_mode")),
165  _scientific_time(getParam<bool>("scientific_time")),
166  _write_file(getParam<bool>("output_file")),
167  _write_screen(getParam<bool>("output_screen")),
168  _verbose(getParam<bool>("verbose")),
169  _perf_log(getParam<bool>("perf_log")),
170  _perf_log_interval(getParam<unsigned int>("perf_log_interval")),
171  _solve_log(isParamValid("solve_log") ? getParam<bool>("solve_log") : _perf_log),
172  _libmesh_log(getParam<bool>("libmesh_log")),
173  _perf_header(isParamValid("perf_header") ? getParam<bool>("perf_header") : _perf_log),
174  _all_variable_norms(getParam<bool>("all_variable_norms")),
175  _outlier_variable_norms(getParam<bool>("outlier_variable_norms")),
176  _outlier_multiplier(getParam<std::vector<Real>>("outlier_multiplier")),
177  _precision(isParamValid("time_precision") ? getParam<unsigned int>("time_precision") : 0),
178  _console_buffer(_app.getOutputWarehouse().consoleBuffer()),
179  _old_linear_norm(std::numeric_limits<Real>::max()),
180  _old_nonlinear_norm(std::numeric_limits<Real>::max()),
181  _print_mesh_changed_info(getParam<bool>("print_mesh_changed_info")),
182  _system_info_flags(getParam<MultiMooseEnum>("system_info")),
183  _allow_changing_sysinfo_flag(true)
184 {
185  // Apply the special common console flags (print_...)
187  const auto & actions = awh.getActionListByName("common_output");
188  mooseAssert(actions.size() == 1, "Should be only one common_output Action");
189  Action * common_action = *actions.begin();
190 
191  // Honor the 'print_linear_residuals' option, only if 'execute_on' has not been set by the user
192  if (!parameters.isParamSetByUser("execute_on"))
193  {
194  if (common_action->getParam<bool>("print_linear_residuals"))
195  _execute_on.push_back("linear");
196  else
197  _execute_on.erase("linear");
198  }
199 
200  if (!_pars.isParamSetByUser("perf_log") && common_action->getParam<bool>("print_perf_log"))
201  {
202  _perf_log = true;
203  _solve_log = true;
204  }
205 
206  // Append the common 'execute_on' to the setting for this object
207  // This is unique to the Console object, all other objects inherit from the common options
208  const ExecFlagEnum & common_execute_on = common_action->getParam<ExecFlagEnum>("execute_on");
209  for (auto & mme : common_execute_on)
210  _execute_on.push_back(mme);
211 
212  // If --show-outputs is used, enable it
213  if (_app.getParam<bool>("show_outputs"))
214  _system_info_flags.push_back("output");
215 }
216 
218 {
219  // Write the libMesh log
220  if (_libmesh_log)
221  write(libMesh::perflog.get_perf_info(), false);
222 
223  // Write the file output stream
225 
226  // Disable logging so that the destructor in libMesh doesn't print
227  Moose::perf_log.disable_logging();
228  libMesh::perflog.disable_logging();
229 }
230 
231 void
233 {
234  // Only allow the main app to change the perf_log settings.
235  if (_app.name() == "main")
236  {
237  // Disable libMesh log
238  if (!_libmesh_log)
239  libMesh::perflog.disable_logging();
240  }
241 
242  // system info flag can be changed only before console initial setup
244 
245  // If execute_on = 'initial' perform the output
246  if (wantOutput("system_information", EXEC_INITIAL))
248 
249  // Call the base class method
251 
252  // If file output is desired, wipe out the existing file if not recovering
253  if (!_app.isRecovering())
254  writeStreamToFile(false);
255 
256  // Enable verbose output if Executioner has it enabled
257  if (_app.getExecutioner()->isParamValid("verbose") &&
258  _app.getExecutioner()->getParam<bool>("verbose"))
259  _verbose = true;
260 
261  // Display a message to indicate the application is running (useful for MultiApps)
263  write(std::string("\nRunning App: ") + _app.name() + "\n");
264 
265  // If the user adds "final" to the execute on, append this to the postprocessors, scalars, etc.,
266  // but only
267  // if the parameter (e.g., postprocessor_execute_on) has not been modified by the user.
268  if (_execute_on.contains("final"))
269  {
270  if (!_pars.isParamSetByUser("postprocessor_execute_on"))
271  _advanced_execute_on["postprocessors"].push_back("final");
272  if (!_pars.isParamSetByUser("scalars_execute_on"))
273  _advanced_execute_on["scalars"].push_back("final");
274  if (!_pars.isParamSetByUser("vector_postprocessor_execute_on"))
275  _advanced_execute_on["vector_postprocessors"].push_back("final");
276  }
277 }
278 
279 std::string
281 {
282  return _file_base + ".txt";
283 }
284 
285 void
287 {
288  writeTimestepInformation(/*output_dt = */ true);
289 }
290 
291 void
293 {
294  // Return if the current output is not on the desired interval
295  if (type != EXEC_FINAL && !onInterval())
296  return;
297 
298  // Output the system information first; this forces this to be the first item to write by default
299  // However, 'output_system_information_on' still operates correctly, so it may be changed by the
300  // user
301  if (wantOutput("system_information", type) && !(type == EXEC_INITIAL && _initialized))
303 
304  // Write the input
305  if (wantOutput("input", type))
306  outputInput();
307 
308  // Write the timestep information ("Time Step 0 ..."), this is controlled with "execute_on"
309  // We only write the initial and final here. All of the intermediate outputs will be written
310  // through timestepSetup.
312  writeTimestepInformation(/*output_dt = */ false);
314  {
315  if (wantOutput("postprocessors", type) || wantOutput("scalars", type))
316  _console << "\nFINAL:\n";
317  }
318 
319  // Print Non-linear Residual (control with "execute_on")
321  {
322  if (_nonlinear_iter == 0)
323  _old_nonlinear_norm = std::numeric_limits<Real>::max();
324 
325  _console << std::right << std::setw(2) << _nonlinear_iter
326  << " Nonlinear |R| = " << outputNorm(_old_nonlinear_norm, _norm) << '\n';
327 
329  }
330 
331  // Print Linear Residual (control with "execute_on")
333  {
334  if (_linear_iter == 0)
335  _old_linear_norm = std::numeric_limits<Real>::max();
336 
337  _console << std::right << std::setw(7) << _linear_iter
338  << " Linear |R| = " << outputNorm(_old_linear_norm, _norm) << '\n';
339 
341  }
342 
343  // Write variable norms
344  else if (type == EXEC_TIMESTEP_END)
345  {
347  write(Moose::perf_log.get_perf_info(), false);
349  }
350 
351  // Write Postprocessors and Scalars
352  if (wantOutput("postprocessors", type))
354 
355  if (wantOutput("scalars", type))
357 
358  // Write the file
360 }
361 
362 void
364 {
365  if (!_write_file)
366  return;
367 
368  // Create the stream
369  std::ofstream output;
370 
371  // Open the file
372  if (append)
373  output.open(filename().c_str(), std::ios::app | std::ios::out);
374  else
375  output.open(filename().c_str(), std::ios::trunc);
376 
377  if (output.fail())
378  mooseError("Unable to open file ", filename());
379 
380  std::string s = _file_output_stream.str();
381  // Write contents of file output stream and close the file
383  output.close();
384 
385  // Clear the file output stream
386  _file_output_stream.str("");
387 }
388 
389 void
391 {
392  // Stream to build the time step information
393  std::stringstream oss;
394 
395  // Write timestep data for transient executioners
396  if (_transient)
397  {
398  // Write time step and time information
399  oss << "\nTime Step " << timeStep();
400 
401  // Set precision
402  if (_precision > 0)
403  oss << std::setw(_precision) << std::setprecision(_precision) << std::setfill('0')
404  << std::showpoint;
405 
406  // Show scientific notation
407  if (_scientific_time)
408  oss << std::scientific;
409 
410  // Print the time
411  oss << ", time = " << time();
412 
413  if (output_dt)
414  {
415  if (!_verbose)
416  // Show the time delta information
417  oss << ", dt = " << std::left << dt();
418 
419  // Show old time information, if desired on separate lines
420  else
421  {
422  oss << '\n'
423  << std::right << std::setw(21) << std::setfill(' ') << "old time = " << std::left
424  << timeOld() << '\n';
425 
426  // Show the time delta information
427  oss << std::right << std::setw(21) << std::setfill(' ') << "dt = " << std::left << dt()
428  << '\n';
429 
430  // Show the old time delta information, if desired
431  if (_verbose)
432  oss << std::right << std::setw(21) << std::setfill(' ') << "old dt = " << _dt_old << '\n';
433  }
434  }
435 
436  oss << '\n';
437 
438  // Output to the screen
439  _console << oss.str() << std::flush;
440  }
441 }
442 
443 void
445 {
446  // If all_variable_norms is true, then so should outlier printing
449 
450  // if we are not priting anything, let's not waste time computing the norms below and just exit
451  // this call
452  if ((_all_variable_norms == false) && (_outlier_variable_norms == false))
453  return;
454 
455  // if it is an eigenvalue prolblem, we do not know to define RHS,
456  // and then we do not know how to compute variable norms
457  if (dynamic_cast<EigenProblem *>(_problem_ptr) != nullptr)
458  return;
459 
460  // Flag set when header prints
461  bool header = false;
462 
463  // String stream for variable norm information
464  std::ostringstream oss;
465 
466  // Get a references to the NonlinearSystem and libMesh system
468  System & sys = nl.system();
469 
470  // Storage for norm outputs
471  std::map<std::string, Real> other;
472  std::map<std::string, Real> outlier;
473 
474  // Average norm
475  unsigned int n_vars = sys.n_vars();
476  Real avg_norm = (nl.nonlinearNorm() * nl.nonlinearNorm()) / n_vars;
477 
478  // Compute the norms for each of the variables
479  for (unsigned int i = 0; i < n_vars; i++)
480  {
481  // Compute the norm and extract the variable name
482  Real var_norm = sys.calculate_norm(nl.RHS(), i, DISCRETE_L2);
483  var_norm *= var_norm; // use the norm squared
484  std::string var_name = sys.variable_name(i);
485 
486  // Outlier if the variable norm is greater than twice (default) of the average norm
487  if (_outlier_variable_norms && (var_norm > _outlier_multiplier[1] * avg_norm))
488  {
489  // Print the header
490  if (!header)
491  {
492  oss << "\nOutlier Variable Residual Norms:\n";
493  header = true;
494  }
495 
496  // Set the color, RED if the variable norm is 0.8 (default) of the total norm
497  std::string color = COLOR_YELLOW;
498  if (_outlier_variable_norms && (var_norm > _outlier_multiplier[0] * avg_norm * n_vars))
499  color = COLOR_RED;
500 
501  // Display the residual
502  oss << " " << var_name << ": " << std::scientific << color << std::sqrt(var_norm)
503  << COLOR_DEFAULT << '\n';
504  }
505 
506  // GREEN
507  else if (_all_variable_norms)
508  {
509  // Print the header if it doesn't already exist
510  if (!header)
511  {
512  oss << "\nVariable Residual Norms:\n";
513  header = true;
514  }
515  oss << " " << var_name << ": " << std::scientific << COLOR_GREEN << std::sqrt(var_norm)
516  << COLOR_DEFAULT << '\n';
517  }
518  }
519 
520  // Update the output streams
521  _console << oss.str();
522 }
523 
524 // Quick helper to output the norm in color
525 std::string
526 Console::outputNorm(const Real & old_norm, const Real & norm)
527 {
528  std::string color = COLOR_GREEN;
529 
530  // Red if the residual went up... or if the norm is nan
531  if (norm != norm || norm > old_norm)
532  color = COLOR_RED;
533  // Yellow if change is less than 5%
534  else if ((old_norm - norm) / old_norm <= 0.05)
535  color = COLOR_YELLOW;
536 
537  std::stringstream oss;
538  oss << std::scientific << color << norm << COLOR_DEFAULT;
539 
540  return oss.str();
541 }
542 
543 void
545 {
546  if (!_write_screen && !_write_file)
547  return;
548 
549  std::ostringstream oss;
550  oss << "--- " << _app.getInputFileName()
551  << " ------------------------------------------------------";
553  _console << oss.str() << '\n';
554 }
555 
556 void
558 {
560 
562  {
563  std::stringstream oss;
564  oss << "\nPostprocessor Values:\n";
567  _console << oss.str() << '\n';
568  }
569 }
570 
571 void
573 {
575 
576  if (!_scalar_table.empty())
577  {
578  std::stringstream oss;
579  oss << "\nScalar Variable Values:\n";
580  if (processor_id() == 0)
581  {
584  }
585  _console << oss.str() << '\n';
586  }
587 }
588 
589 void
591 {
592  if (_system_info_flags.contains("framework"))
594 
595  if (_system_info_flags.contains("mesh"))
597 
598  if (_system_info_flags.contains("nonlinear"))
599  {
601  if (!output.empty())
602  _console << "Nonlinear System:\n" << output;
603  }
604 
605  if (_system_info_flags.contains("aux"))
606  {
608  if (!output.empty())
609  _console << "Auxiliary System:\n" << output;
610  }
611 
612  if (_system_info_flags.contains("relationship"))
613  {
615  if (!output.empty())
616  _console << "Relationship Managers:\n" << output;
617  }
618 
619  if (_system_info_flags.contains("execution"))
621 
622  if (_system_info_flags.contains("output"))
624 }
625 
626 void
628 {
630  {
631  _console << ConsoleUtils::outputMeshInformation(*_problem_ptr, /*verbose = */ false);
632 
634  if (!output.empty())
635  _console << "Nonlinear System:\n" << output;
636 
638  if (!output.empty())
639  _console << "Auxiliary System:\n" << output;
640  }
641 }
642 
643 void
644 Console::write(std::string message, bool indent /*=true*/)
645 {
646  // Do nothing if the message is empty, writing empty strings messes with multiapp indenting
647  if (message.empty())
648  return;
649 
650  // Write the message to file
651  if (_write_file)
652  _file_output_stream << message;
653 
654  // Apply MultiApp indenting
655  if (indent && _app.multiAppLevel() > 0)
656  MooseUtils::indentMessage(_app.name(), message);
657 
658  // Write message to the screen
659  if (_write_screen)
660  Moose::out << message;
661 }
662 
663 void
664 Console::mooseConsole(const std::string & message)
665 {
666  // Write the messages
667  write(message);
668 
669  // Flush the stream to the screen
670  Moose::out << std::flush;
671 }
672 
673 void
675 {
676  char c[] = {
677  32, 47, 94, 92, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
678  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
679  32, 32, 32, 32, 32, 32, 32, 47, 94, 92, 13, 10, 124, 32, 32, 32, 92, 95, 47,
680  94, 92, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
681  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 94, 92, 95, 47,
682  32, 32, 32, 124, 13, 10, 124, 32, 32, 32, 32, 32, 32, 32, 32, 92, 95, 47, 94,
683  92, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
684  32, 32, 32, 47, 94, 92, 95, 47, 32, 32, 32, 32, 32, 32, 32, 32, 124, 13, 10,
685  32, 92, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 92, 95, 47, 94, 92,
686  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 94, 92, 95, 47, 32, 32, 32,
687  32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 13, 10, 32, 32, 92, 95, 95, 32, 32,
688  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 92, 95, 95, 95, 45, 45, 45,
689  95, 95, 95, 47, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 95,
690  95, 47, 13, 10, 32, 32, 32, 32, 32, 45, 45, 45, 95, 95, 95, 32, 32, 32, 32,
691  32, 32, 32, 32, 32, 47, 32, 32, 32, 32, 32, 32, 32, 92, 32, 32, 32, 32, 32,
692  32, 32, 32, 32, 95, 95, 95, 45, 45, 45, 13, 10, 32, 32, 32, 32, 32, 32, 32,
693  32, 32, 32, 32, 45, 45, 45, 95, 95, 95, 32, 32, 124, 32, 32, 32, 32, 32, 32,
694  32, 32, 32, 124, 32, 32, 95, 95, 95, 45, 45, 45, 13, 10, 32, 32, 32, 32, 32,
695  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 124, 32, 32, 95, 32,
696  32, 32, 95, 32, 32, 124, 45, 45, 13, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32,
697  32, 32, 32, 32, 32, 32, 32, 32, 32, 124, 32, 32, 124, 111, 124, 32, 124, 111, 124,
698  32, 32, 124, 13, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
699  32, 32, 32, 47, 32, 32, 32, 32, 45, 32, 32, 32, 45, 32, 32, 32, 32, 92, 13,
700  10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 124, 32,
701  32, 32, 32, 32, 32, 95, 95, 95, 32, 32, 32, 32, 32, 32, 124, 13, 10, 32, 32,
702  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 32, 32, 32,
703  45, 45, 32, 32, 32, 45, 45, 32, 32, 32, 32, 32, 92, 13, 10, 32, 32, 32, 32,
704  32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 32, 32, 32, 32, 32, 32, 32,
705  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 92, 13, 10, 32, 32, 32, 32,
706  32, 32, 32, 32, 32, 32, 32, 32, 124, 32, 32, 32, 32, 32, 32, 32, 47, 92, 32,
707  32, 32, 32, 32, 47, 92, 32, 32, 32, 32, 32, 32, 32, 124, 13, 10, 32, 32, 32,
708  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 92, 32, 32, 92, 32, 32, 32, 32, 32,
709  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 47, 13, 10, 32, 32, 32,
710  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 92, 32, 32, 92, 95, 95, 95, 95,
711  95, 95, 95, 95, 95, 95, 95, 95, 32, 47, 32, 32, 47, 92, 13, 10, 32, 32, 32,
712  32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 92, 32, 32, 32, 32, 32, 32,
713  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 92, 13, 10, 32, 32,
714  32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 32, 32, 92, 32, 32, 32, 32,
715  32, 39, 95, 95, 95, 39, 32, 32, 32, 32, 32, 47, 32, 32, 32, 32, 92, 13, 10,
716  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 92, 32, 32, 32, 32, 32, 92, 32,
717  45, 45, 95, 95, 45, 45, 45, 95, 95, 45, 45, 32, 47, 32, 32, 32, 32, 32, 47,
718  92, 13, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 92, 47, 32, 32,
719  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
720  92, 47, 32, 32, 92, 13, 10, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 32,
721  47, 32, 32, 32, 32, 32, 32, 32, 77, 46, 79, 46, 79, 46, 83, 46, 69, 32, 32,
722  32, 32, 32, 32, 32, 92, 32, 32, 32, 92, 13, 10, 32, 32, 32, 32, 32, 32, 32,
723  47, 32, 32, 32, 124, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
724  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 124, 32, 32, 32, 92, 13, 10, 32,
725  32, 32, 32, 32, 32, 124, 32, 32, 32, 32, 124, 45, 45, 45, 45, 45, 45, 45, 45,
726  45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 124, 32,
727  32, 32, 32, 124, 13, 10, 32, 32, 32, 32, 32, 32, 32, 92, 32, 32, 32, 32, 92,
728  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
729  32, 32, 32, 32, 47, 32, 32, 32, 32, 47, 13, 10, 32, 32, 32, 32, 32, 32, 32,
730  32, 32, 92, 92, 32, 92, 95, 92, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
731  32, 32, 32, 32, 32, 32, 32, 32, 47, 95, 47, 32, 47, 47, 13, 10, 32, 32, 32,
732  32, 32, 32, 32, 32, 32, 32, 32, 45, 45, 32, 32, 92, 32, 32, 32, 32, 32, 32,
733  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 47, 32, 32, 45, 45, 13, 10, 32,
734  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 124, 32, 32, 45,
735  45, 45, 95, 95, 95, 95, 95, 45, 45, 45, 32, 32, 124, 13, 10, 32, 32, 32, 32,
736  32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 124, 32, 32, 32, 32, 32, 124,
737  32, 32, 32, 124, 32, 32, 32, 32, 32, 124, 13, 10, 32, 32, 32, 32, 32, 32, 32,
738  32, 32, 32, 32, 32, 32, 32, 32, 32, 124, 32, 32, 32, 32, 32, 124, 32, 32, 32,
739  124, 32, 32, 32, 32, 32, 124, 13, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
740  32, 32, 32, 32, 32, 47, 32, 86, 32, 32, 32, 32, 32, 92, 32, 47, 32, 32, 32,
741  32, 86, 32, 32, 92, 13, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
742  32, 32, 32, 124, 95, 124, 95, 95, 95, 95, 95, 124, 32, 124, 95, 95, 95, 95, 124,
743  95, 95, 124};
744  Moose::out << std::string(c) << std::endl << std::endl;
745 }
std::string indent(unsigned int spaces)
Create empty string for indenting.
Definition: ConsoleUtils.C:30
std::string outputNonlinearSystemInformation(FEProblemBase &problem)
Output the Nonlinear system information.
Definition: ConsoleUtils.C:115
bool _libmesh_log
Control the display libMesh performance log.
Definition: Console.h:187
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
Definition: MooseApp.h:255
const ExecFlagType EXEC_FAILED
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:24
ExecFlagEnum _execute_on
The common Execution types; this is used as the default execution type for everything except system i...
Definition: Output.h:185
unsigned int _precision
Number of significant digits.
Definition: Console.h:202
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
static void petscSetupOutput()
Output string for setting up PETSC output.
Definition: Console.C:674
NonlinearSystemBase & getNonlinearSystemBase()
std::string outputExecutionInformation(const MooseApp &app, FEProblemBase &problem)
Output execution information.
Definition: ConsoleUtils.C:243
OutputOnWarehouse _advanced_execute_on
Storage for the individual component execute flags.
Definition: Output.h:242
virtual bool onInterval()
Returns true if the output interval is satisfied.
Definition: Output.C:199
registerMooseObject("MooseApp", Console)
std::string outputAuxiliarySystemInformation(FEProblemBase &problem)
Output the Auxiliary system information.
Definition: ConsoleUtils.C:109
virtual Real dt()
Get the current time step size.
Definition: Output.C:241
Real & _dt_old
Old time step delta.
Definition: Output.h:200
void writeVariableNorms()
Print the L2-norms for each variable.
Definition: Console.C:444
virtual void outputSystemInformation() override
Print system information.
Definition: Console.C:590
MooseEnum _fit_mode
The FormattedTable fit mode.
Definition: Console.h:160
bool _all_variable_norms
Flag for writing all variable norms.
Definition: Console.h:193
An output object for writing to the console (screen)
Definition: Console.h:24
virtual Real time() override
Get the output time.
Definition: PetscOutput.C:253
FormattedTable & _postprocessor_table
Table containing postprocessor data.
Definition: TableOutput.h:66
bool _verbose
Flag for writing detailed time step information.
Definition: Console.h:172
void indentMessage(const std::string &prefix, std::string &message, const char *color=COLOR_CYAN)
Indents the supplied message given the prefix and color.
Definition: MooseUtils.C:431
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
InputParameters validParams< Console >()
Definition: Console.C:30
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:517
bool _write_screen
Flag for controlling outputting console information to screen.
Definition: Console.h:169
Storage for action instances.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::string _file_base
The base filename from the input paramaters.
Definition: FileOutput.h:81
int & _t_step
The current time step.
Definition: Output.h:194
bool _transient
Transient flag (true = transient)
Definition: Output.h:170
void printInputFile(std::ostream &out)
This method uses the Actions in the warehouse to reproduce the input file.
const ExecFlagType EXEC_TIMESTEP_END
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
bool empty() const
Returns a boolean value based on whether the FormattedTable contains data or not. ...
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
std::string outputOutputInformation(MooseApp &app)
Output the output information.
Definition: ConsoleUtils.C:281
bool _allow_changing_sysinfo_flag
A boolean for protecting _system_info_flags from being changed undesirably.
Definition: Console.h:236
Base class for actions.
Definition: Action.h:35
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:191
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:292
std::string outputMeshInformation(FEProblemBase &problem, bool verbose=true)
Output the mesh information.
Definition: ConsoleUtils.C:55
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:53
bool _outlier_variable_norms
Flag for writing outlier variable norms.
Definition: Console.h:196
NonlinearSystemBase * nl
Nonlinear system to be solved.
static MooseEnum getWidthModes()
std::string getInputFileName() const
Returns the input file name that was set with setInputFileName.
Definition: MooseApp.h:160
bool contains(const std::string &value) const
Contains methods for seeing if a value is in the MultiMooseEnum.
bool _initialized
True if init() has been called.
Definition: Output.h:230
virtual Real timeOld()
Get the old output time.
Definition: Output.C:232
PetscInt _linear_iter
Current linear iteration returned from PETSc.
Definition: PetscOutput.h:51
MultiMooseEnum _system_info_flags
Flags for controlling the what simulations information is shown.
Definition: Console.h:230
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:280
virtual void outputPostprocessors() override
Prints the postprocessor table to the screen.
Definition: Console.C:557
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
bool _solve_log
State for solve performance log.
Definition: Console.h:184
FormattedTable & _scalar_table
Table containing scalar aux variables.
Definition: TableOutput.h:75
const ExecFlagType EXEC_TIMESTEP_BEGIN
std::stringstream _file_output_stream
Stream for storing information to be written to a file.
Definition: Console.h:175
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:181
virtual void initialSetup() override
Initial setup function Prints the system information, this is done here so that the system informatio...
Definition: Console.C:232
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Definition: Output.h:167
virtual void timestepSetup() override
Gets called at the beginning of the timestep before this object is asked to do its job...
Definition: Console.C:286
PerfLog perf_log
Perflog to be used by applications.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
ActionWarehouse & actionWarehouse()
Definition: MooseApp.h:146
virtual void outputInput() override
Print the input file at the beginning of the simulation.
Definition: Console.C:544
std::string & removeColor(std::string &msg)
remove ANSI escape sequences for teminal color from msg
Definition: MooseUtils.C:423
virtual void outputScalarVariables() override
Prints the aux scalar variables table to the screen.
Definition: Console.C:572
void mooseConsole(const std::string &message)
Add a message to the output streams.
Definition: Console.C:664
void erase(const std::string &names)
Un-assign a value.
static InputParameters enableOutputTypes(const std::string &names=std::string())
A method for enabling individual output type control.
unsigned int _max_rows
The max number of table rows.
Definition: Console.h:157
const ExecFlagType EXEC_LINEAR
std::string outputFrameworkInformation(const MooseApp &app)
Outputs framework information.
Definition: ConsoleUtils.C:36
Real _norm
Current norm returned from PETSc.
Definition: PetscOutput.h:45
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:174
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:224
bool _write_file
Flag for controlling outputting console information to a file.
Definition: Console.h:166
virtual ~Console()
Destructor.
Definition: Console.C:217
virtual void outputPostprocessors() override
Populates the tables with postprocessor values.
Definition: TableOutput.C:86
bool _perf_log
State for all performance logging.
Definition: Console.h:178
bool wantOutput(const std::string &name, const ExecFlagType &type)
Handles logic for determining if a step should be output.
void writeStreamToFile(bool append=true)
Write the file stream to the file.
Definition: Console.C:363
const ExecFlagType EXEC_NONLINEAR
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
virtual NumericVector< Number > & RHS()=0
std::vector< Real > _outlier_multiplier
Multipliers for coloring variable residual norms (default [2, 0.8])
Definition: Console.h:199
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:935
MatType type
void printTable(std::ostream &out, unsigned int last_n_entries=0)
Methods for dumping the table to the stream - either by filename or by stream handle.
virtual void initialSetup()
Initialization method.
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
virtual System & system() override
Get the reference to the libMesh system.
void push_back(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
Real nonlinearNorm() const
Return the last nonlinear norm.
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:221
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:177
Base class for scalar variables and postprocessors output objects.
Definition: TableOutput.h:33
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...
bool _scientific_time
Toggle for outputting time in time and dt in scientific notation.
Definition: Console.h:163
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void sortColumns()
Sorts columns alphabetically.
bool hasMultiApps() const
Returns whether or not the current simulation has any multiapps.
virtual int timeStep()
Get the current time step.
Definition: Output.C:259
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:89
std::string outputRelationshipManagerInformation(const MooseApp &app)
Output action RelationshipManager information.
Definition: ConsoleUtils.C:223
void writeTimestepInformation(bool output_dt)
Prints the time step information for the screen output.
Definition: Console.C:390
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:859
bool _print_mesh_changed_info
Flag for printing mesh information when the mesh changes.
Definition: Console.h:227
InputParameters validParams< TableOutput >()
Definition: TableOutput.C:27
const ExecFlagType EXEC_FINAL
virtual void outputScalarVariables() override
Populates the tables with scalar aux variables.
Definition: TableOutput.C:147
static std::string outputNorm(const Real &old_norm, const Real &norm)
A helper function for outputting norms in color.
Definition: Console.C:526
PetscInt _nonlinear_iter
Current non-linear iteration returned from PETSc.
Definition: PetscOutput.h:48
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...
Console(const InputParameters &parameters)
Class constructor.
Definition: Console.C:161
const ExecFlagType EXEC_INITIAL