Exemple #1
0
void
Console::output(const ExecFlagType & type)
{
  // Return if the current output is not on the desired interval
  if (type != EXEC_FINAL && !onInterval())
    return;

  // Output the system information first; this forces this to be the first item to write by default
  // However, 'output_system_information_on' still operates correctly, so it may be changed by the user
  if (shouldOutput("system_information", type) && !(type == EXEC_INITIAL && _initialized))
    outputSystemInformation();

  // Write the input
  if (shouldOutput("input", type))
    outputInput();

  // Write the timestep information ("Time Step 0 ..."), this is controlled with "execute_on"
  if (type == EXEC_TIMESTEP_BEGIN || (type == EXEC_INITIAL && _execute_on.contains(EXEC_INITIAL)) || (type == EXEC_FINAL && _execute_on.contains(EXEC_FINAL)))
    writeTimestepInformation();

  // Print Non-linear Residual (control with "execute_on")
  if (type == EXEC_NONLINEAR && _execute_on.contains(EXEC_NONLINEAR))
  {
    if (_nonlinear_iter == 0)
      _old_nonlinear_norm = std::numeric_limits<Real>::max();

    _console << std::setw(2) << _nonlinear_iter << " Nonlinear |R| = " << outputNorm(_old_nonlinear_norm, _norm) << '\n';

    _old_nonlinear_norm = _norm;
  }

  // Print Linear Residual (control with "execute_on")
  else if (type == EXEC_LINEAR && _execute_on.contains(EXEC_LINEAR))
  {
    if (_linear_iter == 0)
      _old_linear_norm = std::numeric_limits<Real>::max();

    _console << std::setw(7) << _linear_iter << " Linear |R| = " <<  outputNorm(_old_linear_norm, _norm) << '\n';

    _old_linear_norm = _norm;
  }

  // Write variable norms
  else if (type == EXEC_TIMESTEP_END)
    writeVariableNorms();

  // Write Postprocessors and Scalars
  if (shouldOutput("postprocessors", type))
    outputPostprocessors();

  if (shouldOutput("scalars", type))
    outputScalarVariables();

  // Write the file
  writeStreamToFile();
}
Exemple #2
0
void
Console::initialSetup()
{
  // If --timing was used from the command-line, do nothing, all logs are enabled
  // Also, only allow the main app to change the perf_log settings.
  if (!_timing && _app.name() == "main")
  {
    if (_perf_log || _setup_log || _solve_log || _perf_header || _setup_log_early)
      _app.getOutputWarehouse().setLoggingRequested();

    // Disable performance logging if nobody needs logging
    if (!_app.getOutputWarehouse().getLoggingRequested())
      Moose::perf_log.disable_logging();

    // Disable libMesh log
    if (!_libmesh_log)
      libMesh::perflog.disable_logging();
  }

  // system info flag can be changed only before console initial setup
  _allow_changing_sysinfo_flag = false;

  // If execute_on = 'initial' perform the output
  if (wantOutput("system_information", EXEC_INITIAL))
    outputSystemInformation();

  // Call the base class method
  TableOutput::initialSetup();

  // If file output is desired, wipe out the existing file if not recovering
  if (!_app.isRecovering())
    writeStreamToFile(false);

  // Enable verbose output if Executioner has it enabled
  if (_app.getExecutioner()->isParamValid("verbose") &&
      _app.getExecutioner()->getParam<bool>("verbose"))
    _verbose = true;

  // Display a message to indicate the application is running (useful for MultiApps)
  if (_problem_ptr->hasMultiApps() || _app.multiAppLevel() > 0)
    write(std::string("\nRunning App: ") + _app.name() + "\n");

  // If the user adds "final" to the execute on, append this to the postprocessors, scalars, etc.,
  // but only
  // if the parameter (e.g., postprocessor_execute_on) has not been modified by the user.
  if (_execute_on.contains("final"))
  {
    if (!_pars.isParamSetByUser("postprocessor_execute_on"))
      _advanced_execute_on["postprocessors"].push_back("final");
    if (!_pars.isParamSetByUser("scalars_execute_on"))
      _advanced_execute_on["scalars"].push_back("final");
    if (!_pars.isParamSetByUser("vector_postprocessor_execute_on"))
      _advanced_execute_on["vector_postprocessors"].push_back("final");
  }
}
Exemple #3
0
void
AdvancedOutput<T>::output(const ExecFlagType & type)
{
  // Call the various output types, if data exists
  if (shouldOutput("nodal", type))
  {
    outputNodalVariables();
    _last_output_time["nodal"] = T::_time;
  }

  if (shouldOutput("elemental", type))
  {
    outputElementalVariables();
    _last_output_time["elemental"] = T::_time;
  }

  if (shouldOutput("postprocessors", type))
  {
    outputPostprocessors();
    _last_output_time["postprocessors"] = T::_time;
  }

  if (shouldOutput("vector_postprocessors", type))
  {
    outputVectorPostprocessors();
    _last_output_time["vector_postprocessors"] = T::_time;
  }

  if (shouldOutput("scalars", type))
  {
    outputScalarVariables();
    _last_output_time["scalars"] = T::_time;
  }

  if (shouldOutput("system_information", type))
  {
    outputSystemInformation();
    _last_output_time["system_information"] = T::_time;
  }

  if (shouldOutput("input", type))
  {
    outputInput();
    _last_output_time["input"] = T::_time;
  }
}
Exemple #4
0
void
Console::initialSetup()
{
  // Output the performance log early
  if (getParam<bool>("setup_log_early"))
  {
    if (_write_screen)
      Moose::out << Moose::setup_perf_log.get_perf_info() << std::endl;

    if (_write_file)
      _file_output_stream << Moose::setup_perf_log.get_perf_info() << std::endl;
  }

  // Output the system information
  if (_system_information)
    outputSystemInformation();

  // Output the timestep information
  timestepSetup();
}
Exemple #5
0
void
Console::initialSetup()
{
  // If execute_on = 'initial' perform the output
  if (shouldOutput("system_information", EXEC_INITIAL))
    outputSystemInformation();

  // Call the base class method
  TableOutput::initialSetup();

  // If file output is desired, wipe out the existing file if not recovering
  if (!_app.isRecovering())
    writeStreamToFile(false);

  // Enable verbose output if Executioner has it enabled
  if (_app.getExecutioner()->isParamValid("verbose") && _app.getExecutioner()->getParam<bool>("verbose"))
    _verbose = true;

  // Display a message to indicate the application is running (useful for MultiApps)
  if (_problem_ptr->hasMultiApps() || _app.multiAppLevel() > 0)
    write(std::string("\nRunning App: ") + _app.name() + "\n");

  // Output the performance log early
  if (getParam<bool>("setup_log_early"))
    write(Moose::setup_perf_log.get_perf_info());

  // If the user adds "final" to the execute on, append this to the postprocessors, scalars, etc., but only
  // if the parameter (e.g., postprocessor_execute_on) has not been modified by the user.
  if (_execute_on.contains("final"))
  {
    if (!_pars.paramSetByUser("postprocessor_execute_on"))
      _advanced_execute_on["postprocessors"].push_back("final");
    if (!_pars.paramSetByUser("scalars_execute_on"))
      _advanced_execute_on["scalars"].push_back("final");
    if (!_pars.paramSetByUser("vector_postprocessor_execute_on"))
      _advanced_execute_on["vector_postprocessors"].push_back("final");
  }
}
Exemple #6
0
void
Console::initialSetup()
{
  // Set the string for multiapp output indending
  if (_app.getOutputWarehouse().multiappLevel() > 0)
    _multiapp_indent = COLOR_CYAN + _app.name() + ": " + COLOR_DEFAULT;

  // If file output is desired, wipe out the existing file if not recovering
  if (!_app.isRecovering())
    writeStreamToFile(false);

  // Enable verbose output if Executioner has it enabled
  if (_app.getExecutioner()->isParamValid("verbose") && _app.getExecutioner()->getParam<bool>("verbose"))
  {
    _verbose = true;
    _pars.set<bool>("verbose") = true;
  }

  // Display a message to indicate the application is running (useful for MultiApps)
  if (_problem_ptr->hasMultiApps() || _app.getOutputWarehouse().multiappLevel() > 0)
    write(std::string("\nRunning App: ") + _app.name() + "\n");

  // Output the performance log early
  if (getParam<bool>("setup_log_early"))
    write(Moose::setup_perf_log.get_perf_info());

  // Output the input file
  if (_output_input)
    outputInput();

  // Output the system information
  if (_system_information && _allow_output && !_force_output)
    outputSystemInformation();

  // Output the timestep information
  timestepSetup();
}