<h3>Specific improvements</h3>
<ol>
+ <li>
+ New: DataOutBase::VtkFlags now has a flag
+ DataOutBase::VtkFlags::print_date_and_time that can be used to suppress output
+ of date and time in output files. This is useful in test suites where a newer
+ run at a different time produces differences against previously stored files,
+ even though the actual data is exactly the same.
+ <br>
+ (Oleh Krehel, 2013/08/06)
+ </li>
+
<li>
Fixed: The various block matrix classes are all derived from BlockMatrixBase
which had race conditions when the set() or add() functions were called from
*/
unsigned int cycle;
+ /**
+ * Flag to determine whether the current
+ * date and time shall be printed as a comment
+ * in the file's second line.
+ *
+ * Default is <tt>true</tt>.
+ */
+ bool print_date_and_time;
+
/**
* Default constructor.
*/
- VtkFlags (const double time = std::numeric_limits<double>::min(),
- const unsigned int cycle = std::numeric_limits<unsigned int>::min());
+ VtkFlags (const double time = std::numeric_limits<double>::min(),
+ const unsigned int cycle = std::numeric_limits<unsigned int>::min(),
+ const bool print_date_and_time = true);
/**
* Declare the flags with name
* DataOutInterface::write_vtu_footer() and DataOutInterface::write_vtu_main()
* by DataOutBase::write_vtu().
*/
- static void write_vtu_header (std::ostream &out);
+ static void write_vtu_header (std::ostream &out, const VtkFlags &flags);
/**
* This writes the footer for the xml based vtu file format. This
DataOutBase::VtkFlags::VtkFlags (const double time,
- const unsigned int cycle)
+ const unsigned int cycle,
+ const bool print_date_and_time)
:
time (time),
- cycle (cycle)
+ cycle (cycle),
+ print_date_and_time (print_date_and_time)
{}
std::tm *time = std::localtime(&time1);
out << "# vtk DataFile Version 3.0"
<< '\n'
- << "#This file was generated by the deal.II library on "
- << time->tm_year+1900 << "/"
- << time->tm_mon+1 << "/"
- << time->tm_mday << " at "
- << time->tm_hour << ":"
- << std::setw(2) << time->tm_min << ":"
- << std::setw(2) << time->tm_sec
- << '\n'
+ << "#This file was generated by the deal.II library";
+ if (flags.print_date_and_time)
+ out << " on "
+ << time->tm_year+1900 << "/"
+ << time->tm_mon+1 << "/"
+ << time->tm_mday << " at "
+ << time->tm_hour << ":"
+ << std::setw(2) << time->tm_min << ":"
+ << std::setw(2) << time->tm_sec;
+ else
+ out << ".";
+ out << '\n'
<< "ASCII"
<< '\n';
// now output the data header
}
-void DataOutBase::write_vtu_header (std::ostream &out)
+void DataOutBase::write_vtu_header (std::ostream &out,
+ const VtkFlags &flags)
{
AssertThrow (out, ExcIO());
std::time_t time1= std::time (0);
out << "<!-- \n";
out << "# vtk DataFile Version 3.0"
<< '\n'
- << "#This file was generated by the deal.II library on "
- << time->tm_year+1900 << "/"
- << time->tm_mon+1 << "/"
- << time->tm_mday << " at "
- << time->tm_hour << ":"
- << std::setw(2) << time->tm_min << ":"
- << std::setw(2) << time->tm_sec
- << "\n-->\n";
-
+ << "#This file was generated by the deal.II library";
+ if (flags.print_date_and_time)
+ out << " on "
+ << time->tm_year+1900 << "/"
+ << time->tm_mon+1 << "/"
+ << time->tm_mday << " at "
+ << time->tm_hour << ":"
+ << std::setw(2) << time->tm_min << ":"
+ << std::setw(2) << time->tm_sec;
+ else
+ out << ".";
+ out << "\n-->\n";
out << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\"";
#ifdef DEAL_II_WITH_ZLIB
out << " compressor=\"vtkZLibDataCompressor\"";
const VtkFlags &flags,
std::ostream &out)
{
- write_vtu_header(out);
+ write_vtu_header(out, flags);
write_vtu_main (patches, data_names, vector_data_ranges, flags, out);
write_vtu_footer(out);
if (myrank==0)
{
std::stringstream ss;
- DataOutBase::write_vtu_header(ss);
+ DataOutBase::write_vtu_header(ss, vtk_flags);
header_size = ss.str().size();
MPI_File_write(fh, const_cast<char *>(ss.str().c_str()), header_size, MPI_CHAR, NULL);
}