Browse Source

Edits to fix Chave when using GCC 8.

add-code-of-conduct-1
Trevor Irons 5 years ago
parent
commit
f35c88ebb6

+ 2
- 2
CMakeLists.txt View File

@@ -330,13 +330,13 @@ if (LEMMA_USE_OPENMP)
330 330
         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
331 331
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
332 332
         set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
333
-        add_definitions(-DLEMMAUSEOMP)
333
+        add_definitions(-DLEMMAUSEOMP) # -DEIGEN_DONT_VECTORIZE )
334 334
     else()
335 335
         find_package(OpenMP REQUIRED)
336 336
         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
337 337
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
338 338
         set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
339
-        add_definitions(-DLEMMAUSEOMP)
339
+        add_definitions(-DLEMMAUSEOMP) # -DEIGEN_DONT_VECTORIZE)
340 340
     endif()
341 341
 endif()
342 342
 

+ 1
- 1
Modules/DCIP/CMakeLists.txt View File

@@ -11,7 +11,7 @@ configure_file (
11 11
 	"${CMAKE_CURRENT_SOURCE_DIR}/config/DCIPConfig.h.in"
12 12
 	"${PROJECT_BINARY_DIR}/include/DCIPConfig.h"
13 13
 	)
14
-install ( FILES  ${PROJECT_BINARY_DIR}/include/EMSchur3DConfig.h   DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ )
14
+install ( FILES  ${PROJECT_BINARY_DIR}/include/DCIPConfig.h   DESTINATION ${CMAKE_INSTALL_PREFIX}/include/Lemma/ )
15 15
 
16 16
 	add_subdirectory("src")
17 17
 	add_library( dcip ${DCIPSOURCE} )  

+ 18
- 4
Modules/FDEM1D/include/GQChave.h View File

