Esempio n. 1
0
void
TableOutput::outputVectorPostprocessors()
{
  // List of names of the postprocessors to output
  const std::set<std::string> & out = getVectorPostprocessorOutput();

  // Loop through the postprocessor names and extract the values from the VectorPostprocessorData storage
  for (std::set<std::string>::const_iterator it = out.begin(); it != out.end(); ++it)
  {
    std::string vpp_name = *it;

    const std::map<std::string, VectorPostprocessorValue*> & vectors = _problem_ptr->getVectorPostprocessorVectors(vpp_name);

    FormattedTable & table = _vector_postprocessor_tables[vpp_name];

    table.clear();
    table.outputTimeColumn(false);

    for (std::map<std::string, VectorPostprocessorValue*>::const_iterator vec_it = vectors.begin(); vec_it != vectors.end(); ++vec_it)
    {
      VectorPostprocessorValue vector = *(vec_it->second);

      for (unsigned int i=0; i<vector.size(); i++)
        table.addData(vec_it->first, vector[i], i);
    }

    if (_time_data)
    {
      FormattedTable & t_table = _vector_postprocessor_time_tables[vpp_name];
      t_table.addData("timestep", _t_step, _time);
    }
  }
}
Esempio n. 2
0
void
TableOutput::outputVectorPostprocessors()
{
  // List of names of the postprocessors to output
  const std::set<std::string> & out = getVectorPostprocessorOutput();

  // Loop through the postprocessor names and extract the values from the VectorPostprocessorData storage
  for (const auto & vpp_name : out)
  {
    const std::map<std::string, VectorPostprocessorValue*> & vectors = _problem_ptr->getVectorPostprocessorVectors(vpp_name);

    FormattedTable & table = _vector_postprocessor_tables[vpp_name];

    table.clear();
    table.outputTimeColumn(false);

    for (const auto & vec_it : vectors)
    {
      VectorPostprocessorValue vector = *(vec_it.second);

      for (unsigned int i=0; i<vector.size(); i++)
        table.addData(vec_it.first, vector[i], i);
    }

    if (_time_data)
    {
      FormattedTable & t_table = _vector_postprocessor_time_tables[vpp_name];
      t_table.addData("timestep", _t_step, _time);
    }
  }
}