From 6d178541ac4e011623cae58ade3b5f165bcb8378 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sat, 10 Sep 2022 10:12:35 -0400 Subject: [PATCH] reorder checks --- source/base/data_out_base.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 12ae2678ff..f73a608eeb 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -8180,7 +8180,8 @@ DataOutInterface::create_xdmf_entry( const double cur_time, const MPI_Comm & comm) const { - std::uint64_t local_node_cell_count[2], global_node_cell_count[2]; + AssertThrow(spacedim == 2 || spacedim == 3, + ExcMessage("XDMF only supports 2 or 3 space dimensions.")); #ifndef DEAL_II_WITH_HDF5 // throw an exception, but first make sure the compiler does not warn about @@ -8192,8 +8193,8 @@ DataOutInterface::create_xdmf_entry( (void)comm; AssertThrow(false, ExcMessage("XDMF support requires HDF5 to be turned on.")); #endif - AssertThrow(spacedim == 2 || spacedim == 3, - ExcMessage("XDMF only supports 2 or 3 space dimensions.")); + + 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: -- 2.39.5