]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve a few error messages. 11666/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 3 Feb 2021 05:02:31 +0000 (22:02 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 3 Feb 2021 05:02:31 +0000 (22:02 -0700)
include/deal.II/meshworker/mesh_loop.h

index f9a73ca29a66cbdca01de439dce38cfb581f706a..8f7df2acda0f9e81af5bea23468ddd64060d5366 100644 (file)
@@ -345,35 +345,54 @@ namespace MeshWorker
     Assert(
       (!cell_worker) == !(flags & work_on_cells),
       ExcMessage(
-        "If you specify a cell_worker, you need to set assemble_own_cells or assemble_ghost_cells."));
-
-    Assert(
-      (flags &
-       (assemble_own_interior_faces_once | assemble_own_interior_faces_both)) !=
-        (assemble_own_interior_faces_once | assemble_own_interior_faces_both),
-      ExcMessage(
-        "You can only specify assemble_own_interior_faces_once OR assemble_own_interior_faces_both."));
-
-    Assert(
-      (flags & (assemble_ghost_faces_once | assemble_ghost_faces_both)) !=
-        (assemble_ghost_faces_once | assemble_ghost_faces_both),
-      ExcMessage(
-        "You can only specify assemble_ghost_faces_once OR assemble_ghost_faces_both."));
+        "If you provide a cell worker function, you also need to request "
+        "that work should be done on cells by setting the 'work_on_cells' flag. "
+        "Conversely, if you don't provide a cell worker function, you "
+        "cannot set the 'work_on_cells' flag. One of these two "
+        "conditions is not satisfied."));
+
+    Assert((flags & (assemble_own_interior_faces_once |
+                     assemble_own_interior_faces_both)) !=
+             (assemble_own_interior_faces_once |
+              assemble_own_interior_faces_both),
+           ExcMessage(
+             "If you provide a face worker function, you also need to request "
+             "that work should be done on interior faces by setting either the "
+             "'assemble_own_interior_faces_once' flag or the "
+             "'assemble_own_interior_faces_both' flag. "
+             "Conversely, if you don't provide a face worker function, you "
+             "cannot set either of these two flags. One of these two "
+             "conditions is not satisfied."));
+
+    Assert((flags & (assemble_ghost_faces_once | assemble_ghost_faces_both)) !=
+             (assemble_ghost_faces_once | assemble_ghost_faces_both),
+           ExcMessage(
+             "You can only 'specify assemble_ghost_faces_once' "
+             "OR 'assemble_ghost_faces_both', but not both of these flags."));
 
     Assert(
       !(flags & cells_after_faces) ||
         (flags & (assemble_own_cells | assemble_ghost_cells)),
       ExcMessage(
-        "The option cells_after_faces only makes sense if you assemble on cells."));
+        "The option 'cells_after_faces' only makes sense if you assemble on cells."));
 
-    Assert((!face_worker) == !(flags & work_on_faces),
-           ExcMessage(
-             "If you specify a face_worker, assemble_face_* needs to be set."));
+    Assert(
+      (!face_worker) == !(flags & work_on_faces),
+      ExcMessage(
+        "If you provide a face worker function, you also need to request "
+        "that work should be done on faces by setting the 'work_on_faces' flag. "
+        "Conversely, if you don't provide a face worker function, you "
+        "cannot set the 'work_on_faces' flag. One of these two "
+        "conditions is not satisfied."));
 
     Assert(
       (!boundary_worker) == !(flags & assemble_boundary_faces),
       ExcMessage(
-        "If you specify a boundary_worker, assemble_boundary_faces needs to be set."));
+        "If you provide a boundary face worker function, you also need to request "
+        "that work should be done on boundary faces by setting the 'assemble_boundary_faces' flag. "
+        "Conversely, if you don't provide a boundary face worker function, you "
+        "cannot set the 'assemble_boundary_faces' flag. One of these two "
+        "conditions is not satisfied."));
 
     auto cell_action = [&](const CellIteratorBaseType &cell,
                            ScratchData &               scratch,

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.