CHECK_FUNCTION_EXISTS(rand_r HAVE_RAND_R)
CHECK_FUNCTION_EXISTS(times HAVE_TIMES)
+#
+# Do we have the Bessel function jn?
+#
+FIND_LIBRARY(m_lib NAMES m)
+MARK_AS_ADVANCED(m_lib)
+
+IF(NOT "${m_lib}" STREQUAL "-NOTFOUND")
+ SET(CMAKE_REQUIRED_LIBRARIES ${m_lib})
+ CHECK_FUNCTION_EXISTS(jn HAVE_JN)
+ SET(CMAKE_REQUIRED_LIBRARIES)
+ IF(HAVE_JN)
+ LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${m_lib})
+ ENDIF()
+ENDIF()
#
# Export DEAL_II_MSVC if we are on a Windows platform.
/* Defined if you have the "times" function. */
#cmakedefine HAVE_TIMES
+/* Defined if you have the "jn" function. */
+#cmakedefine HAVE_JN
+
/* Defined if deal.II was configured on a native Windows platform. */
#cmakedefine DEAL_II_MSVC
{
Assert(dim==2, ExcNotImplemented());
const double r = p.distance(center);
-#ifdef HAVE_JN_
+#ifdef HAVE_JN
return jn(order, r*wave_number);
#else
Assert(false, ExcMessage("Bessel function jn was not found by configure"));
AssertDimension(points.size(), values.size());
for (unsigned int k=0;k<points.size();++k)
{
-#ifdef HAVE_JN_
+#ifdef HAVE_JN
const double r = points[k].distance(center);
values[k] = jn(order, r*wave_number);
#else
Tensor<1,dim> result;
result[0] = wave_number * co * dJn;
result[1] = wave_number * si * dJn;
-#ifdef HAVE_JN_
+#ifdef HAVE_JN
return result;
#else
Assert(false, ExcMessage("Bessel function jn was not found by configure"));
const double co = (r==0.) ? 0. : (p(0)-center(0))/r;
const double si = (r==0.) ? 0. : (p(1)-center(1))/r;
-#ifdef HAVE_JN_
+#ifdef HAVE_JN
const double dJn = (order==0)
? (-jn(1, r*wave_number))
: (.5*(jn(order-1, wave_number*r) -jn(order+1, wave_number*r)));