From: Timo Heister Date: Sun, 18 Sep 2022 19:23:09 +0000 (-0400) Subject: DataOutFilter::n_cells 0 X-Git-Tag: v9.5.0-rc1~938^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d67fca0dfc39182b8395ce6d8ff161809b1347c;p=dealii.git DataOutFilter::n_cells 0 n_cells() now returns 0 instead of invalid_unsigned_int --- diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 3debbf2dbe..6108f64768 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -384,7 +384,7 @@ namespace DataOutBase DataOutFilter::DataOutFilter() : flags(false, true) , node_dim(numbers::invalid_unsigned_int) - , num_cells(numbers::invalid_unsigned_int) + , num_cells(0) {} @@ -392,7 +392,7 @@ namespace DataOutBase DataOutFilter::DataOutFilter(const DataOutBase::DataOutFilterFlags &flags) : flags(flags) , node_dim(numbers::invalid_unsigned_int) - , num_cells(numbers::invalid_unsigned_int) + , num_cells(0) {} @@ -8200,9 +8200,7 @@ DataOutInterface::create_xdmf_entry( std::uint64_t local_node_cell_count[2], global_node_cell_count[2]; local_node_cell_count[0] = data_filter.n_nodes(); - // n_cells returns an invalid unsigned int if the object is empty: - local_node_cell_count[1] = - (data_filter.n_nodes() > 0) ? data_filter.n_cells() : 0; + local_node_cell_count[1] = data_filter.n_cells(); const int myrank = Utilities::MPI::this_mpi_process(comm); // And compute the global total diff --git a/tests/data_out/data_out_hdf5_03.with_hdf5=true.with_p4est=true.mpirun=2.output b/tests/data_out/data_out_hdf5_03.with_hdf5=true.with_p4est=true.mpirun=2.output index 001e715fdb..5cdd66edd4 100644 --- a/tests/data_out/data_out_hdf5_03.with_hdf5=true.with_p4est=true.mpirun=2.output +++ b/tests/data_out/data_out_hdf5_03.with_hdf5=true.with_p4est=true.mpirun=2.output @@ -58,6 +58,6 @@ DEAL:0::n_cells on my rank: 8 DEAL:0::ok -DEAL:1::n_cells on my rank: 4294967295 -DEAL:1::n_cells on my rank: 4294967295 +DEAL:1::n_cells on my rank: 0 +DEAL:1::n_cells on my rank: 0 diff --git a/tests/data_out/data_out_hdf5_03.with_hdf5=true.with_p4est=true.mpirun=3.output b/tests/data_out/data_out_hdf5_03.with_hdf5=true.with_p4est=true.mpirun=3.output index 807a068c37..8e26788a16 100644 --- a/tests/data_out/data_out_hdf5_03.with_hdf5=true.with_p4est=true.mpirun=3.output +++ b/tests/data_out/data_out_hdf5_03.with_hdf5=true.with_p4est=true.mpirun=3.output @@ -1,5 +1,5 @@ -DEAL:0::n_cells on my rank: 4294967295 +DEAL:0::n_cells on my rank: 0 @@ -28,7 +28,7 @@ DEAL:0::n_cells on my rank: 4294967295 DEAL:0::ok -DEAL:0::n_cells on my rank: 4294967295 +DEAL:0::n_cells on my rank: 0 @@ -58,10 +58,10 @@ DEAL:0::n_cells on my rank: 4294967295 DEAL:0::ok -DEAL:1::n_cells on my rank: 4294967295 +DEAL:1::n_cells on my rank: 0 DEAL:1::n_cells on my rank: 8 DEAL:2::n_cells on my rank: 4 -DEAL:2::n_cells on my rank: 4294967295 +DEAL:2::n_cells on my rank: 0