// zlib compression algorithm that is optimized for speed instead of disk
// usage since otherwise plotting the output becomes a bottleneck:
DataOutBase::VtkFlags vtk_flags;
- vtk_flags.compression_level = DataOutBase::best_speed;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_speed;
data_out.set_flags(vtk_flags);
std::ofstream output(filename);
data_out.write_vtu(output);
const std::string filename =
"solution-" + Utilities::int_to_string(timestep_number, 3) + ".vtu";
DataOutBase::VtkFlags vtk_flags;
- vtk_flags.compression_level = DataOutBase::best_speed;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_speed;
std::ofstream output(filename);
data_out.write_vtu(output);
}
const std::string filename =
"solution-" + Utilities::int_to_string(timestep_number, 3) + ".vtu";
DataOutBase::VtkFlags vtk_flags;
- vtk_flags.compression_level = DataOutBase::best_speed;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_speed;
data_out.set_flags(vtk_flags);
std::ofstream output(filename);
data_out.write_vtu(output);
// disk. Here we ask ZLib, a compression library, to compress the data
// in a way that maximizes throughput.
DataOutBase::VtkFlags vtk_flags;
- vtk_flags.compression_level = DataOutBase::best_speed;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_speed;
data_out.set_flags(vtk_flags);
std::ofstream output("solution-" + std::to_string(cycle) + ".vtu");
* An enum for different levels of compression used in several places
* to determine zlib compression levels.
*/
- enum CompressionLevel
+ enum class CompressionLevel
{
/**
* Do not use any compression.
DataOutBase::CompressionLevel;
DEAL_II_DEPRECATED static const DataOutBase::CompressionLevel
- no_compression = dealii::DataOutBase::no_compression;
+ no_compression = DataOutBase::CompressionLevel::no_compression;
DEAL_II_DEPRECATED static const DataOutBase::CompressionLevel
- best_compression = dealii::DataOutBase::best_compression;
+ best_compression = DataOutBase::CompressionLevel::best_compression;
DEAL_II_DEPRECATED static const DataOutBase::CompressionLevel best_speed =
- dealii::DataOutBase::best_speed;
+ DataOutBase::CompressionLevel::best_speed;
DEAL_II_DEPRECATED static const DataOutBase::CompressionLevel
- default_compression = dealii::DataOutBase::default_compression;
+ default_compression = DataOutBase::CompressionLevel::default_compression;
/**
* Flag determining the compression level at which zlib, if available, is
* Constructor. Initializes the member variables with names corresponding
* to the argument names of this function.
*/
- VtkFlags(
+ explicit 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,
- const CompressionLevel compression_level = best_compression,
- const bool write_higher_order_cells = false,
+ const bool print_date_and_time = true,
+ const CompressionLevel compression_level =
+ CompressionLevel::best_compression,
+ const bool write_higher_order_cells = false,
const std::map<std::string, std::string> &physical_units = {});
};
{
switch (level)
{
- case (DataOutBase::no_compression):
+ case (DataOutBase::CompressionLevel::no_compression):
return Z_NO_COMPRESSION;
- case (DataOutBase::best_speed):
+ case (DataOutBase::CompressionLevel::best_speed):
return Z_BEST_SPEED;
- case (DataOutBase::best_compression):
+ case (DataOutBase::CompressionLevel::best_compression):
return Z_BEST_COMPRESSION;
- case (DataOutBase::default_compression):
+ case (DataOutBase::CompressionLevel::default_compression):
return Z_DEFAULT_COMPRESSION;
default:
Assert(false, ExcNotImplemented());
{
switch (level)
{
- case (DataOutBase::no_compression):
+ case (DataOutBase::CompressionLevel::no_compression):
return boost::iostreams::zlib::no_compression;
- case (DataOutBase::best_speed):
+ case (DataOutBase::CompressionLevel::best_speed):
return boost::iostreams::zlib::best_speed;
- case (DataOutBase::best_compression):
+ case (DataOutBase::CompressionLevel::best_compression):
return boost::iostreams::zlib::best_compression;
- case (DataOutBase::default_compression):
+ case (DataOutBase::CompressionLevel::default_compression):
return boost::iostreams::zlib::default_compression;
default:
Assert(false, ExcNotImplemented());
{
boost::iostreams::filtering_ostream f;
- if (compression != no_compression)
+ if (compression != CompressionLevel::no_compression)
# ifdef DEAL_II_WITH_ZLIB
f.push(boost::iostreams::zlib_compressor(
get_boost_zlib_compression_level(compression)));
const ParallelIntermediateHeader header{
0x00dea111,
Deal_II_IntermediateFlags::format_version,
- compression,
+ static_cast<std::uint64_t>(compression),
dim,
spacedim,
n_ranks,
boost::iostreams::filtering_istreambuf f;
if (static_cast<DataOutBase::CompressionLevel>(header.compression) !=
- DataOutBase::no_compression)
+ DataOutBase::CompressionLevel::no_compression)
#ifdef DEAL_II_WITH_ZLIB
f.push(boost::iostreams::zlib_decompressor());
#else
const std::string filename =
"solution-" + Utilities::int_to_string(timestep_number, 3) + ".vtu";
DataOutBase::VtkFlags vtk_flags;
- vtk_flags.compression_level = DataOutBase::best_speed;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_speed;
data_out.set_flags(vtk_flags);
std::ofstream output(filename);
data_out.write_vtu(output);