Browse Source

Fixed templated FHT class compilation issues with forward declarations

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

+ 1
- 0
Modules/FDEM1D/examples/Hantenna.cpp View File

30
 #if defined(__clang__)
30
 #if defined(__clang__)
31
 	/* Clang/LLVM. ---------------------------------------------- */
31
 	/* Clang/LLVM. ---------------------------------------------- */
32
     const char* compiler = "clang";
32
     const char* compiler = "clang";
33
+    const char* ver = __VERSION__;
33
 #elif defined(__ICC) || defined(__INTEL_COMPILER)
34
 #elif defined(__ICC) || defined(__INTEL_COMPILER)
34
 	/* Intel ICC/ICPC. ------------------------------------------ */
35
 	/* Intel ICC/ICPC. ------------------------------------------ */
35
     const char* compiler = "icpc";
36
     const char* compiler = "icpc";

+ 8
- 1
Modules/FDEM1D/include/FHT.h View File

169
 
169
 
170
     }; // -----  end of class  FHT  ----
170
     }; // -----  end of class  FHT  ----
171
 
171
 
172
+    // Forward declarations
173
+    template<>
174
+    const Eigen::Matrix<Real, Eigen::Dynamic, 3>  FHT<FHTKEY201>::WT;
175
+    template<>
176
+    const Eigen::Matrix<Real, Eigen::Dynamic, 3>  FHT<FHTKEY101>::WT;
177
+    template<>
178
+    const Eigen::Matrix<Real, Eigen::Dynamic, 3>  FHT<FHTKEY51>::WT;
172
 
179
 
173
     template < HANKELTRANSFORMTYPE Type >
180
     template < HANKELTRANSFORMTYPE Type >
174
     Complex FHT<Type>::Zgauss(const int& ii, const Lemma::EMMODE& mode, const int& jj, const Real& val,
181
     Complex FHT<Type>::Zgauss(const int& ii, const Lemma::EMMODE& mode, const int& jj, const Real& val,
186
         return WT(0,0)/WT(1,0);
193
         return WT(0,0)/WT(1,0);
187
     }
194
     }
188
 
195
 
189
-    /* specializations could provide slighly better performance */
196
+    /* specializations could provide slighly better performance by reducing divides */
190
 //     template < >
197
 //     template < >
191
 //     Real FHT< FHTKEY201 >::GetABSER() {
198
 //     Real FHT< FHTKEY201 >::GetABSER() {
192
 //         return WT(0,0)/WT(1,0);
199
 //         return WT(0,0)/WT(1,0);

+ 4
- 2
Modules/FDEM1D/include/HankelTransformFactory.h View File

101
                     //return FHTKey201::NewSP();
101
                     //return FHTKey201::NewSP();
102
                     return FHT<FHTKEY201>::NewSP();
102
                     return FHT<FHTKEY201>::NewSP();
103
                 case FHTKEY101:
103
                 case FHTKEY101:
104
-                    return FHTKey101::NewSP();
104
+                    return FHT<FHTKEY101>::NewSP();
105
+                    //return FHTKey101::NewSP();
105
                 case FHTKEY51:
106
                 case FHTKEY51:
106
-                    return FHTKey51::NewSP();
107
+                    return FHT<FHTKEY51>::NewSP();
108
+                    //return FHTKey51::NewSP();
107
                 case CHAVE:
109
                 case CHAVE:
108
                     return GQChave::NewSP();
110
                     return GQChave::NewSP();
109
                 case QWEKEY:
111
                 case QWEKEY:

+ 0
- 7
Modules/FDEM1D/src/DipoleSource.cpp View File

932
                             }
932
                             }
933
                             break;
933
                             break;
934
                         case H:
934
                         case H:
935
-                            std::cout << "Fuck me gently with a chainsaw..." << std::endl;
936
-                            //std::cout << f.cols() << "\t" << f.rows() << std::endl;
937
-                            //std::cout << "kern" <<  KernelManager->GetRAWKernel(ik[5]);
938
-                            //std::cout << "Inputs\t" << TM << "\t" << rho << "\t" << wavef << "\t" << ik[5] << "\t" << KernelManager->GetRAWKernel(ik[5])<< std::endl;
939
-                            //Hankel->Zgauss(5, TM, 0, rho, wavef, nullptr);
940
                             f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[5]));
935
                             f(5) = Hankel->Zgauss(5, TM, 0, rho, wavef, KernelManager->GetRAWKernel(ik[5]));
941
                             f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[6]));
936
                             f(6) = Hankel->Zgauss(6, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[6]));
942
                             f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[7]))*KernelManager->GetRAWKernel(ik[7])->GetZs()/KernelManager->GetRAWKernel(ik[7])->GetZm();
937
                             f(7) = Hankel->Zgauss(7, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[7]))*KernelManager->GetRAWKernel(ik[7])->GetZs()/KernelManager->GetRAWKernel(ik[7])->GetZm();
943
                             f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[8]))*KernelManager->GetRAWKernel(ik[8])->GetZs()/KernelManager->GetRAWKernel(ik[8])->GetZm();
938
                             f(8) = Hankel->Zgauss(8, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[8]))*KernelManager->GetRAWKernel(ik[8])->GetZs()/KernelManager->GetRAWKernel(ik[8])->GetZm();
944
                             f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[9]))*KernelManager->GetRAWKernel(ik[9])->GetZs()/KernelManager->GetRAWKernel(ik[9])->GetZm();
939
                             f(9) = Hankel->Zgauss(9, TE, 1, rho, wavef, KernelManager->GetRAWKernel(ik[9]))*KernelManager->GetRAWKernel(ik[9])->GetZs()/KernelManager->GetRAWKernel(ik[9])->GetZm();
945
-                            std::cout << "HARDER!!!!" << std::endl;
946
                             if (std::abs(Pol[1]) > 0) {
940
                             if (std::abs(Pol[1]) > 0) {
947
                                 this->Receivers->AppendHfield(ifreq, irec,
941
                                 this->Receivers->AppendHfield(ifreq, irec,
948
                                         Pol[1]*QPI*(sps*f(5)+c2p*f(6)/rho-cps*f(7)+c2p*f(8)/rho)*Moment,
942
                                         Pol[1]*QPI*(sps*f(5)+c2p*f(6)/rho-cps*f(7)+c2p*f(8)/rho)*Moment,
957
                                     Pol[0]*Moment*QPI*sp*f(9) );
951
                                     Pol[0]*Moment*QPI*sp*f(9) );
958
                                 // Analytic whole space solution
952
                                 // Analytic whole space solution
959
                             }
953
                             }
960
-                            //std::cout << "ahhhhhh!!!!!!!!!" << std::endl;
961
                             break;
954
                             break;
962
 
955
 
963
                         case BOTH:
956
                         case BOTH:

+ 0
- 6
Modules/FDEM1D/src/FHT.cpp View File

22
 namespace Lemma {
22
 namespace Lemma {
23
 
23
 
24
     template<>
24
     template<>
25
-    FHT<FHTKEY201>::FHT( const ctor_key& key ) : HankelTransform(key)
26
-    {
27
-
28
-    }
29
-
30
-    template<>
31
     const Eigen::Matrix<Real, Eigen::Dynamic, 3>  FHT<FHTKEY201>::WT =
25
     const Eigen::Matrix<Real, Eigen::Dynamic, 3>  FHT<FHTKEY201>::WT =
32
         ( Eigen::Matrix<Real, 201, 3>()   <<
26
         ( Eigen::Matrix<Real, 201, 3>()   <<
33
         // Base                   J0                      J1
27
         // Base                   J0                      J1

Loading…
Cancel
Save