123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #include <FDEM1D>
-
- using namespace Lemma;
-
- int main() {
-
-
- auto dipole = DipoleSource::NewSP();
- dipole->SetType(GROUNDEDELECTRICDIPOLE);
- dipole->SetPolarisation(XPOLARISATION);
- dipole->SetNumberOfFrequencies(1);
- dipole->SetMoment(1);
- dipole->SetFrequency(0, 4400.1000);
-
-
- dipole->SetLocation( 49, 49, -1e-4 );
-
-
-
- VectorXcr sigma(2);
- sigma << 0., 1e-3;
- VectorXr thick(1);
- thick << 10;
-
- auto earth = LayeredEarthEM::NewSP();
- earth->SetNumberOfLayers(2);
- earth->SetLayerConductivity(sigma);
-
-
-
- auto receivers = FieldPoints::NewSP();
- Vector3r loc;
-
-
- Real ox = 50.;
- Real oy = 20.;
- Real depth = 18.10;
- Real dz = 2.6;
- int nz = 1;
-
- receivers->SetNumberOfPoints(nz);
- int ir = 0;
- for (int iz=0; iz<nz; ++iz) {
- loc << ox, oy, depth;
-
- receivers->SetLocation(ir, loc);
- depth += dz;
- ++ ir;
- }
-
-
- auto EmEarth = EMEarth1D::NewSP();
-
- EmEarth->SetFieldsToCalculate(BOTH);
- EmEarth->AttachDipoleSource(dipole);
- EmEarth->AttachLayeredEarthEM(earth);
- EmEarth->AttachFieldPoints(receivers);
-
-
-
-
-
-
- std::cout << "Dipole location " << dipole->GetLocation( ).transpose() << "\n";
- std::cout << "Receiver location " << receivers->GetLocation(0).transpose() << "\n";
-
- std::cout << "C++\n";
- EmEarth->MakeCalc3();
- std::cout << receivers->GetEfield(0,0) << std::endl;
-
-
-
-
-
-
-
-
- auto lc = receivers->GetEfield(0,0);
-
- #ifdef KIHALEE_EM1D
- receivers->ClearFields();
- std::cout << "\nFORTRAN KiHa\n";
- EmEarth->MakeCalc();
- auto fc = receivers->GetEfield(0,0);
-
- std::cout << receivers->GetEfield(0,0) << std::endl;
-
- std::cout << "Difference norm |" << (lc - fc).norm() << "|" << std::endl;
- #endif
-
- }
|