Skip to content
Snippets Groups Projects
Commit 7eeb2104 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Fills the vtkGhostType field to fix parallel rendering

parent 7aab4b0a
No related branches found
No related tags found
1 merge request!186Fills the vtkGhostType field to fix parallel rendering
......@@ -431,6 +431,9 @@ VTKWriter::_write(const MeshType& mesh,
std::visit([&, name = name](auto&& item_value) { return this->_write_cell_pvtu(fout, name, item_value); },
item_value_variant);
}
if (parallel::size() > 1) {
fout << "<PDataArray type=\"UInt8\" Name=\"vtkGhostType\" NumberOfComponents=\"1\"/>\n";
}
fout << "</PCellData>\n";
for (size_t i_rank = 0; i_rank < parallel::size(); ++i_rank) {
......@@ -470,6 +473,15 @@ VTKWriter::_write(const MeshType& mesh,
auto&& item_value) { return this->_write_cell_data(fout, name, item_value, serialize_data_list); },
item_value_variant);
}
if (parallel::size() > 1) {
CellValue<uint8_t> vtk_ghost_type{mesh.connectivity()};
auto cell_is_owned = mesh.connectivity().cellIsOwned();
parallel_for(
mesh.numberOfCells(),
PUGS_LAMBDA(const CellId cell_id) { vtk_ghost_type[cell_id] = cell_is_owned[cell_id] ? 0 : 1; });
_write_array(fout, "vtkGhostType", vtk_ghost_type.arrayView(), serialize_data_list);
}
fout << "</CellData>\n";
fout << "<PointData>\n";
for (const auto& [name, item_value_variant] : output_named_item_data_set) {
......@@ -659,7 +671,7 @@ VTKWriter::_write(const MeshType& mesh,
fout << "<?xml version=\"1.0\"?>\n";
fout << _getDateAndVersionComment();
fout << "<VTKFile type=\"Collection\" version=\"0.1\">\n";
fout << "<VTKFile type=\"Collection\" version=\"2.0\">\n";
fout << "<Collection>\n";
if (time.has_value()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment