[Dune-devel] epsilon in test-(affine, multilinear)geometry.cc for 32 bit

Christoph GrĂ¼ninger christoph.grueninger at iws.uni-stuttgart.de
Sun Dec 22 23:07:52 CET 2013


Hi dune,
while testing dune-geometry on a VirtualBox which is in my 
case a 32-bit guest
openSuse 13.2. Can someone confirm these failures on 32 bit 
systems?

An example of an error:

>>> Checking geometry (topologyId = 0, mydim = 3, cdim = 3)
>>> Checking reference mapping
>>> passed
>>> Checking scaled reference mapping
Error: Wrong volume (12348, should be 12348).

It turned out that the error is 1e-12 and epsilon is 1e-14. 
This seems kind of
harsh to me, so I suppose the changes attached below. Maybe 
there is a more
sophisticated patch.

Bye
Christoph


diff --git a/dune/geometry/test/test-affinegeometry.cc 
b/dune/geometry/test/test-affinegeometry.cc
index 2fb5d27..5669a28 100644
--- a/dune/geometry/test/test-affinegeometry.cc
+++ b/dune/geometry/test/test-affinegeometry.cc
@@ -42,7 +42,7 @@ static bool testAffineGeometry ( const 
Dune::ReferenceElement< ctype, mydim > &r
    typedef Dune::AffineGeometry< ctype, mydim, cdim > 
Geometry;
  
    const Dune::FieldVector< ctype, mydim > &localCenter = 
refElement.position( 0, 0 );
-  const ctype epsilon = ctype( 256 )*std::numeric_limits< 
ctype >::epsilon();
+  const ctype epsilon = ctype( 1e5 )*std::numeric_limits< 
ctype >::epsilon();
  
    const ctype detA = A.determinant();
    assert( std::abs( std::abs( B.determinant() ) - ctype( 1 ) 
) <= epsilon );
diff --git a/dune/geometry/test/test-multilineargeometry.cc 
b/dune/geometry/test/test-multilineargeometry.cc
index a68dbd6..3b45b68 100644
--- a/dune/geometry/test/test-multilineargeometry.cc
+++ b/dune/geometry/test/test-multilineargeometry.cc
@@ -42,7 +42,7 @@ static bool testMultiLinearGeometry ( const 
Dune::ReferenceElement< ctype, mydim
    typedef Dune::MultiLinearGeometry< ctype, mydim, cdim > 
Geometry;
  
    const Dune::FieldVector< ctype, mydim > &localCenter = 
refElement.position( 0, 0 );
-  const ctype epsilon = ctype( 256 )*std::numeric_limits< 
ctype >::epsilon();
+  const ctype epsilon = ctype( 1e5 )*std::numeric_limits< 
ctype >::epsilon();
  
    const ctype detA = A.determinant();
    assert( std::abs( std::abs( B.determinant() ) - ctype( 1 ) 
) <= epsilon );




More information about the Dune-devel mailing list