From 29eedebb3e48245d2d95770eb3ef12b4d0490149 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sun, 11 Mar 2012 16:24:14 +0000 Subject: [PATCH] Fix an erroneous assertion. I'm mystified how this could possibly have worked before. git-svn-id: https://svn.dealii.org/trunk@25253 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/numerics/vectors.templates.h | 8 ++- tests/deal.II/no_flux_09/cmp/generic | 65 ++++++------------- 2 files changed, 25 insertions(+), 48 deletions(-) diff --git a/deal.II/include/deal.II/numerics/vectors.templates.h b/deal.II/include/deal.II/numerics/vectors.templates.h index df2bfefa4f..2ac8994838 100644 --- a/deal.II/include/deal.II/numerics/vectors.templates.h +++ b/deal.II/include/deal.II/numerics/vectors.templates.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors +// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -2568,7 +2568,11 @@ namespace VectorTools tmp[2] *= -1; } - Assert (std::fabs(vector * tmp) < 1e-12, + // make sure the two vectors + // are indeed not collinear + Assert (std::fabs(vector * tmp / vector.norm() / tmp.norm()) + < + (1-1e-12), ExcInternalError()); // now compute the diff --git a/tests/deal.II/no_flux_09/cmp/generic b/tests/deal.II/no_flux_09/cmp/generic index b77282acb6..1ac20abe9d 100644 --- a/tests/deal.II/no_flux_09/cmp/generic +++ b/tests/deal.II/no_flux_09/cmp/generic @@ -1,49 +1,22 @@ - 0 = 0 - 1 = 0 - 3 2: 0.7265 - 4 = 0 + 2 = 0 5 = 0 - 7 6: 0.7265 - 8 9: 0.3249 - 10 11: 0.3249 - 12 13: -0.3249 - 14 15: -0.3249 - 17 16: -0.7265 - 19 18: -0.7265 - 20 = 0 - 21 = 0 - 22 = 0 - 23 = 0 - 0 = 0 - 2 1: -1.0000 - 3 = 0 - 5 4: -1.0000 - 6 7: -0.5273 - 6 8: 0.5273 - 9 10: 0.5273 - 9 11: 0.5273 - 12 = 0 - 14 13: -1.0000 - 15 = 0 - 17 16: -1.0000 - 18 19: -0.5273 - 18 20: 0.5273 - 21 22: 0.5273 - 21 23: 0.5273 - 24 = 0 - 26 25: -1.0000 + 8 = 0 + 7 6: -0.4142 + 11 9: 1.0000 + 11 10: 1.0000 + 19 18: -0.4889 + 19 20: -0.9881 + 22 21: -1.0000 + 22 23: -0.8648 + 25 = 0 + 26 = 0 27 = 0 - 29 28: -1.0000 - 30 31: -0.5273 - 30 32: -0.5273 - 33 34: -0.5273 - 33 35: -0.5273 - 36 = 0 - 38 37: -1.0000 - 39 40: 0.5273 - 39 41: -0.5273 - 42 = 0 - 44 43: -1.0000 - 45 46: 0.5273 - 45 47: -0.5273 + 28 = 0 + 29 = 0 + 31 = 0 + 34 = 0 + 35 33: -1.0000 + 37 = 0 + 40 = 0 + 41 39: -0.4142 -- 2.39.5