From: Wolfgang Bangerth Date: Mon, 29 Jun 2015 23:01:45 +0000 (-0500) Subject: Avoid computing atan(y/x) where x=0. X-Git-Tag: v8.3.0-rc1~75^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1061%2Fhead;p=dealii.git Avoid computing atan(y/x) where x=0. Rather, use atan2(y,x). --- diff --git a/tests/codim_one/bem_integration.cc b/tests/codim_one/bem_integration.cc index 063d2dd28b..9b03d82c94 100644 --- a/tests/codim_one/bem_integration.cc +++ b/tests/codim_one/bem_integration.cc @@ -165,7 +165,7 @@ LaplaceKernelIntegration::term_S (const Tensor<1,3> &r, *( - ra1*n/a1.norm() * asinh( r*a1/ra1.norm() ) + ra2*n/a2.norm() * asinh( r*a2/ra2.norm() ) - + rn_c * atan( ra1*ra2 / (r.norm()* (r*(a12)))) + + rn_c * atan2( ra1*ra2, r.norm()* (r*a12) ) ); return integral; @@ -185,7 +185,7 @@ LaplaceKernelIntegration::term_D (const Tensor<1,3> &r, cross_product(a12,a1,a2); double integral = 1./2./numbers::PI - *atan( ra1*ra2 / (r.norm()* (r*(a12)))); + *atan2( ra1*ra2, (r.norm()* (r*a12))); return integral;