]> https://gitweb.dealii.org/ - dealii.git/commitdiff
reorder checks
authorTimo Heister <timo.heister@gmail.com>
Sat, 10 Sep 2022 14:12:35 +0000 (10:12 -0400)
committerTimo Heister <timo.heister@gmail.com>
Tue, 13 Sep 2022 20:13:42 +0000 (16:13 -0400)
source/base/data_out_base.cc

index 12ae2678ff76f1f34cd63b029e6856ba666491b3..f73a608eebfce6dce5aac99aa5be8299e6a6edf3 100644 (file)
@@ -8180,7 +8180,8 @@ DataOutInterface<dim, spacedim>::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<dim, spacedim>::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:

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.