Skip to content
Snippets Groups Projects
Commit 6d2c1ac6 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

factorEpsilon = 10 instead 10 in the code and subIndexCheck modified.

[[Imported from SVN: r1630]]
parent 6ba29915
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,9 @@
#include <limits>
// machine epsilon is multiplied by this factor
static double factorEpsilon = 10.0;
class CheckError : public Dune::Exception {};
// --- compile-time check of element-interface
......@@ -401,7 +404,10 @@ struct subIndexCheck
const int imax = e.template count<cd>();
for (int i=0; i<imax; ++i)
{
assert( e.template entity<cd>(i)->index() == e.template subIndex<cd>(i) );
if( (e.template entity<cd>(i)->index() != e.template subIndex<cd>(i) ) &&
(e.template entity<cd>(i)->globalIndex() != e.template subIndex<cd>(i)) )
DUNE_THROW(CheckError, "e.template entity<cd>(i)->index() == e.template subIndex<cd>(i) && "<<
"e.template entity<cd>(i)->globalIndex() != e.template subIndex<cd>(i) faild!");
}
typedef typename Grid::template codim<cd>::Entity SubEntity;
subIndexCheck<cd-1,Grid,Entity,
......@@ -518,7 +524,7 @@ void iterate(Grid &g)
{
result = it->geometry().local(it->geometry().global(origin));
typename Grid::ctype error = (result-origin).two_norm();
if(error >= 10 * std::numeric_limits<typename Grid::ctype>::epsilon())
if(error >= factorEpsilon * std::numeric_limits<typename Grid::ctype>::epsilon())
{
DUNE_THROW(CheckError, "|| geom.local(geom.global(" << origin
<< ")) - origin || != 0 ( || " << result << " - origin || ) = " << error);
......@@ -540,7 +546,7 @@ void iterate(Grid &g)
{
result = lit->geometry().local(lit->geometry().global(origin));
typename Grid::ctype error = (result-origin).two_norm();
if(error >= 10 * std::numeric_limits<typename Grid::ctype>::epsilon())
if(error >= factorEpsilon * std::numeric_limits<typename Grid::ctype>::epsilon())
{
DUNE_THROW(CheckError, "|| geom.local(geom.global(" << origin
<< ")) - origin || != 0 ( || " << result << " - origin || ) = " << error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment