]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix Assert indenting 6907/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 10 Jul 2018 13:11:24 +0000 (15:11 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 10 Jul 2018 14:03:16 +0000 (16:03 +0200)
examples/step-33/step-33.cc
source/distributed/tria.cc
source/grid/tria.cc
source/matrix_free/task_info.cc
tests/base/functions_08.cc
tests/base/geometry_info_7.cc
tests/fe/shapes.h

index 3cc345a8a965298ebfcd669616032a1c96e69699..78fd174f47ecabbb94da6d5b504d6bb63a59f3a9 100644 (file)
@@ -584,10 +584,13 @@ namespace Step33
            ExcInternalError());
 
     if (do_schlieren_plot == true)
-      Assert(computed_quantities[0].size() == dim + 2,
-             ExcInternalError()) else Assert(computed_quantities[0].size() ==
-                                               dim + 1,
-                                             ExcInternalError());
+      {
+        Assert(computed_quantities[0].size() == dim + 2, ExcInternalError());
+      }
+    else
+      {
+        Assert(computed_quantities[0].size() == dim + 1, ExcInternalError());
+      }
 
     // Then loop over all quadrature points and do our work there. The code
     // should be pretty self-explanatory. The order of output variables is
index a4430cd08e4a597111a1911f346109554845200a..143ad41e4066d687bd7e4fc55418f99c698dcc7c 100644 (file)
@@ -3272,13 +3272,17 @@ namespace parallel
         (void)total_local_cells;
 
         if (Utilities::MPI::n_mpi_processes(this->mpi_communicator) == 1)
-          Assert(
-            static_cast<unsigned int>(parallel_forest->local_num_quadrants) ==
-              total_local_cells,
-            ExcInternalError()) else Assert(static_cast<unsigned int>(parallel_forest
-                                                                        ->local_num_quadrants) <=
-                                              total_local_cells,
-                                            ExcInternalError());
+          {
+            Assert(static_cast<unsigned int>(
+                     parallel_forest->local_num_quadrants) == total_local_cells,
+                   ExcInternalError());
+          }
+        else
+          {
+            Assert(static_cast<unsigned int>(
+                     parallel_forest->local_num_quadrants) <= total_local_cells,
+                   ExcInternalError());
+          }
 
         // count the number of owned, active cells and compare with p4est.
         unsigned int n_owned = 0;
index 634de4fafb4cd849919f874ee7c9d7d1edac2bc7..c9b2e2bfd0c58675dcf8784e09fd1a6fcfbc3377 100644 (file)
@@ -2095,27 +2095,34 @@ namespace internal
             // in higher dimensions, this may happen but is not
             // implemented
             if (spacedim == 2)
-              AssertThrow((n_adj_cells >= 1) && (n_adj_cells <= 2), ExcInternalError()) else AssertThrow(
-                (n_adj_cells >= 1) && (n_adj_cells <= 2),
-                ExcMessage("You have a line in your triangulation "
-                           "at which more than two cells come together. "
-                           "\n\n"
-                           "This is not currently supported because the "
-                           "Triangulation class makes the assumption that "
-                           "every cell has zero or one neighbors behind "
-                           "each face (here, behind each line), but in your "
-                           "situation there would be more than one."
-                           "\n\n"
-                           "Support for this is not currently implemented. "
-                           "If you need to work with triangulations where "
-                           "more than two cells come together at a line, "
-                           "duplicate the vertices once per cell (i.e., put "
-                           "multiple vertices at the same physical location, "
-                           "but using different vertex indices for each) "
-                           "and then ensure continuity of the solution by "
-                           "explicitly creating constraints that the degrees "
-                           "of freedom at these lines have the same "
-                           "value, using the AffineConstraints class."));
+              {
+                AssertThrow((n_adj_cells >= 1) && (n_adj_cells <= 2),
+                            ExcInternalError());
+              }
+            else
+              {
+                AssertThrow(
+                  (n_adj_cells >= 1) && (n_adj_cells <= 2),
+                  ExcMessage("You have a line in your triangulation at which "
+                             "more than two cells come together. "
+                             "\n\n"
+                             "This is not currently supported because the "
+                             "Triangulation class makes the assumption that "
+                             "every cell has zero or one neighbors behind each "
+                             "face (here, behind each line), but in your "
+                             "situation there would be more than one."
+                             "\n\n"
+                             "Support for this is not currently implemented. "
+                             "If you need to work with triangulations where "
+                             "more than two cells come together at a line, "
+                             "duplicate the vertices once per cell (i.e., put "
+                             "multiple vertices at the same physical location, "
+                             "but using different vertex indices for each) "
+                             "and then ensure continuity of the solution by "
+                             "explicitly creating constraints that the degrees "
+                             "of freedom at these lines have the same "
+                             "value, using the AffineConstraints class."));
+              }
 
             // if only one cell: line is at boundary -> give it the boundary
             // indicator zero by default
index 36275e2c3c823101c4bf1cb11b1844421697a15b..3a563c668b9875c76e47ceee6734ec877e210b18 100644 (file)
@@ -952,10 +952,13 @@ namespace internal
             cell_partition_data.push_back(n_cells);
         }
       if (cell_vectorization_categories_strict == true)
-        Assert(n_cells >= n_macro_cells + n_ghost_slots,
-               ExcInternalError()) else AssertDimension(n_cells,
-                                                        n_macro_cells +
-                                                          n_ghost_slots);
+        {
+          Assert(n_cells >= n_macro_cells + n_ghost_slots, ExcInternalError());
+        }
+      else
+        {
+          AssertDimension(n_cells, n_macro_cells + n_ghost_slots);
+        }
       AssertDimension(cell_partition_data.back(), n_cells);
       AssertDimension(counter, n_active_cells + n_ghost_cells);
 