@@ -31,6 +31,8 @@ namespace Lemma {
31 31
 	// =======================================================================
32 32
 	class GQChave : public HankelTransform {
33 33
 
34
+        EIGEN_MAKE_ALIGNED_OPERATOR_NEW
35
+
34 36
 		friend std::ostream &operator<<(std::ostream &stream, const GQChave &ob);
35 37
 		public:
36 38
 
@@ -187,7 +189,7 @@ namespace Lemma {
187 189
  			void Bestrn( Real &BESR, Real &BESI, const int &iorder,
188 190
  					const int &NG, const Real &R,
189 191
  					const Real &RERR, const Real &AERR, const int &npcs,
190
- 					VectorXi &XSUM, int &NSUM, int &NEW,
192
+ 					const VectorXi& XSUM, int &NSUM, int &NEW,
191 193
  					int &IERR, int &NCNTRL, const Real &AORB,
192 194
 					KernelEM1DBase* Kernel);
193 195
 
@@ -242,8 +244,8 @@ namespace Lemma {
242 244
 			/// CFCOR,CFCOI ARE REAL AND IMAGINARY VECTORS OF CONTINUED FRACTION
243 245
 			/// COEFFICIENTS
244 246
 			void CF(        Real& RESR, Real &RESI,
245
-							Eigen::Matrix<Real, 100, 1> &CFCOR,
246
-							Eigen::Matrix<Real, 100, 1> &CFCOI,
247
+							const VectorXr& CFCOR,
248
+							const VectorXr& CFCOI,
247 249
 							const int &N);
248 250
 
249 251
 
@@ -318,6 +320,7 @@ namespace Lemma {
318 320
 			Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic>  kern;
319 321
 
320 322
 			// Was Besval COMMON block
323
+            /*
321 324
 			Eigen::Matrix<Real, 100, 1> Xr;
322 325
 			Eigen::Matrix<Real, 100, 1> Xi;
323 326
 			Eigen::Matrix<Real, 100, 1> Dr;
@@ -326,11 +329,22 @@ namespace Lemma {
326 329
 			Eigen::Matrix<Real, 100, 1> Si;
327 330
 			Eigen::Matrix<Real, 100, 1> Cfcor;
328 331
 			Eigen::Matrix<Real, 100, 1> Cfcoi;
332
+			*/
333
+
329 334
 
330 335
 		private:
331 336
 
337
+            Eigen::Matrix<Real, Eigen::Dynamic, 1> Xr;
338
+			Eigen::Matrix<Real, Eigen::Dynamic, 1> Xi;
339
+			Eigen::Matrix<Real, Eigen::Dynamic, 1> Dr;
340
+			Eigen::Matrix<Real, Eigen::Dynamic, 1> Di;
341
+			Eigen::Matrix<Real, Eigen::Dynamic, 1> Sr;
342
+			Eigen::Matrix<Real, Eigen::Dynamic, 1> Si;
343
+			Eigen::Matrix<Real, Eigen::Dynamic, 1> Cfcor;
344
+			Eigen::Matrix<Real, Eigen::Dynamic, 1> Cfcoi;
345
+
332 346
             /** ASCII string representation of the class name */
333
-            static constexpr auto CName = "FHTKey51";
347
+            static constexpr auto CName = "GQChave";
334 348
 
335 349
 	}; // -----  end of class  GQChave  -----
336 350
 

+ 1
- 1
Modules/FDEM1D/include/KernelEM1DReflSpec.h View File

@@ -67,7 +67,7 @@ namespace Lemma {
67 67
 
68 68
             // ====================  INQUIRY       =======================
69 69
 
70
-            virtual std::string GetName() {
70
+            virtual std::string GetName() const {
71 71
                 return CName;
72 72
             }
73 73
 

+ 3
- 3
Modules/FDEM1D/src/DipoleSource.cpp View File

@@ -1246,13 +1246,13 @@ namespace Lemma {
1246 1246
         switch (coordinate) {
1247 1247
             case (0):
1248 1248
                 return this->Location.x();
1249
-                break;
1249
+                //break; // implicit
1250 1250
             case (1):
1251 1251
                 return this->Location.y();
1252
-                break;
1252
+                //break; // implicit
1253 1253
             case (2):
1254 1254
                 return this->Location.z();
1255
-                break;
1255
+                //break; // implicit
1256 1256
             default:
1257 1257
                 throw  NonValidLocationCoordinate( );
1258 1258
         }

+ 24
- 10
Modules/FDEM1D/src/GQChave.cpp View File

@@ -267,6 +267,14 @@ namespace Lemma{
267 267
     GQChave::GQChave( const ctor_key& key ) : HankelTransform( key ) {
268 268
         //karg.resize(255, 100);
269 269
         //kern.resize(510, 100);
270
+        Xr.resize(100);
271
+        Xi.resize(100);
272
+        Dr.resize(100);
273
+        Di.resize(100);
274
+        Sr.resize(100);
275
+        Si.resize(100);
276
+        Cfcor.resize(100);
277
+        Cfcoi.resize(100);
270 278
     }
271 279
 
272 280
     GQChave::GQChave( const YAML::Node& node, const ctor_key& key ) : HankelTransform(node, key) {
@@ -355,6 +363,8 @@ namespace Lemma{
355 363
         //this->karg.setZero();
356 364
         //this->kern.setZero();
357 365
 
366
+        //std::cout << "calling Besautn" << std::endl;
367
+
358 368
         Besautn(Besr, Besi, itype, nl, nu, rho, rerr, aerr, npcs, inew, wavef, Kernel);
359 369
 
360 370
         return Complex(Besr, Besi);
@@ -400,6 +410,7 @@ namespace Lemma{
400 410
         int nsum(0);
401 411
 
402 412
         // Check for Rtud
413
+        //std::cout << "calling Bestrn" << std::endl;
403 414
         Bestrn(besr_1, besi_1, besselOrder, lowerGaussLimit, rho,
404 415
                         .1*relativeError, .1*absError,
405 416
                         numPieces, xsum, nsum, nw, ierr, ncntrl, aorb, Kernel);
@@ -498,12 +509,14 @@ namespace Lemma{
498 509
     /////////////////////////////////////////////////////////////
499 510
     void GQChave::
500 511
         Bestrn(Real &BESR, Real &BESI, const int &IORDER,
501
-            const int &NG, const Real &rho,
502
-            const Real &RERR, const Real &AERR, const int &NPCS,
503
-            VectorXi &XSUM, int &NSUM, int &NEW,
504
-            int &IERR, int &NCNTRL, const Real &AORB, KernelEM1DBase* Kernel) {
505
-
506
-
512
+            const int& NG, const Real& rho,
513
+            const Real& RERR, const Real& AERR, const int& NPCS,
514
+            const VectorXi& XSUM, int& NSUM, int& NEW,
515
+            int& IERR, int& NCNTRL, const Real& AORB, KernelEM1DBase* Kernel) {
516
+
517
+        //std::cout << "Bestrn setZero " << NEW << std::endl;
518
+        //Xr.array() = 0.;
519
+        //Xi.array() = 0.;
507 520
         Xr.setZero();
508 521
         Xi.setZero();
509 522
         Dr.setZero();
@@ -514,6 +527,7 @@ namespace Lemma{
514 527
         Cfcoi.setZero();
515 528
         Dr.setZero();
516 529
         Di.setZero();
530
+        //std::cout << "Bestrn wat " << NEW << std::endl;
517 531
 
518 532
         Dr(0) = (Real)(-1);
519 533
 
@@ -587,6 +601,7 @@ namespace Lemma{
587 601
                 ++NPB;
588 602
             }
589 603
         }
604
+        //std::cout << "Bestrn NEW " << NEW << std::endl;
590 605
 
591 606
         // ENTRY POINT FOR PADE SUMMATION OF PARTIAL INTEGRANDS
592 607
         Real LASTR=0.e0;
@@ -1033,8 +1048,8 @@ namespace Lemma{
1033 1048
 
1034 1049
     /////////////////////////////////////////////////////////////
1035 1050
     void GQChave::CF(Real& RESR, Real &RESI,
1036
-                    Eigen::Matrix<Real, 100, 1> &CFCOR,
1037
-                    Eigen::Matrix<Real, 100, 1> &CFCOI,
1051
+                    const VectorXr& CFCOR,
1052
+                    const VectorXr& CFCOI,
1038 1053
                     const int &N) {
1039 1054
 
1040 1055
         ////////////////////////////////////////////////
@@ -1071,7 +1086,6 @@ namespace Lemma{
1071 1086
 
1072 1087
         Real BETA(0);
1073 1088
         switch (besselOrder) {
1074
-
1075 1089
             case 0:
1076 1090
                 BETA=(nzero-.25e0)*PI;
1077 1091
                 return BETA-ZT1/BETA-ZT2/std::pow(BETA,3) -
@@ -1083,7 +1097,7 @@ namespace Lemma{
1083 1097
             default:
1084 1098
                 throw 77;
1085 1099
         }
1086
-        return 0.;
1100
+        //return 0.;
1087 1101
     }
1088 1102
 
1089 1103
 

Loading…
Cancel
Save