From: Daniel Arndt Date: Tue, 10 Jul 2018 13:11:24 +0000 (+0200) Subject: Fix Assert indenting X-Git-Tag: v9.1.0-rc1~930^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6907%2Fhead;p=dealii.git Fix Assert indenting --- diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index 3cc345a8a9..78fd174f47 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -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 diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index a4430cd08e..143ad41e40 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -3272,13 +3272,17 @@ namespace parallel (void)total_local_cells; if (Utilities::MPI::n_mpi_processes(this->mpi_communicator) == 1) - Assert( - static_cast(parallel_forest->local_num_quadrants) == - total_local_cells, - ExcInternalError()) else Assert(static_cast(parallel_forest - ->local_num_quadrants) <= - total_local_cells, - ExcInternalError()); + { + Assert(static_cast( + parallel_forest->local_num_quadrants) == total_local_cells, + ExcInternalError()); + } + else + { + Assert(static_cast( + 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; diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 634de4fafb..c9b2e2bfd0 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -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 diff --git a/source/matrix_free/task_info.cc b/source/matrix_free/task_info.cc index 36275e2c3c..3a563c668b 100644 --- a/source/matrix_free/task_info.cc +++ b/source/matrix_free/task_info.cc @@ -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); diff --git a/tests/base/functions_08.cc b/tests/base/functions_08.cc index 3dcd8c1155..b9eb3f839a 100644 --- a/tests/base/functions_08.cc +++ b/tests/base/functions_08.cc @@ -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 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; diff --git a/tests/base/geometry_info_7.cc b/tests/base/geometry_info_7.cc index 79ebeebdaa..2d8549d90c 100644 --- a/tests/base/geometry_info_7.cc +++ b/tests/base/geometry_info_7.cc @@ -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()); + } } } } diff --git a/tests/fe/shapes.h b/tests/fe/shapes.h index a397776f18..f68fe13cf1 100644 --- a/tests/fe/shapes.h +++ b/tests/fe/shapes.h @@ -78,28 +78,24 @@ plot_shape_functions(Mapping & 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;