]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add support for HAVE_JN
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Nov 2012 22:40:24 +0000 (22:40 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Nov 2012 22:40:24 +0000 (22:40 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@27303 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/checks/check_for_system_features.cmake
deal.II/include/deal.II/base/config.h.in
deal.II/source/base/function_lib.cc

index 7e61feb672163ecd0b25d1a6d1744907f466f46f..e6539db298b9ff0f4da3eda10f4205cec6c4e331 100644 (file)
@@ -43,6 +43,20 @@ CHECK_FUNCTION_EXISTS(getpid HAVE_GETPID)
 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.
index 0bf1afbfb5b88874d15d7005f5e6d7a2eca7e777..6544f91b9ee7154d844ab402688445f164e4b905 100644 (file)
 /* 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
index 977b4d2acd3777f05de515e60b25c058584067d0..eae8864f9fff13f098141788ebec2e50b08f9e01 100644 (file)
@@ -2175,7 +2175,7 @@ namespace Functions
   {
     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"));
@@ -2195,7 +2195,7 @@ namespace Functions
     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
@@ -2221,7 +2221,7 @@ namespace Functions
     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"));
@@ -2247,7 +2247,7 @@ namespace Functions
         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)));

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.