virtual
bool preserves_vertex_locations () const;
+ /**
+ * The Newton iteration computing
+ * the mapping between a
+ * real space point and a point
+ * in reference space did not
+ * converge, thus resulting in a
+ * wrong mapping.
+ *
+ * @ingroup Exceptions
+ */
+ DeclException0(ExcTransformationFailed);
+
private:
/**
* Implementation of the interface in
Point<spacedim> f = p_real-p;
const double eps=1e-15*cell->diameter();
+ const unsigned int loop_limit = 10;
+
unsigned int loop=0;
- while (f.square()>eps*eps && loop++<10)
+ while (f.square()>eps*eps && loop++<loop_limit)
{
// f'(x)
Tensor<2,spacedim> df;
df = transpose(df);
}
}
-
+
// Solve [f'(x)]d=f(x)
Tensor<1,spacedim> d;
Tensor<2,spacedim> df_1;
if(dim<spacedim)
f -= (transpose(df)[dim]*f)*f;
}
+ // Here we check that in the last
+ // execution of while the first
+ // condition was already wrong,
+ // menaing the residual was below
+ // eps. Only if the first condition
+ // failed, loop will have been
+ // increased and tested, and thus
+ // havereached the limit.
+ AssertThrow(loop<loop_limit, ExcTransformationFailed());
}