]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use "#ifdef DEBUG" for complex asserts.
authorDavid Wells <drwells@vt.edu>
Sat, 11 Apr 2015 12:45:45 +0000 (08:45 -0400)
committerMatthias Maier <matthias.maier@iwr.uni-heidelberg.de>
Tue, 14 Apr 2015 10:50:19 +0000 (12:50 +0200)
This avoids writing a lot of (void)s.

source/grid/grid_reordering.cc
source/opencascade/boundary_lib.cc

index a440c6dd4c852431553a9a1997d4dec868feee9c..f13019301e7e23a8885e45b80c482a48f6f3ccd2 100644 (file)
@@ -974,6 +974,7 @@ namespace internal
     Mesh::sanity_check_node (const Cell         &c,
                              const unsigned int local_node_num) const
     {
+#ifdef DEBUG
       // check that every edge
       // coming into a node has the
       // same node value
@@ -1009,6 +1010,10 @@ namespace internal
                edge_list[ge2].nodes[or2 == forward_edge ? 0 : 1]),
               ExcMessage ("This message does not satisfy the internal "
                           "consistency check"));
+#else
+      (void)c;
+      (void)local_node_num;
+#endif
     }
 
 
index 810ce32c5303a1530609c0b7a266c6de968f7774..aeebc80e8d61876832998d7bc1fc05621b1f5316 100644 (file)
@@ -235,11 +235,15 @@ namespace OpenCASCADE
   Point<1>
   ArclengthProjectionLineManifold<dim,spacedim>::pull_back(const Point<spacedim> &space_point) const
   {
+    double t (0.0);
+#ifdef DEBUG
     ShapeAnalysis_Curve curve_analysis;
     gp_Pnt proj;
-    double t;
-    double dist = curve_analysis.Project(curve->GetCurve(), point(space_point), tolerance, proj, t, true);
-    Assert(dist < tolerance*length, ExcPointNotOnManifold(space_point));
+    Assert(curve_analysis.Project(curve->GetCurve(), point(space_point), tolerance, proj, t, true)
+           < tolerance*length, ExcPointNotOnManifold(space_point));
+#else
+    (void)space_point;
+#endif
     return Point<1>(GCPnts_AbscissaPoint::Length(curve->GetCurve(),curve->GetCurve().FirstParameter(),t));
   }
 

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.