index 3dcd8c115517c10ee6f48e860f7fe69a15aca6b4..b9eb3f839a90fb6cced907c7d7d8298080429bd1 100644 (file)
@@ -53,18 +53,25 @@ check1()
 
       for (unsigned int c = 0; c < dim + 2; ++c)
         if (c == 0 || c == dim + 1)
-          AssertThrow(object.value(p, c) == 0,
-                      ExcInternalError()) else AssertThrow(object.value(p, c) ==
-                                                             p[c - 1],
-                                                           ExcInternalError());
+          {
+            AssertThrow(object.value(p, c) == 0, ExcInternalError());
+          }
+        else
+          {
+            AssertThrow(object.value(p, c) == p[c - 1], ExcInternalError());
+          }
 
       Vector<double> v(dim + 2);
       object.vector_value(p, v);
       for (unsigned int c = 0; c < dim + 2; ++c)
         if (c == 0 || c == dim + 1)
-          AssertThrow(v(c) == 0,
-                      ExcInternalError()) else AssertThrow(v(c) == p[c - 1],
-                                                           ExcInternalError());
+          {
+            AssertThrow(v(c) == 0, ExcInternalError());
+          }
+        else
+          {
+            AssertThrow(v(c) == p[c - 1], ExcInternalError());
+          }
     }
 
   deallog << "OK" << std::endl;
index 79ebeebdaad5d5a6ce3f2537aeedba44a897bc6c..2d8549d90c7cdd4c011b46c1fba86584f0066da9 100644 (file)
@@ -85,11 +85,15 @@ test()
             // other faces are
             // squashed
             if (f < 2)
-              AssertThrow(
-                alternating_forms[v].norm() == 1,
-                ExcInternalError()) else AssertThrow(alternating_forms[v]
-                                                         .norm() == 0.1,
-                                                     ExcInternalError());
+              {
+                AssertThrow(alternating_forms[v].norm() == 1,
+                            ExcInternalError());
+              }
+            else
+              {
+                AssertThrow(alternating_forms[v].norm() == 0.1,
+                            ExcInternalError());
+              }
           }
       }
   }
@@ -127,23 +131,20 @@ test()
             deallog << "Squashed+rotated cell: face " << f << ": "
                     << alternating_forms[v] << std::endl;
 
-            // in 2d and 3d, faces
-            // 0,1 should be
-            // unaffected (just like
-            // for the squashed cell,
-            // the rotation has
-            // nothing to do with
-            // face numbers though
-            // the direction of the
-            // alternating form
-            // vector would have
+            // in 2d and 3d, faces 0,1 should be unaffected (just like for the
+            // squashed cell, the rotation has nothing to do with face numbers
+            // though the direction of the alternating form vector would have
             // rotated along)
             if (f < 2)
-              AssertThrow(
-                alternating_forms[v].norm() == 1,
-                ExcInternalError()) else AssertThrow(alternating_forms[v]
-                                                         .norm() == 0.1,
-                                                     ExcInternalError());
+              {
+                AssertThrow(alternating_forms[v].norm() == 1,
+                            ExcInternalError());
+              }
+            else
+              {
+                AssertThrow(alternating_forms[v].norm() == 0.1,
+                            ExcInternalError());
+              }
           }
       }
   }
index a397776f18d7b9ebbbe4414070a7f2c9199c8124..f68fe13cf118c282763ec659c092de6f558911bb 100644 (file)
@@ -78,28 +78,24 @@ plot_shape_functions(Mapping<dim> &      mapping,
                   for (unsigned int c = 0; c < fe.get_fe().n_components(); ++c)
                     {
                       if (fe.get_fe().system_to_component_index(i).first == c)
-                        AssertThrow(
-                          (fe.shape_value(i, k) ==
-                           fe.shape_value_component(i, k, c)) &&
-                            (fe.shape_grad(i, k) ==
-                             fe.shape_grad_component(i, k, c)) &&
-                            (fe.shape_hessian(i, k) ==
-                             fe.shape_hessian_component(i, k, c)),
-                          ExcInternalError()) else AssertThrow((fe
-                                                                  .shape_value_component(
-                                                                    i, k, c) ==
-                                                                0) &&
-                                                                 (fe.shape_grad_component(
-                                                                    i, k, c) ==
-                                                                  Tensor<
-                                                                    1,
-                                                                    dim>()) &&
-                                                                 (fe.shape_hessian_component(
-                                                                    i, k, c) ==
-                                                                  Tensor<
-                                                                    2,
-                                                                    dim>()),
-                                                               ExcInternalError());
+                        {
+                          AssertThrow((fe.shape_value(i, k) ==
+                                         fe.shape_value_component(i, k, c) &&
+                                       fe.shape_grad(i, k) ==
+                                         fe.shape_grad_component(i, k, c) &&
+                                       fe.shape_hessian(i, k) ==
+                                         fe.shape_hessian_component(i, k, c)),
+                                      ExcInternalError());
+                        }
+                      else
+                        {
+                          AssertThrow((fe.shape_value_component(i, k, c) == 0 &&
+                                       fe.shape_grad_component(i, k, c) ==
+                                         Tensor<1, dim>() &&
+                                       fe.shape_hessian_component(i, k, c) ==
+                                         Tensor<2, dim>()),
+                                      ExcInternalError());
+                        }
                     };
                 }
               deallog << std::endl;

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.