]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add two assertions we had apparently forgotten previously. 1028/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 19 Jun 2015 16:15:28 +0000 (11:15 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 19 Jun 2015 16:15:28 +0000 (11:15 -0500)
The functions refining meshes in parallel get vectors with as many elements
as there are active cells in the triangulation on this processor. Verify
that this so.

source/distributed/grid_refinement.cc

index 1ee88da7df067cd78ec406d54d96e3f471f97d8a..714f25596276e483a3293b9278f1fb89da546db1 100644 (file)
@@ -547,6 +547,8 @@ namespace parallel
         const double                 bottom_fraction_of_cells,
         const unsigned int           max_n_cells)
       {
+        Assert (criteria.size() == tria.n_active_cells(),
+                ExcDimensionMismatch (criteria.size(), tria.n_active_cells()));
         Assert ((top_fraction_of_cells>=0) && (top_fraction_of_cells<=1),
                 dealii::GridRefinement::ExcInvalidParameterValue());
         Assert ((bottom_fraction_of_cells>=0) && (bottom_fraction_of_cells<=1),
@@ -664,6 +666,8 @@ namespace parallel
         const double                top_fraction_of_error,
         const double                bottom_fraction_of_error)
       {
+        Assert (criteria.size() == tria.n_active_cells(),
+                ExcDimensionMismatch (criteria.size(), tria.n_active_cells()));
         Assert ((top_fraction_of_error>=0) && (top_fraction_of_error<=1),
                 dealii::GridRefinement::ExcInvalidParameterValue());
         Assert ((bottom_fraction_of_error>=0) && (bottom_fraction_of_error<=1),

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.