From 8acafcb357e87139421977495d5a5174ce078a7f Mon Sep 17 00:00:00 2001 From: David Wells Date: Sun, 5 Mar 2017 17:56:44 -0500 Subject: [PATCH] Use Assert, not AssertThrow, with ExcInternalError. --- include/deal.II/base/symmetric_tensor.h | 4 ++-- .../deal.II/lac/swappable_vector.templates.h | 3 ++- source/distributed/shared_tria.cc | 2 +- source/distributed/tria.cc | 22 +++++++++---------- source/dofs/dof_tools_constraints.cc | 2 +- source/fe/fe_q_bubbles.cc | 2 +- source/grid/grid_generator.cc | 2 +- source/grid/grid_in.cc | 4 ++-- source/grid/grid_tools.cc | 4 ++-- source/grid/tria.cc | 2 +- source/lac/lapack_full_matrix.cc | 10 ++++----- 11 files changed, 29 insertions(+), 28 deletions(-) diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index 90285b84f8..b4a3d9f038 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -1909,7 +1909,7 @@ namespace internal return dim+c; // should never get here: - AssertThrow(false, ExcInternalError()); + Assert(false, ExcInternalError()); return 0; } } @@ -2011,7 +2011,7 @@ namespace internal return TableIndices<2>(d,e); // should never get here: - AssertThrow(false, ExcInternalError()); + Assert(false, ExcInternalError()); return TableIndices<2>(0, 0); } } diff --git a/include/deal.II/lac/swappable_vector.templates.h b/include/deal.II/lac/swappable_vector.templates.h index de3706ed4e..230ef2fa0c 100644 --- a/include/deal.II/lac/swappable_vector.templates.h +++ b/include/deal.II/lac/swappable_vector.templates.h @@ -223,7 +223,8 @@ void SwappableVector::kill_file () if (filename != "") { int status = std::remove (filename.c_str()); - AssertThrow (status == 0, ExcInternalError()); + (void)status; + Assert (status == 0, ExcInternalError()); filename = ""; }; diff --git a/source/distributed/shared_tria.cc b/source/distributed/shared_tria.cc index 24d602b7c4..e95e085eaa 100644 --- a/source/distributed/shared_tria.cc +++ b/source/distributed/shared_tria.cc @@ -138,7 +138,7 @@ namespace parallel { // the underlying triangulation should not be checking for distorted // cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } partition(); this->update_number_cache (); diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index 3e175ffdb4..4a768825e9 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -882,7 +882,7 @@ namespace break; } default: - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } } } @@ -1335,7 +1335,7 @@ namespace parallel { // the underlying triangulation should not be checking for distorted // cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } // note that now we have some content in the p4est objects and call the @@ -1355,7 +1355,7 @@ namespace parallel { // the underlying triangulation should not be checking for distorted // cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } this->update_number_cache (); @@ -1884,7 +1884,7 @@ namespace parallel // triangulation should not // be checking for // distorted cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } this->update_number_cache (); @@ -2568,7 +2568,7 @@ namespace parallel { // the underlying triangulation should not be checking for // distorted cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } refinement_in_progress = saved_refinement_in_progress; @@ -2689,7 +2689,7 @@ namespace parallel { // the underlying triangulation should not be checking for // distorted cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } refinement_in_progress = saved_refinement_in_progress; @@ -2986,7 +2986,7 @@ namespace parallel { // the underlying triangulation should not be checking for distorted // cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } #ifdef DEBUG @@ -3102,7 +3102,7 @@ namespace parallel { // the underlying triangulation should not be checking for distorted // cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } refinement_in_progress = false; @@ -3657,7 +3657,7 @@ namespace parallel { // the underlying triangulation should not be checking for distorted // cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } //finally call the base class for storing the periodicity information @@ -3714,7 +3714,7 @@ namespace parallel { // the underlying triangulation should not be checking for distorted // cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } // note that now we have some content in the p4est objects and call the @@ -3755,7 +3755,7 @@ namespace parallel { // the underlying triangulation should not be checking for distorted // cells - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } this->update_number_cache (); diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 40ce9bad4f..b90da05fc6 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -1039,7 +1039,7 @@ namespace DoFTools const dealii::hp::FECollection * get_fe_collection (const dealii::DoFHandler &) { - AssertThrow(false, ExcInternalError()); + Assert(false, ExcInternalError()); return NULL; } } diff --git a/source/fe/fe_q_bubbles.cc b/source/fe/fe_q_bubbles.cc index 164864032e..a3ca46d7d3 100644 --- a/source/fe/fe_q_bubbles.cc +++ b/source/fe/fe_q_bubbles.cc @@ -74,7 +74,7 @@ namespace FE_Q_Bubbles_Helper q_fine.reset(new QGauss (degree+1)); break; default: - AssertThrow(false, ExcInternalError()); + Assert(false, ExcInternalError()); } Assert(q_fine.get() != NULL, ExcInternalError()); diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 6e4b71bbe0..663bfacb52 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -329,7 +329,7 @@ namespace GridGenerator cell->face(f)->line(j)->set_boundary_id(1); } else - AssertThrow (false, ExcInternalError()); + Assert (false, ExcInternalError()); } } diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index 2c9e44725b..c435304ada 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -1777,7 +1777,7 @@ void GridIn<2>::read_netcdf (const std::string &filename) vertex_indices_var->get(&*vertex_indices.begin(), n_bquads, vertices_per_quad); for (unsigned int i=0; i=0, ExcInternalError()); + Assert(vertex_indices[i]>=0, ExcInternalError()); if (output) { @@ -1948,7 +1948,7 @@ void GridIn<3>::read_netcdf (const std::string &filename) vertex_indices_var->get(&*vertex_indices.begin(), n_cells, vertices_per_hex); for (unsigned int i=0; i=0, ExcInternalError()); + Assert(vertex_indices[i]>=0, ExcInternalError()); if (output) { diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 0720ae3360..6c0467c0c5 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -3530,7 +3530,7 @@ next_cell: if (matching == m_tff) return 1; // [true ,false,false] static const MATCH_T m_ttf = {{ 1 , 0 }}; if (matching == m_ttf) return 3; // [true ,true ,false] - AssertThrow(false, ExcInternalError()); + Assert(false, ExcInternalError()); // what follows is dead code, but it avoids warnings about the lack // of a return value return 0; @@ -3563,7 +3563,7 @@ next_cell: if (matching == m_ftf) return 2; // [false,true ,false] static const MATCH_T m_ftt = {{ 1 , 0 , 3 , 2 }}; if (matching == m_ftt) return 6; // [false,true ,true ] - AssertThrow(false, ExcInternalError()); + Assert(false, ExcInternalError()); // what follows is dead code, but it avoids warnings about the lack // of a return value return 0; diff --git a/source/grid/tria.cc b/source/grid/tria.cc index c3800c2b8c..6a5ac44105 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -1689,7 +1689,7 @@ namespace internal default: // in 1d, a node must have one or two adjacent lines if (spacedim==1) - AssertThrow (false, ExcInternalError()) + Assert (false, ExcInternalError()) else AssertThrow (false, ExcMessage ("You have a vertex in your triangulation " diff --git a/source/lac/lapack_full_matrix.cc b/source/lac/lapack_full_matrix.cc index e07aca8e11..29029c4ddc 100644 --- a/source/lac/lapack_full_matrix.cc +++ b/source/lac/lapack_full_matrix.cc @@ -468,7 +468,7 @@ LAPACKFullMatrix::compute_lu_factorization() int info = 0; getrf(&mm, &nn, values, &mm, &ipiv[0], &info); - AssertThrow(info >= 0, ExcInternalError()); + Assert(info >= 0, ExcInternalError()); AssertThrow(info == 0, LACExceptions::ExcSingular()); state = lu; @@ -559,14 +559,14 @@ LAPACKFullMatrix::invert() { getrf(&mm, &nn, values, &mm, &ipiv[0], &info); - AssertThrow(info >= 0, ExcInternalError()); + Assert(info >= 0, ExcInternalError()); AssertThrow(info == 0, LACExceptions::ExcSingular()); } inv_work.resize (mm); getri(&mm, values, &mm, &ipiv[0], &inv_work[0], &mm, &info); - AssertThrow(info >= 0, ExcInternalError()); + Assert(info >= 0, ExcInternalError()); AssertThrow(info == 0, LACExceptions::ExcSingular()); state = inverse_matrix; @@ -591,7 +591,7 @@ LAPACKFullMatrix::apply_lu_factorization(Vector &v, getrs(trans, &nn, &one, values, &nn, &ipiv[0], v.begin(), &nn, &info); - AssertThrow(info == 0, ExcInternalError()); + Assert(info == 0, ExcInternalError()); } @@ -613,7 +613,7 @@ LAPACKFullMatrix::apply_lu_factorization(LAPACKFullMatrix &B, getrs(trans, &nn, &kk, values, &nn, &ipiv[0], &B.values[0], &nn, &info); - AssertThrow(info == 0, ExcInternalError()); + Assert(info == 0, ExcInternalError()); } -- 2.39.5