From: Wolfgang Bangerth <bangerth@math.tamu.edu>
Date: Mon, 28 Mar 2016 16:08:19 +0000 (-0500)
Subject: Simplify the implementation of a function.
X-Git-Tag: v8.5.0-rc1~1157^2
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2429%2Fhead;p=dealii.git

Simplify the implementation of a function.

Also improve the error message.
---

diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc
index f8452f9d97..0d109b0988 100644
--- a/source/fe/mapping_q_generic.cc
+++ b/source/fe/mapping_q_generic.cc
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2000 - 2015 by the deal.II authors
+// Copyright (C) 2000 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -2614,12 +2614,16 @@ fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
                   }
                 else
                   {
-                    const unsigned int codim = spacedim-dim;
-                    (void)codim;
-
                     if (update_flags & update_normal_vectors)
                       {
-                        Assert( codim==1 , ExcMessage("There is no cell normal in codim 2."));
+                        Assert(spacedim == dim+1,
+                               ExcMessage("There is no (unique) cell normal for "
+                                          + Utilities::int_to_string(dim) +
+                                          "-dimensional cells in "
+                                          + Utilities::int_to_string(spacedim) +
+                                          "-dimensional space. This only works if the "
+                                          "space dimension is one greater than the "
+                                          "dimensionality of the mesh cells."));
 
                         if (dim==1)
                           output_data.normal_vectors[point] =