]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Significantly improve another exception that currently does not print any text.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 27 Feb 2015 14:33:00 +0000 (08:33 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 27 Feb 2015 14:33:00 +0000 (08:33 -0600)
include/deal.II/grid/tria.h
source/grid/tria.cc

index b2198320a24896c0ab92ea8406c1122141b79f3d..8080d6d276ae3c0e194e66332cc0b7e84e3519fb 100644 (file)
@@ -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.
    *
index 1ad9b0a2b808a955f4cbaff2e42d496261ff004a..ee06cbaa4e7ea500912d1c0548c783a2c855d06f 100644 (file)
@@ -8767,7 +8767,7 @@ template <int dim, int spacedim>
 void
 Triangulation<dim, spacedim>::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<dim, spacedim>::
 copy_triangulation (const Triangulation<dim, spacedim> &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<Point<spacedim> >    &v,
                       const std::vector<CellData<dim> > &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());

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.