from best_compression to best_speed, as discussed in pull request #14958.
The compression flags of the tests is set to best_compression to conserve
the current output behavior of the tests.
--- /dev/null
+Changed: The default `compression_level` for vtu output is changed from `best_compression` to `best_speed`.
+<br>
+(Christoph Schmidt, 2023/03/28)
/**
* Flag determining the compression level at which zlib, if available, is
- * run. The default is <tt>best_compression</tt>.
+ * run. The default is <tt>best_speed</tt>.
*/
DataOutBase::CompressionLevel compression_level;
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 =
- CompressionLevel::best_compression,
- const bool write_higher_order_cells = false,
+ const CompressionLevel compression_level = CompressionLevel::best_speed,
+ const bool write_higher_order_cells = false,
const std::map<std::string, std::string> &physical_units = {});
};
unsigned int,
std::string,
DataComponentInterpretation::DataComponentInterpretation>>
- vector_data_ranges;
- DataOutBase::VtkFlags flags;
- DataOutBase::write_vtu(patches, data_names, vector_data_ranges, flags, out);
+ vector_data_ranges;
+ DataOutBase::write_vtu(
+ patches, data_names, vector_data_ranges, vtu_flags, out);
}
std::vector<std::string> component_name(dim + dim * dim, "tensor");
std::fill(component_name.begin(), component_name.begin() + dim, "vector");
+ DataOutBase::VtkFlags vtk_flags;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+
DataOut<dim> data_out;
data_out.attach_dof_handler(dof_handler);
data_out.add_data_vector(v,
DataOut<dim>::type_dof_data,
data_component_interpretation);
data_out.build_patches();
+ data_out.set_flags(vtk_flags);
/*
std::ofstream out("output_" + Utilities::int_to_string(dim) + "d.vtu");
std::vector<std::string> component_name(dim + dim * dim, "tensor");
std::fill(component_name.begin(), component_name.begin() + dim, "vector");
+ DataOutBase::VtkFlags vtk_flags;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+
DataOut<dim> data_out;
data_out.attach_dof_handler(dof_handler);
data_out.add_data_vector(v,
DataOut<dim>::type_dof_data,
data_component_interpretation);
data_out.build_patches();
+ data_out.set_flags(vtk_flags);
std::vector<std::string> filenames;
filenames.push_back("output_" + Utilities::int_to_string(dim) + "d.vtu");
char name[100];
DataOutBase::VtkFlags flags;
+ flags.compression_level = DataOutBase::CompressionLevel::best_compression;
if (true)
{
sprintf(name, "%d%d.vtu", dim, spacedim);
DataOutBase::VtkFlags flags;
flags.write_higher_order_cells = true;
+ flags.compression_level = DataOutBase::CompressionLevel::best_compression;
DataOut<dim> data_out;
data_out.set_flags(flags);
DataOutBase::VtkFlags flags;
flags.write_higher_order_cells = true;
+ flags.compression_level = DataOutBase::CompressionLevel::best_compression;
DataOut<dim> data_out;
data_out.set_flags(flags);
StrainPostprocessor<dim> grad_u;
+ DataOutBase::VtkFlags vtk_flags;
+ vtk_flags.compression_level =
+ DataOutBase::CompressionLevel::best_compression;
+
DataOut<dim> data_out;
data_out.attach_dof_handler(dof_handler);
data_component_interpretation);
data_out.add_data_vector(solution, grad_u);
data_out.build_patches();
+ data_out.set_flags(vtk_flags);
data_out.write_vtu(deallog.get_file_stream());
}
tria.begin_active()->set_refine_flag();
tria.execute_coarsening_and_refinement();
- GridOut grid_out;
+ GridOut grid_out;
+ GridOutFlags::Vtu vtu_flags;
+ vtu_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+ grid_out.set_flags(vtu_flags);
grid_out.write_vtu(tria, logfile);
}
tria.refine_global(1);
- GridOut grid_out;
+ GridOut grid_out;
+ GridOutFlags::Vtu vtu_flags;
+ vtu_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+ grid_out.set_flags(vtu_flags);
grid_out.write_vtu(tria, deallog.get_file_stream());
}
const bool view_levels,
const bool include_artificial)
{
- GridOut out;
+ GridOut out;
+ GridOutFlags::Vtu vtu_flags;
+ vtu_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+ out.set_flags(vtu_flags);
out.write_mesh_per_processor_as_vtu(tr,
filename,
view_levels,
const bool view_levels,
const bool include_artificial)
{
- GridOut out;
+ GridOut out;
+ GridOutFlags::Vtu vtu_flags;
+ vtu_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+ out.set_flags(vtu_flags);
out.write_mesh_per_processor_as_vtu(tr,
filename,
view_levels,
GridGenerator::hyper_cube(tr);
tr.refine_global(3);
- std::string filename = "file" + Utilities::int_to_string(dim);
- GridOut grid_out;
+ std::string filename = "file" + Utilities::int_to_string(dim);
+ GridOut grid_out;
+ GridOutFlags::Vtu vtu_flags;
+ vtu_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+ grid_out.set_flags(vtu_flags);
grid_out.write_mesh_per_processor_as_vtu(tr, filename, true);
cat_file((std::string(filename) + ".vtu").c_str());
Vector<double> solution(dof_handler.n_dofs());
solution = 1.0;
+ // Define compression level for output data
+ DataOutBase::VtkFlags vtk_flags;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
// Save output
DataOut<2> data_out;
data_out.attach_dof_handler(dof_handler);
data_out.add_data_vector(solution, "Solution");
data_out.build_patches();
+ data_out.set_flags(vtk_flags);
data_out.write_vtu(deallog.get_file_stream());
data_out2.attach_dof_handler(dof_handler);
data_out2.add_data_vector(new_solution, "Solution");
data_out2.build_patches();
+ data_out2.set_flags(vtk_flags);
data_out2.write_vtu(deallog.get_file_stream());
}
Vector<double> new_solution(dof_handler.n_dofs());
solultion_trans.interpolate(solution, new_solution);
+ // Define compression level for output data
+ DataOutBase::VtkFlags vtk_flags;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+
// a follow-up error to the one fixed with _04 was that DataOut also got
// itself confused
DataOut<2> data_out2;
data_out2.attach_dof_handler(dof_handler);
data_out2.add_data_vector(new_solution, "Solution");
data_out2.build_patches();
+ data_out2.set_flags(vtk_flags);
data_out2.write_vtu(deallog.get_file_stream());
// we are good if we made it to here
dh.distribute_dofs(fe);
deallog << "dofs " << dh.n_dofs() << std::endl;
+ DataOutBase::VtkFlags vtk_flags;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+
DataOut<dim, spacedim> data_out;
data_out.attach_triangulation(tr);
Vector<float> subdomain(tr.n_active_cells());
for (unsigned int i = 0; i < subdomain.size(); ++i)
subdomain(i) = tr.locally_owned_subdomain();
data_out.add_data_vector(subdomain, "subdomain");
+ data_out.set_flags(vtk_flags);
std::string name = "f0.vtu";
name[1] += tr.locally_owned_subdomain();
x.reinit(dofh.locally_owned_dofs(), MPI_COMM_WORLD);
x = 2.0;
+ DataOutBase::VtkFlags vtk_flags;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+
DataOut<dim> data_out;
data_out.attach_dof_handler(dofh);
data_out.add_data_vector(x, "x");
data_out.build_patches();
+ data_out.set_flags(vtk_flags);
data_out.write_vtu_in_parallel("output.vtu", MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
RightHandSideFunction<dim>(n_components),
solution);
+ DataOutBase::VtkFlags vtk_flags;
+ vtk_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+
for (unsigned int n_subdivisions = 1; n_subdivisions <= 2; ++n_subdivisions)
{
DataOut<dim> data_out;
data_out.attach_dof_handler(dof_handler);
data_out.add_data_vector(solution, "solution");
+ data_out.set_flags(vtk_flags);
data_out.build_patches(mapping, n_subdivisions);
const bool view_levels,
const bool include_artificial)
{
- GridOut out;
+ GridOut out;
+ GridOutFlags::Vtu vtu_flags;
+ vtu_flags.compression_level = DataOutBase::CompressionLevel::best_compression;
+ out.set_flags(vtu_flags);
out.write_mesh_per_processor_as_vtu(tr,
filename,
view_levels,