Browse Source

Edits to fix Chave when using GCC 8.

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

+ 2
- 2
CMakeLists.txt View File

330
         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
330
         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
331
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
331
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
332
         set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
332
         set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
333
-        add_definitions(-DLEMMAUSEOMP)
333
+        add_definitions(-DLEMMAUSEOMP) # -DEIGEN_DONT_VECTORIZE )
334
     else()
334
     else()
335
         find_package(OpenMP REQUIRED)
335
         find_package(OpenMP REQUIRED)
336
         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
336
         set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
337
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
337
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
338
         set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
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
     endif()
340
     endif()
341
 endif()
341
 endif()
342
 
342
 

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

11
 	"${CMAKE_CURRENT_SOURCE_DIR}/config/DCIPConfig.h.in"
11
 	"${CMAKE_CURRENT_SOURCE_DIR}/config/DCIPConfig.h.in"
12
 	"${PROJECT_BINARY_DIR}/include/DCIPConfig.h"
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
 	add_subdirectory("src")
16
 	add_subdirectory("src")
17
 	add_library( dcip ${DCIPSOURCE} )  
17
 	add_library( dcip ${DCIPSOURCE} )  

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

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

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

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

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

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

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

267
     GQChave::GQChave( const ctor_key& key ) : HankelTransform( key ) {
267
     GQChave::GQChave( const ctor_key& key ) : HankelTransform( key ) {
268
         //karg.resize(255, 100);
268
         //karg.resize(255, 100);
269
         //kern.resize(510, 100);
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
     GQChave::GQChave( const YAML::Node& node, const ctor_key& key ) : HankelTransform(node, key) {
280
     GQChave::GQChave( const YAML::Node& node, const ctor_key& key ) : HankelTransform(node, key) {
355
         //this->karg.setZero();
363
         //this->karg.setZero();
356
         //this->kern.setZero();
364
         //this->kern.setZero();
357
 
365
 
366
+        //std::cout << "calling Besautn" << std::endl;
367
+
358
         Besautn(Besr, Besi, itype, nl, nu, rho, rerr, aerr, npcs, inew, wavef, Kernel);
368
         Besautn(Besr, Besi, itype, nl, nu, rho, rerr, aerr, npcs, inew, wavef, Kernel);
359
 
369
 
360
         return Complex(Besr, Besi);
370
         return Complex(Besr, Besi);
400
         int nsum(0);
410
         int nsum(0);
401
 
411
 
402
         // Check for Rtud
412
         // Check for Rtud
413
+        //std::cout << "calling Bestrn" << std::endl;
403
         Bestrn(besr_1, besi_1, besselOrder, lowerGaussLimit, rho,
414
         Bestrn(besr_1, besi_1, besselOrder, lowerGaussLimit, rho,
404
                         .1*relativeError, .1*absError,
415
                         .1*relativeError, .1*absError,
405
                         numPieces, xsum, nsum, nw, ierr, ncntrl, aorb, Kernel);
416
                         numPieces, xsum, nsum, nw, ierr, ncntrl, aorb, Kernel);
498
     /////////////////////////////////////////////////////////////
509
     /////////////////////////////////////////////////////////////
499
     void GQChave::
510
     void GQChave::
500
         Bestrn(Real &BESR, Real &BESI, const int &IORDER,
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
         Xr.setZero();
520
         Xr.setZero();
508
         Xi.setZero();
521
         Xi.setZero();
509
         Dr.setZero();
522
         Dr.setZero();
514
         Cfcoi.setZero();
527
         Cfcoi.setZero();
515
         Dr.setZero();
528
         Dr.setZero();
516
         Di.setZero();
529
         Di.setZero();
530
+        //std::cout << "Bestrn wat " << NEW << std::endl;
517
 
531
 
518
         Dr(0) = (Real)(-1);
532
         Dr(0) = (Real)(-1);
519
 
533
 
587
                 ++NPB;
601
                 ++NPB;
588
             }
602
             }
589
         }
603
         }
604
+        //std::cout << "Bestrn NEW " << NEW << std::endl;
590
 
605
 
591
         // ENTRY POINT FOR PADE SUMMATION OF PARTIAL INTEGRANDS
606
         // ENTRY POINT FOR PADE SUMMATION OF PARTIAL INTEGRANDS
592
         Real LASTR=0.e0;
607
         Real LASTR=0.e0;
1033
 
1048
 
1034
     /////////////////////////////////////////////////////////////
1049
     /////////////////////////////////////////////////////////////
1035
     void GQChave::CF(Real& RESR, Real &RESI,
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
                     const int &N) {
1053
                     const int &N) {
1039
 
1054
 
1040
         ////////////////////////////////////////////////
1055
         ////////////////////////////////////////////////
1071
 
1086
 
1072
         Real BETA(0);
1087
         Real BETA(0);
1073
         switch (besselOrder) {
1088
         switch (besselOrder) {
1074
-
1075
             case 0:
1089
             case 0:
1076
                 BETA=(nzero-.25e0)*PI;
1090
                 BETA=(nzero-.25e0)*PI;
1077
                 return BETA-ZT1/BETA-ZT2/std::pow(BETA,3) -
1091
                 return BETA-ZT1/BETA-ZT2/std::pow(BETA,3) -
1083
             default:
1097
             default:
1084
                 throw 77;
1098
                 throw 77;
1085
         }
1099
         }
1086
-        return 0.;
1100
+        //return 0.;
1087
     }
1101
     }
1088
 
1102
 
1089
 
1103
 

Loading…
Cancel
Save