Beispiel #1
0
void
OutputWarehouse::addOutput(MooseSharedPointer<Output> & output)
{
  _all_ptrs.push_back(output);

  // Add the object to the warehouse storage, Checkpoint placed at end so they are called last
  Checkpoint * cp = dynamic_cast<Checkpoint *>(output.get());
  if (cp != NULL)
    _all_objects.push_back(output.get());
  else
    _all_objects.insert(_all_objects.begin(), output.get());

  // Store the name and pointer
  _object_map[output->name()] = output.get();
  _object_names.insert(output->name());

  // If the output object is a FileOutput then store the output filename
  FileOutput * ptr = dynamic_cast<FileOutput *>(output.get());
  if (ptr != NULL)
    addOutputFilename(ptr->filename());

  // Insert object sync times to the global set
  if (output->parameters().isParamValid("sync_times"))
  {
    std::vector<Real> sync_times = output->parameters().get<std::vector<Real> >("sync_times");
    _sync_times.insert(sync_times.begin(), sync_times.end());
  }
}
Beispiel #2
0
void
OutputWarehouse::addOutput(OutputBase * output)
{

  // Add the object to the warehouse storage
  _object_ptrs.push_back(output);

  // Store the name
  _output_names.insert(output->name());

  // If the output object is a FileOutputBase then store the output filename
  FileOutputter * ptr = dynamic_cast<FileOutputter *>(output);
  if (ptr != NULL)
    addOutputFilename(ptr->filename());

  // Insert object sync times to the global set
  if (output->parameters().isParamValid("sync_times"))
  {
    std::vector<Real> sync_times = output->parameters().get<std::vector<Real> >("sync_times");
    _sync_times.insert(sync_times.begin(), sync_times.end());
  }

  // Warning if multiple Console objects are added with 'output_screen=true' in the input file
  Console * c_ptr = dynamic_cast<Console *>(output);
  if (c_ptr != NULL)
  {
    bool screen = c_ptr->getParam<bool>("output_screen");

    if (screen && _has_screen_console)
      mooseWarning("Multiple Console output objects are writing to the screen, this will likely cause duplicate messages printed.");
    else
      _has_screen_console = true;
  }
}