From: ESeNonFossiIo Date: Thu, 14 Jul 2016 15:50:52 +0000 (+0200) Subject: Assert for get_tantgent_vector of SphericalManifold X-Git-Tag: v8.5.0-rc1~806^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de5dbbef604ae2b811a245f6872cc4fd82ff5834;p=dealii.git Assert for get_tantgent_vector of SphericalManifold --- diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index 9e73b9c9c1..aee78e7430 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -216,9 +216,20 @@ get_tangent_vector (const Point &p1, const double r1 = (p1 - center).norm(); const double r2 = (p2 - center).norm(); + + Assert(r1 > 1e-10, + ExcMessage("p1 cannot coincide with the center.")); + + Assert(r2 > 1e-10, + ExcMessage("p2 cannot coincide with the center.")); + const Tensor<1,spacedim> e1 = (p1 - center)/r1; const Tensor<1,spacedim> e2 = (p2 - center)/r2; + Assert(e1*e2 + 1.0 > 1e-10, + ExcMessage("p1 and p2 cannot lie on the same diameter and be opposite + respect to the center.")); + // Tangent vector to the unit sphere along the geodesic given by e1 and e2. Tensor<1,spacedim> tg = (e2-(e2*e1)*e1); tg = tg / tg.norm();