From 22da1072c300839496a2a5eb13d1e357bf8fc867 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 27 Feb 2015 08:33:00 -0600 Subject: [PATCH] Significantly improve another exception that currently does not print any text. --- include/deal.II/grid/tria.h | 7 ++++++- source/grid/tria.cc | 14 +++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index b2198320a2..8080d6d276 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -2785,7 +2785,12 @@ public: * * @ingroup Exceptions */ - DeclException0 (ExcTriangulationNotEmpty); + DeclException2 (ExcTriangulationNotEmpty, + int, int, + << "You are trying to perform an operation on a triangulation " + << "that is only allowed if the triangulation is currently empty. " + << "However, it currently stores " << arg1 << " vertices and has " + << "cells on " << arg2 << " levels."); /** * Trying to re-read a grid, an error occurred. * diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 1ad9b0a2b8..ee06cbaa4e 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -8767,7 +8767,7 @@ template void Triangulation::set_mesh_smoothing(const MeshSmoothing mesh_smoothing) { - Assert (n_levels() == 0, ExcTriangulationNotEmpty ()); + Assert (n_levels() == 0, ExcTriangulationNotEmpty (vertices.size(), levels.size())); smooth_grid=mesh_smoothing; } @@ -8932,9 +8932,9 @@ void Triangulation:: copy_triangulation (const Triangulation &old_tria) { - Assert (vertices.size() == 0, ExcTriangulationNotEmpty()); - Assert (levels.size () == 0, ExcTriangulationNotEmpty()); - Assert (faces == NULL, ExcTriangulationNotEmpty()); + Assert (vertices.size() == 0, ExcTriangulationNotEmpty(vertices.size(), levels.size())); + Assert (levels.size () == 0, ExcTriangulationNotEmpty(vertices.size(), levels.size())); + Assert (faces == NULL, ExcTriangulationNotEmpty(vertices.size(), levels.size())); Assert (old_tria.levels.size() != 0, ExcInternalError()); Assert (old_tria.vertices.size() != 0, ExcInternalError()); @@ -9015,9 +9015,9 @@ create_triangulation (const std::vector > &v, const std::vector > &cells, const SubCellData &subcelldata) { - Assert (vertices.size() == 0, ExcTriangulationNotEmpty()); - Assert (levels.size() == 0, ExcTriangulationNotEmpty()); - Assert (faces == NULL, ExcTriangulationNotEmpty()); + Assert (vertices.size() == 0, ExcTriangulationNotEmpty(vertices.size(), levels.size())); + Assert (levels.size() == 0, ExcTriangulationNotEmpty(vertices.size(), levels.size())); + Assert (faces == NULL, ExcTriangulationNotEmpty(vertices.size(), levels.size())); // check that no forbidden arrays // are used Assert (subcelldata.check_consistency(dim), ExcInternalError()); -- 2.39.5