Sfoglia il codice sorgente

KiHa testing tweaks

pull/2/head
Trevor Irons 5 anni fa
parent
commit
911cf95ce3

+ 3
- 2
Modules/FDEM1D/examples/EMDipEarth1D.cpp Vedi File

@@ -45,7 +45,7 @@ int main() {
45 45
 		dipole->SetFrequency(0, 4400.1000);
46 46
 		//dipole->SetPhase(0);
47 47
 		//dipole->SetLocation( (VectorXr(3) << 49, 49, -1e-4).finished() );
48
-		dipole->SetLocation( 49, 49, -1e-4  );
48
+		dipole->SetLocation( 0, 0, -1e-4  );
49 49
 
50 50
 
51 51
 	// Define model
@@ -74,6 +74,7 @@ int main() {
74 74
 		int ir = 0;
75 75
 		for (int iz=0; iz<nz; ++iz) {
76 76
 			loc << ox, oy, depth;
77
+            std::cout << "Receiver location " << loc.transpose() << std::endl;
77 78
 			receivers->SetLocation(ir, loc);
78 79
 			depth += dz;
79 80
 			++ ir;
@@ -113,7 +114,7 @@ int main() {
113 114
 
114 115
  #ifdef KIHALEE_EM1D
115 116
 	receivers->ClearFields();
116
-    std::cout << "\nFORTRAN\n";
117
+    std::cout << "\nFORTRAN KiHa\n";
117 118
  	EmEarth->MakeCalc();
118 119
     auto fc = receivers->GetEfield(0,0);
119 120
 // 	std::cout << receivers->GetHfield(0,0) << std::endl;

+ 5
- 4
Modules/FDEM1D/src/DipoleSource.cpp Vedi File

@@ -770,6 +770,7 @@ namespace Lemma {
770 770
     }
771 771
 
772 772
     void DipoleSource::UpdateFields( const int& ifreq, HankelTransform* Hankel, const Real& wavef) {
773
+
773 774
         Vector3r Pol = Phat;
774 775
 
775 776
         switch (Type) {
@@ -813,7 +814,7 @@ namespace Lemma {
813 814
                                      0. );
814 815
                     } // Fields to calculate Z polarity Electric dipole
815 816
                 }
816
-                if (std::abs(Pol[1]) > 0 || std::abs(Pol[0]) > 0) { // y dipole
817
+                if (std::abs(Pol[1]) > 0 || std::abs(Pol[0]) > 0) { // x or y dipole
817 818
                     switch(FieldsToCalculate) {
818 819
                         case E:
819 820
                             f(2) = Hankel->Zgauss(2, TE, 0, rho, wavef, KernelManager->GetRAWKernel(ik[2])) * KernelManager->GetRAWKernel(ik[2])->GetZs();
@@ -823,9 +824,9 @@ namespace Lemma {
823 824
                             f(4) = Hankel->Zgauss(4, TM, 1, rho, wavef, KernelManager->GetRAWKernel(ik[4])) / KernelManager->GetRAWKernel(ik[4])->GetYm();
824 825
                             if (std::abs(Pol[1]) > 0) {
825 826
                                 this->Receivers->AppendEfield(ifreq, irec,
826
-                                    Pol[1]*QPI*scp*((f(0)-(Real)(2.)*f(1)/rho)+(f(2)-(Real)(2.)*f(3)/rho))*Moment,
827
-                                    Pol[1]*QPI*((sps*f(0)+c2p*f(1)/rho)-(cps*f(2)-c2p*f(3)/rho))*Moment,
828
-                                    Pol[1]*QPI*sp*f(4)*Moment);
827
+                                    Pol[1]*Moment*QPI*scp*((f(0)-(Real)(2.)*f(1)/rho)+(f(2)-(Real)(2.)*f(3)/rho)),
828
+                                    Pol[1]*Moment*QPI*((sps*f(0)+c2p*f(1)/rho)-(cps*f(2)-c2p*f(3)/rho)),
829
+                                    Pol[1]*Moment*QPI*sp*f(4));
829 830
                             }
830 831
                             if (std::abs(Pol[0]) > 0) {
831 832
                                 this->Receivers->AppendEfield(ifreq, irec,

+ 4
- 1
Modules/FDEM1D/src/EMEarth1D.cpp Vedi File

@@ -755,9 +755,12 @@ namespace Lemma {
755 755
 
756 756
     void EMEarth1D::SolveSingleTxRxPair (const int &irec, HankelTransform *Hankel, const Real &wavef, const int &ifreq,
757 757
                    DipoleSource *tDipole) {
758
-        //std::cout << "SolveSingleTxRxPair" << std::endl;
759 758
         ++icalcinner;
759
+
760
+        // The PGI compilers fail on the below line, and others like it.
760 761
         Real rho = (Receivers->GetLocation(irec).head<2>() - tDipole->GetLocation().head<2>()).norm();
762
+        //Real rho = ( ((Receivers->GetLocation(irec) - tDipole->GetLocation()).head(2)).eval() ).norm();
763
+
761 764
         tDipole->SetKernels(ifreq, FieldsToCalculate, Receivers, irec, Earth);
762 765
         Hankel->ComputeRelated( rho, tDipole->GetKernelManager() );
763 766
         tDipole->UpdateFields( ifreq,  Hankel, wavef );

+ 2
- 1
Modules/FDEM1D/src/FHTAnderson801.cpp Vedi File

@@ -998,7 +998,8 @@ namespace Lemma {
998 998
         // in release.
999 999
         #ifndef NDEBUG
1000 1000
 		if (rho<=0) {
1001
-			throw std::runtime_error("In Hankel 2 Argument rho < 0.");
1001
+            //std::cout << "rho= " << rho << std::endl;
1002
+			throw std::runtime_error("In Hankel 2 Argument rho <= 0; rho=" + to_string(rho) );
1002 1003
 		}
1003 1004
 
1004 1005
 		if (this->NumConv<1) {

+ 3
- 4
Modules/FDEM1D/src/GQChave.cpp Vedi File

@@ -325,10 +325,9 @@ namespace Lemma{
325 325
         return CName;
326 326
     }		// -----  end of method GQChave::GetName  -----
327 327
 
328
-    Complex GQChave::
329
-            Zgauss(const int &ikk, const EMMODE &mode,
330
-                    const int &itype, const Real &rho, const Real &wavef,
331
-                    KernelEM1DBase* Kernel){
328
+    Complex GQChave::Zgauss(const int &ikk, const EMMODE &mode,
329
+            const int &itype, const Real &rho, const Real &wavef,
330
+            KernelEM1DBase* Kernel){
332 331
 
333 332
         // TI, TODO, change calls to Zgauss to reflect this, go and fix so we
334 333
         // dont subract 1 from this everywhere

Loading…
Annulla
Salva