From: Wolfgang Bangerth Date: Wed, 3 Feb 2021 05:02:31 +0000 (-0700) Subject: Improve a few error messages. X-Git-Tag: v9.3.0-rc1~519^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b827f82668688c1ea150309e2114df78cde62eb;p=dealii.git Improve a few error messages. --- diff --git a/include/deal.II/meshworker/mesh_loop.h b/include/deal.II/meshworker/mesh_loop.h index f9a73ca29a..8f7df2acda 100644 --- a/include/deal.II/meshworker/mesh_loop.h +++ b/include/deal.II/meshworker/mesh_loop.h @@ -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,