Browse Source

Boost can now be turned off, but gaussian quadrature won't work in that case.

submodule
Trevor Irons 7 years ago
parent
commit
0f54063425

+ 18
- 0
CMakeLists.txt View File

171
 endif()
171
 endif()
172
 
172
 
173
 ####################
173
 ####################
174
+# Look for Boost
175
+####################
176
+option (LEMMA_USE_BOOST "Boost is required by gaussian quadrature classes" OFF)
177
+if (LEMMA_USE_BOOST)
178
+	find_package(Boost
179
+  		1.58.0                         # Minimum or EXACT version e.g. 1.36.0
180
+  		COMPONENTS math                # Boost libraries by their canonical name
181
+	)  
182
+	if(Boost_FOUND)
183
+  		include_directories(${Boost_INCLUDE_DIRS})
184
+	endif()
185
+	find_path( HAVE_BOOST_SPECIAL_FUNCTIONS "boost/math/special_functions.hpp" ) 
186
+	if(HAVE_BOOST_SPECIAL_FUNCTIONS)
187
+		add_compile_options(-DHAVE_BOOST_SPECIAL_FUNCTIONS)
188
+	endif()
189
+endif()
190
+
191
+####################
174
 # Magic rpath flag
192
 # Magic rpath flag
175
 ####################
193
 ####################
176
 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
194
 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

+ 3
- 2
Modules/FDEM1D/include/GQChave.h View File

14
 
14
 
15
 #include "HankelTransform.h"
15
 #include "HankelTransform.h"
16
 #include "KernelEM1DBase.h"
16
 #include "KernelEM1DBase.h"
17
-//#include <cmath>
18
-#include "boost/math/special_functions.hpp"
19
 
17
 
18
+#ifdef HAVE_BOOST_SPECIAL_FUNCTIONS
19
+#include "boost/math/special_functions.hpp"
20
+#endif
20
 
21
 
21
 namespace Lemma {
22
 namespace Lemma {
22
 
23
 

+ 3
- 0
Modules/FDEM1D/include/QWEKey.h View File

22
 #include "HankelTransform.h"
22
 #include "HankelTransform.h"
23
 
23
 
24
 #include <Eigen/Eigenvalues>
24
 #include <Eigen/Eigenvalues>
25
+
26
+#ifdef HAVE_BOOST_SPECIAL_FUNCTIONS
25
 #include "boost/math/special_functions.hpp"
27
 #include "boost/math/special_functions.hpp"
26
 #include "boost/math/special_functions/bessel.hpp"
28
 #include "boost/math/special_functions/bessel.hpp"
29
+#endif
27
 
30
 
28
 namespace Lemma {
31
 namespace Lemma {
29
 
32
 

+ 1
- 0
Modules/FDEM1D/src/CMakeLists.txt View File

18
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey201.cpp
18
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey201.cpp
19
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey101.cpp
19
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey101.cpp
20
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey51.cpp
20
 	${CMAKE_CURRENT_SOURCE_DIR}/FHTKey51.cpp
21
+
21
 	${CMAKE_CURRENT_SOURCE_DIR}/GQChave.cpp
22
 	${CMAKE_CURRENT_SOURCE_DIR}/GQChave.cpp
22
 	${CMAKE_CURRENT_SOURCE_DIR}/QWEKey.cpp
23
 	${CMAKE_CURRENT_SOURCE_DIR}/QWEKey.cpp
23
 	
24
 	

+ 6
- 1
Modules/FDEM1D/src/GQChave.cpp View File

1117
 
1117
 
1118
     /////////////////////////////////////////////////////////////
1118
     /////////////////////////////////////////////////////////////
1119
     //
1119
     //
1120
+#ifdef HAVE_BOOST_SPECIAL_FUNCTIONS
1120
     Real GQChave::Jbess(const Real &x, const int &IORDER) {
1121
     Real GQChave::Jbess(const Real &x, const int &IORDER) {
1121
         switch (IORDER) {
1122
         switch (IORDER) {
1122
             case 0:
1123
             case 0:
1131
                 throw std::runtime_error("Non 0 or 1 Bessel argument specified in GQChave");
1132
                 throw std::runtime_error("Non 0 or 1 Bessel argument specified in GQChave");
1132
         }
1133
         }
1133
     }
1134
     }
1134
-
1135
+#else
1136
+    Real GQChave::Jbess(const Real &x, const int &IORDER) {
1137
+        std::cerr << "GQChave requires boost special functions module";
1138
+    }
1139
+#endif
1135
     //////////////////////////////////////////////////////
1140
     //////////////////////////////////////////////////////
1136
     // Exception classes
1141
     // Exception classes
1137
 
1142
 

+ 7
- 1
Modules/FDEM1D/src/QWEKey.cpp View File

169
     //       Class:  QWEKey
169
     //       Class:  QWEKey
170
     //      Method:  BesselWeights
170
     //      Method:  BesselWeights
171
     //--------------------------------------------------------------------------------------
171
     //--------------------------------------------------------------------------------------
172
+
173
+#ifdef HAVE_BOOST_SPECIAL_FUNCTIONS
172
     void QWEKey::BesselWeights ( const sZeroType& sType ) {
174
     void QWEKey::BesselWeights ( const sZeroType& sType ) {
173
         GaussQuadWeights(nQuad); // TODO should this be moved out of initializer?
175
         GaussQuadWeights(nQuad); // TODO should this be moved out of initializer?
174
         std::vector<Real> bz;
176
         std::vector<Real> bz;
207
         }
209
         }
208
         return ;
210
         return ;
209
     }		// -----  end of method QWEKey::BesselWeights  -----
211
     }		// -----  end of method QWEKey::BesselWeights  -----
210
-
212
+#else
213
+    void QWEKey::BesselWeights ( const sZeroType& sType ) {
214
+        std::cerr <<  "QWEKey requires boost special functions";
215
+    }
216
+#endif
211
 
217
 
212
     //--------------------------------------------------------------------------------------
218
     //--------------------------------------------------------------------------------------
213
     //       Class:  QWEKey
219
     //       Class:  QWEKey

Loading…
Cancel
Save