From: Wolfgang Bangerth Date: Fri, 27 Feb 2015 14:33:00 +0000 (-0600) Subject: Significantly improve another exception that currently does not print any text. X-Git-Tag: v8.3.0-rc1~407^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22da1072c300839496a2a5eb13d1e357bf8fc867;p=dealii.git Significantly improve another exception that currently does not print any text. --- 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());