コード例 #1
0
ファイル: Console.C プロジェクト: huangh-inl/moose
void
Console::writeTimestepInformation()
{
  // Stream to build the time step information
  std::stringstream oss;

  // Write timestep data for transient executioners
  if (_transient)
  {
    // Get the length of the time step string
    std::ostringstream time_step_string;
    time_step_string << timeStep();
    unsigned int n = time_step_string.str().size();
    if (n < 2)
      n = 2;

    // Write time step and time information
    oss << std::endl << "Time Step " << std::setw(n) << timeStep();

    // Set precision
    if (_precision > 0)
      oss << std::setw(_precision) << std::setprecision(_precision) << std::setfill('0')
          << std::showpoint;

    // Show scientific notation
    if (_scientific_time)
      oss << std::scientific;

    // Print the time
    oss << ", time = " << time() << std::endl;

    // Show old time information, if desired
    if (_verbose)
      oss << std::right << std::setw(21) << std::setfill(' ') << "old time = " << std::left
          << timeOld() << '\n';

    // Show the time delta information
    oss << std::right << std::setw(21) << std::setfill(' ') << "dt = " << std::left << dt() << '\n';

    // Show the old time delta information, if desired
    if (_verbose)
      oss << std::right << std::setw(21) << std::setfill(' ') << "old dt = " << _dt_old << '\n';
  }

  // Output to the screen
  _console << oss.str();
}
コード例 #2
0
ファイル: Console.C プロジェクト: GaZ3ll3/moose
void
Console::timestepSetup()
{
  // Do nothing if output is turned off
  // Do nothing if the problem is steady or if it is not an output interval
  // Do nothing if output_initial = false and the timestep is zero
  if (!_allow_output || !checkInterval() || (!_output_initial && timeStep() == 0))
    return;

  // Stream to build the time step information
  std::stringstream oss;

  // Write timestep data for transient executioners
  if (_transient)
  {
    // Get the length of the time step string
    std::ostringstream time_step_string;
    time_step_string << timeStep();
    unsigned int n = time_step_string.str().size();
    if (n < 2)
      n = 2;

    // Write time step and time information
    oss << std::endl << "Time Step " << std::setw(n) << timeStep();

    // Set precision
    if (_precision > 0)
      oss << std::setw(_precision) << std::setprecision(_precision) << std::setfill('0') << std::showpoint;

    // Show scientific notation
    if (_scientific_time)
      oss << std::scientific;

    // Print the time
    oss << ", time = " << time() << std::endl;

    // Show old time information, if desired
    if (_verbose)
      oss << std::right << std::setw(21) << std::setfill(' ') << "old time = " << std::left << timeOld() << '\n';

    // Show the time delta information
    oss << std::right << std::setw(21) << std::setfill(' ') << "dt = "<< std::left << dt() << '\n';

    // Show the old time delta information, if desired
    if (_verbose)
      oss << std::right << std::setw(21) << std::setfill(' ') << "old dt = " << _dt_old << '\n';
  }

  // Output to the screen
  write(oss.str());
}