www.mooseframework.org
Console.C
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 // MOOSE includes
16 #include "Console.h"
17 #include "ConsoleUtils.h"
18 #include "FEProblem.h"
19 #include "EigenProblem.h"
20 #include "Postprocessor.h"
21 #include "PetscSupport.h"
22 #include "Executioner.h"
23 #include "MooseApp.h"
24 #include "Moose.h"
25 #include "FormattedTable.h"
26 #include "NonlinearSystem.h"
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 += TableOutput::enableOutputTypes("system_information scalar postprocessor input");
38 
39  // Screen and file output toggles
40  params.addParam<bool>("output_screen", true, "Output to the screen");
41  params.addParam<bool>("output_file", false, "Output to the file");
42  params.addParam<bool>(
43  "show_multiapp_name", false, "Indent multiapp output using the multiapp name");
44 
45  // Table fitting options
46  params.addParam<unsigned int>("max_rows",
47  15,
48  "The maximum number of postprocessor/scalar values "
49  "displayed on screen during a timestep (set to 0 "
50  "for unlimited)");
51  params.addParam<MooseEnum>("fit_mode",
52  pps_fit_mode,
53  "Specifies the wrapping mode for post-processor tables that are "
54  "printed to the screen (ENVIRONMENT: Read \"MOOSE_PPS_WIDTH\" for "
55  "desired width, AUTO: Attempt to determine width automatically "
56  "(serial only), <n>: Desired width");
57 
58  // Verbosity
59  params.addParam<bool>("verbose", false, "Print detailed diagnostics on timestep calculation");
60 
61  // Basic table output controls
62  params.addParam<bool>(
63  "scientific_time", false, "Control the printing of time and dt in scientific notation");
64  params.addParam<unsigned int>(
65  "time_precision",
66  "The number of significant digits that are printed on time related outputs");
67 
68  // Performance Logging
69  params.addParam<bool>("perf_log",
70  false,
71  "If true, all performance logs will be printed. The "
72  "individual log settings will override this option.");
73  params.addParam<unsigned int>(
74  "perf_log_interval", 0, "If set, the performance log will be printed every n time steps");
75  params.addParam<bool>("solve_log", "Toggles the printing of the 'Moose Test Performance' log");
76  params.addParam<bool>(
77  "perf_header", "Print the libMesh performance log header (requires that 'perf_log = true')");
78 
79  params.addParam<bool>(
80  "libmesh_log",
81  true,
82  "Print the libMesh performance log, requires libMesh to be configured with --enable-perflog");
83 
84  // Toggle printing of mesh information on adaptivity steps
85  params.addParam<bool>("print_mesh_changed_info",
86  false,
87  "When true, each time the mesh is changed the mesh information is printed");
88 
89  // Toggle for printing variable norms
90  params.addParam<bool>("outlier_variable_norms",
91  true,
92  "If true, outlier variable norms will be printed after each solve");
93  params.addParam<bool>(
94  "all_variable_norms", false, "If true, all variable norms will be printed after each solve");
95 
96  // Multipliers for coloring of variable residual norms
97  std::vector<Real> multiplier;
98  multiplier.push_back(0.8);
99  multiplier.push_back(2);
100  params.addParam<std::vector<Real>>("outlier_multiplier",
101  multiplier,
102  "Multiplier utilized to determine if a residual norm is an "
103  "outlier. If the variable residual is less than "
104  "multiplier[0] times the total residual it is colored red. "
105  "If the variable residual is less than multiplier[1] times "
106  "the average residual it is colored yellow.");
107 
108  // System information controls
109  MultiMooseEnum info("framework mesh aux nonlinear execution output",
110  "framework mesh aux nonlinear execution");
111  params.addParam<MultiMooseEnum>("system_info",
112  info,
113  "List of information types to display "
114  "('framework', 'mesh', 'aux', 'nonlinear', "
115  "'execution', 'output')");
116 
117  // Advanced group
118  params.addParamNamesToGroup("max_rows verbose show_multiapp_name system_info", "Advanced");
119 
120  // Performance log group
121  params.addParamNamesToGroup("perf_log solve_log perf_header", "Perf Log");
122  params.addParamNamesToGroup("libmesh_log", "Performance Log");
123 
124  // Variable norms group
125  params.addParamNamesToGroup("outlier_variable_norms all_variable_norms outlier_multiplier",
126  "Norms");
127 
128  /*
129  * The following modifies the default behavior from base class parameters. Notice the extra flag
130  * on
131  * the set method. This enables "quiet mode". This is done to allow for the proper detection
132  * of user-modified parameters
133  */
134  // By default set System Information to output on initial
135  params.set<MultiMooseEnum>("execute_system_information_on", /*quiet_mode=*/true) = "initial";
136 
137  // Change the default behavior of 'execute_on' to included nonlinear iterations and failed
138  // timesteps
139  params.set<MultiMooseEnum>("execute_on", /*quiet_mode=*/true)
140  .push_back("initial timestep_begin linear nonlinear failed");
141 
142  // By default postprocessors and scalar are only output at the end of a timestep
143  params.set<MultiMooseEnum>("execute_postprocessors_on", /*quiet_mode=*/true) =
144  "initial timestep_end";
145  params.set<MultiMooseEnum>("execute_vector_postprocessors_on", /*quiet_mode=*/true) =
146  "initial timestep_end";
147  params.set<MultiMooseEnum>("execute_scalars_on", /*quiet_mode=*/true) = "initial timestep_end";
148 
149  return params;
150 }
151 
153  : TableOutput(parameters),
154  _max_rows(getParam<unsigned int>("max_rows")),
155  _fit_mode(getParam<MooseEnum>("fit_mode")),
156  _scientific_time(getParam<bool>("scientific_time")),
157  _write_file(getParam<bool>("output_file")),
158  _write_screen(getParam<bool>("output_screen")),
159  _verbose(getParam<bool>("verbose")),
160  _perf_log(getParam<bool>("perf_log") || _app.getParam<bool>("timing")),
161  _perf_log_interval(getParam<unsigned int>("perf_log_interval")),
162  _solve_log(isParamValid("solve_log") ? getParam<bool>("solve_log") : _perf_log),
163  _libmesh_log(getParam<bool>("libmesh_log")),
164  _perf_header(isParamValid("perf_header") ? getParam<bool>("perf_header") : _perf_log),
165  _all_variable_norms(getParam<bool>("all_variable_norms")),
166  _outlier_variable_norms(getParam<bool>("outlier_variable_norms")),
167  _outlier_multiplier(getParam<std::vector<Real>>("outlier_multiplier")),
168  _precision(isParamValid("time_precision") ? getParam<unsigned int>("time_precision") : 0),
169  _console_buffer(_app.getOutputWarehouse().consoleBuffer()),
170  _old_linear_norm(std::numeric_limits<Real>::max()),
171  _old_nonlinear_norm(std::numeric_limits<Real>::max()),
172  _print_mesh_changed_info(getParam<bool>("print_mesh_changed_info")),
173  _system_info_flags(getParam<MultiMooseEnum>("system_info")),
174  _allow_changing_sysinfo_flag(true)
175 {
176  // Apply the special common console flags (print_...)
178  const auto & actions = awh.getActionListByName("common_output");
179  mooseAssert(actions.size() == 1, "Should be only one common_output Action");
180  Action * common_action = *actions.begin();
181 
182  // Honor the 'print_linear_residuals' option, only if 'execute_on' has not been set by the user
183  if (!parameters.isParamSetByUser("execute_on"))
184  {
185  if (common_action->getParam<bool>("print_linear_residuals"))
186  _execute_on.push_back("linear");
187  else
188  _execute_on.erase("linear");
189  }
190 
191  if (!_pars.isParamSetByUser("perf_log") && common_action->getParam<bool>("print_perf_log"))
192  {
193  _perf_log = true;
194  _solve_log = true;
195  }
196 
197  if (_app.name() != "main" &&
198  (_pars.isParamSetByUser("perf_log") || _pars.isParamSetByUser("perf_log_interval") ||
199  _pars.isParamSetByUser("solve_log") || _pars.isParamSetByUser("perf_header") ||
200  _pars.isParamSetByUser("libmesh_log") ||
201  common_action->parameters().isParamSetByUser("print_perf_log")))
202  mooseWarning("Performance logging cannot currently be controlled from a Multiapp, please set "
203  "all performance options in the main input file");
204 
205  // Append the common 'execute_on' to the setting for this object
206  // This is unique to the Console object, all other objects inherit from the common options
207  const MultiMooseEnum & common_execute_on = common_action->getParam<MultiMooseEnum>("execute_on");
208  for (auto & mme : common_execute_on)
209  _execute_on.push_back(mme);
210 
211  // If --show-outputs is used, enable it
212  if (_app.getParam<bool>("show_outputs"))
213  _system_info_flags.push_back("output");
214 
215  // Set output coloring
216  if (Moose::colorConsole())
217  {
218  char * term_env = getenv("TERM");
219  if (term_env)
220  {
221  std::string term(term_env);
222  if (term != "xterm-256color" && term != "xterm")
223  Moose::setColorConsole(false);
224  }
225  }
226 }
227 
229 {
230  // Write the libMesh performance log header
231  if (_perf_header)
232  write(Moose::perf_log.get_info_header(), false);
233 
234  // Write the solve log (Moose Test Performance)
235  if (_solve_log)
236  write(Moose::perf_log.get_perf_info(), false);
237 
238  // Write the libMesh log
239  if (_libmesh_log)
240  write(libMesh::perflog.get_perf_info(), false);
241 
242  // Write the file output stream
244 
245  // Disable logging so that the destructor in libMesh doesn't print
246  Moose::perf_log.disable_logging();
247  libMesh::perflog.disable_logging();
248 }
249 
250 void
252 {
253  // Only allow the main app to change the perf_log settings.
254  if (_app.name() == "main")
255  {
258 
259  // Disable performance logging if nobody needs logging
261  Moose::perf_log.disable_logging();
262 
263  // Disable libMesh log
264  if (!_libmesh_log)
265  libMesh::perflog.disable_logging();
266  }
267 
268  // system info flag can be changed only before console initial setup
270 
271  // If execute_on = 'initial' perform the output
272  if (wantOutput("system_information", EXEC_INITIAL))
274 
275  // Call the base class method
277 
278  // If file output is desired, wipe out the existing file if not recovering
279  if (!_app.isRecovering())
280  writeStreamToFile(false);
281 
282  // Enable verbose output if Executioner has it enabled
283  if (_app.getExecutioner()->isParamValid("verbose") &&
284  _app.getExecutioner()->getParam<bool>("verbose"))
285  _verbose = true;
286 
287  // Display a message to indicate the application is running (useful for MultiApps)
289  write(std::string("\nRunning App: ") + _app.name() + "\n");
290 
291  // If the user adds "final" to the execute on, append this to the postprocessors, scalars, etc.,
292  // but only
293  // if the parameter (e.g., postprocessor_execute_on) has not been modified by the user.
294  if (_execute_on.contains("final"))
295  {
296  if (!_pars.isParamSetByUser("postprocessor_execute_on"))
297  _advanced_execute_on["postprocessors"].push_back("final");
298  if (!_pars.isParamSetByUser("scalars_execute_on"))
299  _advanced_execute_on["scalars"].push_back("final");
300  if (!_pars.isParamSetByUser("vector_postprocessor_execute_on"))
301  _advanced_execute_on["vector_postprocessors"].push_back("final");
302  }
303 }
304 
305 std::string
307 {
308  return _file_base + ".txt";
309 }
310 
311 void
313 {
314  // Return if the current output is not on the desired interval
315  if (type != EXEC_FINAL && !onInterval())
316  return;
317 
318  // Output the system information first; this forces this to be the first item to write by default
319  // However, 'output_system_information_on' still operates correctly, so it may be changed by the
320  // user
321  if (wantOutput("system_information", type) && !(type == EXEC_INITIAL && _initialized))
323 
324  // Write the input
325  if (wantOutput("input", type))
326  outputInput();
327 
328  // Write the timestep information ("Time Step 0 ..."), this is controlled with "execute_on"
329  if (type == EXEC_TIMESTEP_BEGIN || (type == EXEC_INITIAL && _execute_on.contains(EXEC_INITIAL)) ||
332 
333  // Print Non-linear Residual (control with "execute_on")
335  {
336  if (_nonlinear_iter == 0)
337  _old_nonlinear_norm = std::numeric_limits<Real>::max();
338 
339  _console << std::setw(2) << _nonlinear_iter
340  << " Nonlinear |R| = " << outputNorm(_old_nonlinear_norm, _norm) << '\n';
341 
343  }
344 
345  // Print Linear Residual (control with "execute_on")
346  else if (type == EXEC_LINEAR && _execute_on.contains(EXEC_LINEAR))
347  {
348  if (_linear_iter == 0)
349  _old_linear_norm = std::numeric_limits<Real>::max();
350 
351  _console << std::setw(7) << _linear_iter
352  << " Linear |R| = " << outputNorm(_old_linear_norm, _norm) << '\n';
353 
355  }
356 
357  // Write variable norms
358  else if (type == EXEC_TIMESTEP_END)
359  {
361  write(Moose::perf_log.get_perf_info(), false);
363  }
364 
365  // Write Postprocessors and Scalars
366  if (wantOutput("postprocessors", type))
368 
369  if (wantOutput("scalars", type))
371 
372  // Write the file
374 }
375 
376 void
378 {
379  if (!_write_file)
380  return;
381 
382  // Create the stream
383  std::ofstream output;
384 
385  // Open the file
386  if (append)
387  output.open(filename().c_str(), std::ios::app | std::ios::out);
388  else
389  output.open(filename().c_str(), std::ios::trunc);
390 
391  std::string s = _file_output_stream.str();
392  // Write contents of file output stream and close the file
393  output << MooseUtils::removeColor(s);
394  output.close();
395 
396  // Clear the file output stream
397  _file_output_stream.str("");
398 }
399 
400 void
402 {
403  // Stream to build the time step information
404  std::stringstream oss;
405 
406  // Write timestep data for transient executioners
407  if (_transient)
408  {
409  // Get the length of the time step string
410  std::ostringstream time_step_string;
411  time_step_string << timeStep();
412  unsigned int n = time_step_string.str().size();
413  if (n < 2)
414  n = 2;
415 
416  // Write time step and time information
417  oss << std::endl << "Time Step " << std::setw(n) << timeStep();
418 
419  // Set precision
420  if (_precision > 0)
421  oss << std::setw(_precision) << std::setprecision(_precision) << std::setfill('0')
422  << std::showpoint;
423 
424  // Show scientific notation
425  if (_scientific_time)
426  oss << std::scientific;
427 
428  // Print the time
429  oss << ", time = " << time() << std::endl;
430 
431  // Show old time information, if desired
432  if (_verbose)
433  oss << std::right << std::setw(21) << std::setfill(' ') << "old time = " << std::left
434  << timeOld() << '\n';
435 
436  // Show the time delta information
437  oss << std::right << std::setw(21) << std::setfill(' ') << "dt = " << std::left << dt() << '\n';
438 
439  // Show the old time delta information, if desired
440  if (_verbose)
441  oss << std::right << std::setw(21) << std::setfill(' ') << "old dt = " << _dt_old << '\n';
442  }
443 
444  // Output to the screen
445  _console << oss.str();
446 }
447 
448 void
450 {
451  // If all_variable_norms is true, then so should outlier printing
454 
455  // if we are not priting anything, let's not waste time computing the norms below and just exit
456  // this call
457  if ((_all_variable_norms == false) && (_outlier_variable_norms == false))
458  return;
459 
460  // if it is an eigenvalue prolblem, we do not know to define RHS,
461  // and then we do not know how to compute variable norms
462  if (dynamic_cast<EigenProblem *>(_problem_ptr) != nullptr)
463  return;
464 
465  // Flag set when header prints
466  bool header = false;
467 
468  // String stream for variable norm information
469  std::ostringstream oss;
470 
471  // Get a references to the NonlinearSystem and libMesh system
473  System & sys = nl.system();
474 
475  // Storage for norm outputs
476  std::map<std::string, Real> other;
477  std::map<std::string, Real> outlier;
478 
479  // Average norm
480  unsigned int n_vars = sys.n_vars();
481  Real avg_norm = (nl.nonlinearNorm() * nl.nonlinearNorm()) / n_vars;
482 
483  // Compute the norms for each of the variables
484  for (unsigned int i = 0; i < n_vars; i++)
485  {
486  // Compute the norm and extract the variable name
487  Real var_norm = sys.calculate_norm(nl.RHS(), i, DISCRETE_L2);
488  var_norm *= var_norm; // use the norm squared
489  std::string var_name = sys.variable_name(i);
490 
491  // Outlier if the variable norm is greater than twice (default) of the average norm
492  if (_outlier_variable_norms && (var_norm > _outlier_multiplier[1] * avg_norm))
493  {
494  // Print the header
495  if (!header)
496  {
497  oss << "\nOutlier Variable Residual Norms:\n";
498  header = true;
499  }
500 
501  // Set the color, RED if the variable norm is 0.8 (default) of the total norm
502  std::string color = COLOR_YELLOW;
503  if (_outlier_variable_norms && (var_norm > _outlier_multiplier[0] * avg_norm * n_vars))
504  color = COLOR_RED;
505 
506  // Display the residual
507  oss << " " << var_name << ": " << std::scientific << color << std::sqrt(var_norm)
508  << COLOR_DEFAULT << '\n';
509  }
510 
511  // GREEN
512  else if (_all_variable_norms)
513  {
514  // Print the header if it doesn't already exist
515  if (!header)
516  {
517  oss << "\nVariable Residual Norms:\n";
518  header = true;
519  }
520  oss << " " << var_name << ": " << std::scientific << COLOR_GREEN << std::sqrt(var_norm)
521  << COLOR_DEFAULT << '\n';
522  }
523  }
524 
525  // Update the output streams
526  _console << oss.str();
527 }
528 
529 // Quick helper to output the norm in color
530 std::string
531 Console::outputNorm(const Real & old_norm, const Real & norm)
532 {
533  std::string color = COLOR_GREEN;
534 
535  // Red if the residual went up... or if the norm is nan
536  if (norm != norm || norm > old_norm)
537  color = COLOR_RED;
538  // Yellow if change is less than 5%
539  else if ((old_norm - norm) / old_norm <= 0.05)
540  color = COLOR_YELLOW;
541 
542  std::stringstream oss;
543  oss << std::scientific << color << norm << COLOR_DEFAULT;
544 
545  return oss.str();
546 }
547 
548 void
550 {
551  if (!_write_screen && !_write_file)
552  return;
553 
554  std::ostringstream oss;
555  oss << "--- " << _app.getInputFileName()
556  << " ------------------------------------------------------";
558  _console << oss.str() << '\n';
559 }
560 
561 void
563 {
565 
567  {
568  std::stringstream oss;
569  oss << "\nPostprocessor Values:\n";
572  _console << oss.str() << '\n';
573  }
574 }
575 
576 void
578 {
580 
581  if (!_scalar_table.empty())
582  {
583  std::stringstream oss;
584  oss << "\nScalar Variable Values:\n";
585  if (processor_id() == 0)
586  {
589  }
590  _console << oss.str() << '\n';
591  }
592 }
593 
594 void
596 {
597  if (_system_info_flags.contains("framework"))
599 
600  if (_system_info_flags.contains("mesh"))
602 
603  if (_system_info_flags.contains("nonlinear"))
604  {
606  if (!output.empty())
607  _console << "Nonlinear System:\n" << output;
608  }
609 
610  if (_system_info_flags.contains("aux"))
611  {
613  if (!output.empty())
614  _console << "Auxiliary System:\n" << output;
615  }
616 
617  if (_system_info_flags.contains("execution"))
619 
620  if (_system_info_flags.contains("output"))
622 
623  _console << "\n\n";
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 }
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
std::string indent(unsigned int spaces)
Create empty string for indenting.
Definition: ConsoleUtils.C:34
std::string outputNonlinearSystemInformation(FEProblemBase &problem)
Output the Nonlinear system information.
Definition: ConsoleUtils.C:109
bool _libmesh_log
Control the display libMesh performance log.
Definition: Console.h:189
void mooseWarning(Args &&...args) const
Definition: MooseObject.h:89
Real nonlinearNorm()
Return the last nonlinear norm.
unsigned int _precision
Number of significant digits.
Definition: Console.h:204
bool colorConsole()
Returns whether Console coloring is turned on (default: true).
Definition: Moose.C:1270
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
bool empty() const
Returns a boolean value based on whether the FormattedTable contains data or not. ...
static void petscSetupOutput()
Output string for setting up PETSC output.
Definition: Console.C:674
NonlinearSystemBase & getNonlinearSystemBase()
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:607
OutputOnWarehouse _advanced_execute_on
Storage for the individual component execute flags.
Definition: Output.h:237
bool hasMultiApps() const
Returns whether or not the current simulation has any multiapps.
MultiMooseEnum _execute_on
The common Execution types; this is used as the default execution type for everything except system i...
Definition: Output.h:186
virtual bool onInterval()
Returns true if the output interval is satisfied.
Definition: Output.C:175
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:465
std::string outputAuxiliarySystemInformation(FEProblemBase &problem)
Output the Auxiliary system information.
Definition: ConsoleUtils.C:103
Object is evaluated only once at the beginning of the simulation.
Definition: MooseTypes.h:94
virtual Real dt()
Get the current time step size.
Definition: Output.C:215
Real & _dt_old
Old time step delta.
Definition: Output.h:201
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
virtual Real time() override
Get the output time.
Definition: PetscOutput.C:258
FormattedTable & _postprocessor_table
Table containing postprocessor data.
Definition: TableOutput.h:70
bool getLoggingRequested() const
Returns a Boolean indicating whether performance logging is requested in this application.
void setLoggingRequested()
Sets a Boolean indicating that at least one object is requesting performance logging in this applicat...
bool _verbose
Flag for writing detailed time step information.
Definition: Console.h:174
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:438
InputParameters validParams< Console >()
Definition: Console.C:30
const std::list< Action * > & getActionListByName(const std::string &task) const
Retrieve a constant list of Action pointers associated with the passed in task.
bool _write_screen
Flag for controlling outputting console information to screen.
Definition: Console.h:171
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:87
int & _t_step
The current time step.
Definition: Output.h:195
bool _transient
Transient flag (true = transient)
Definition: Output.h:174
void printInputFile(std::ostream &out)
This method uses the Actions in the warehouse to reproduce the input file.
std::string outputOutputInformation(MooseApp &app)
Output the output information.
Definition: ConsoleUtils.C:240
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
bool _allow_changing_sysinfo_flag
A boolean for protecting _system_info_flags from being changed undesirably.
Definition: Console.h:238
Base class for actions.
Definition: Action.h:39
Object is evaluated at the end of every time step.
Definition: MooseTypes.h:100
bool contains(const std::string &value) const
Contains methods for seeing if a value is in the MultiMooseEnum.
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
std::string outputMeshInformation(FEProblemBase &problem, bool verbose=true)
Output the mesh information.
Definition: ConsoleUtils.C:59
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
NonlinearSystemBase * nl
Nonlinear system to be solved.
static MooseEnum getWidthModes()
bool _initialized
True if init() has been called.
Definition: Output.h:225
virtual Real timeOld()
Get the old output time.
Definition: Output.C:206
PetscInt _linear_iter
Current linear iteration returned from PETSc.
Definition: PetscOutput.h:57
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
FormattedTable & _scalar_table
Table containing scalar aux variables.
Definition: TableOutput.h:79
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
FEProblemBase * _problem_ptr
Pointer the the FEProblemBase object for output object (use this)
Definition: Output.h:171
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:37
ActionWarehouse & actionWarehouse()
Definition: MooseApp.h:130
virtual void outputInput() override
Print the input file at the beginning of the simulation.
Definition: Console.C:549
std::string & removeColor(std::string &msg)
remove ANSI escape sequences for teminal color from msg
Definition: MooseUtils.C:430
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseObject.h:67
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
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:159
Real _norm
Current norm returned from PETSc.
Definition: PetscOutput.h:51
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:122
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:111
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
virtual void outputPostprocessors() override
Populates the tables with postprocessor values.
Definition: TableOutput.C:81
bool _perf_log
State for all performance logging.
Definition: Console.h:180
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:377
virtual NumericVector< Number > & RHS()=0
std::vector< Real > _outlier_multiplier
Multipliers for coloring variable residual norms (default [2, 0.8])
Definition: Console.h:201
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:738
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.
std::string outputExecutionInformation(MooseApp &app, FEProblemBase &problem)
Output execution information.
Definition: ConsoleUtils.C:212
virtual void initialSetup()
Initialization method.
std::string outputFrameworkInformation(MooseApp &app)
Outputs framework information.
Definition: ConsoleUtils.C:40
virtual System & system() override
Get the reference to the libMesh system.
PetscInt n
std::string getInputFileName()
Returns the input file name that was set with setInputFileName.
Definition: MooseApp.h:144
void push_back(const std::string &names)
Insert operators Operator to insert (push_back) values into the enum.
void meshChanged() override
Performs console related printing when the mesh is changed.
Definition: Console.C:627
bool setColorConsole(bool use_color, bool force=false)
Turns color escape sequences on/off for info written to stdout.
Definition: Moose.C:1276
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
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
Object is evaluated at the end of the simulations (output only)
Definition: MooseTypes.h:104
Object is evaluated at the beginning of every time step.
Definition: MooseTypes.h:102
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
Executioner * getExecutioner()
Retrieve the Executioner for this App.
Definition: MooseApp.h:233
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
Object is evaluated in every jacobian computation.
Definition: MooseTypes.h:98
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.
virtual int timeStep()
Get the current time step.
Definition: Output.C:233
bool _print_mesh_changed_info
Flag for printing mesh information when the mesh changes.
Definition: Console.h:229
InputParameters validParams< TableOutput >()
Definition: TableOutput.C:32
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:840
virtual void outputScalarVariables() override
Populates the tables with scalar aux variables.
Definition: TableOutput.C:137
std::string outputNorm(const Real &old_norm, const Real &norm)
A helper function for outputting norms in color.
Definition: Console.C:531
PetscInt _nonlinear_iter
Current non-linear iteration returned from PETSc.
Definition: PetscOutput.h:54
Console(const InputParameters &parameters)
Class constructor.
Definition: Console.C:152