]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move an exception to the top of a function. 11665/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 3 Feb 2021 05:00:07 +0000 (22:00 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 3 Feb 2021 05:00:58 +0000 (22:00 -0700)
source/distributed/tria.cc

index b0d447cf9f1dd65321a235e9eda13587c6b0252c..65d4bd03ed941ff516348f4d5dcbd64cf21769ba 100644 (file)
@@ -3213,6 +3213,11 @@ namespace parallel
     Triangulation<dim, spacedim>::copy_triangulation(
       const dealii::Triangulation<dim, spacedim> &other_tria)
     {
+      Assert(other_tria.n_levels() == 1,
+             ExcMessage(
+               "Parallel distributed triangulations can only be copied, "
+               "if they are not refined!"));
+
       try
         {
           dealii::parallel::TriangulationBase<dim, spacedim>::
@@ -3232,11 +3237,6 @@ namespace parallel
       // separate)
       triangulation_has_content = true;
 
-      Assert(other_tria.n_levels() == 1,
-             ExcMessage(
-               "Parallel distributed triangulations can only be copied, "
-               "if they are not refined!"));
-
       if (const dealii::parallel::distributed::Triangulation<dim, spacedim>
             *other_tria_x =
               dynamic_cast<const dealii::parallel::distributed::

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.