Lemma is an Electromagnetics API
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

uthankel2.cpp 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. // ===========================================================================
  2. //
  3. // Filename: uthankel2.cpp
  4. //
  5. // Description:
  6. //
  7. // Version: 0.0
  8. // Created: 05/14/2010 10:26:59 AM
  9. // Revision: none
  10. // Compiler: Tested with g++, icpc, and MSVC 2000
  11. //
  12. // Author: Trevor Irons (ti)
  13. //
  14. // Organisation: Colorado School of Mines (CSM)
  15. // United States Geological Survey (USGS)
  16. //
  17. // Email: tirons@mines.edu, tirons@usgs.gov
  18. //
  19. // This program is free software: you can redistribute it and/or modify
  20. // it under the terms of the GNU General Public License as published by
  21. // the Free Software Foundation, either version 3 of the License, or
  22. // (at your option) any later version.
  23. //
  24. // This program is distributed in the hope that it will be useful,
  25. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. // GNU General Public License for more details.
  28. //
  29. // You should have received a copy of the GNU General Public License
  30. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  31. //
  32. // ===========================================================================
  33. #include "hankeltransformhankel2.h"
  34. #include "hankeltransformgaussianquadrature.h"
  35. #include "kernelem1d.h"
  36. #include "layeredearthem.h"
  37. using namespace Lemma;
  38. int main() {
  39. // Define model
  40. LayeredEarthEM *Earth = LayeredEarthEM::New();
  41. VectorXcr sigma(3);
  42. sigma << 0., .1, 0.01;
  43. VectorXr thick(1);
  44. thick << 10;
  45. Earth->SetNumberOfLayers(3);
  46. Earth->SetLayerConductivity(sigma);
  47. Earth->SetLayerThickness(thick);
  48. // Source
  49. // Test with a single dipole
  50. DipoleSource *dipole = DipoleSource::New();
  51. dipole->SetMoment(2);
  52. dipole->SetType(MAGNETICDIPOLE);
  53. dipole->SetPolarisation(ZPOLARISATION);
  54. dipole->SetLocation(0,0,0);
  55. dipole->SetNumberOfFrequencies(1);
  56. dipole->SetFrequency(0,1000);
  57. dipole->SetPhase(0);
  58. KernelEm1D *Kernel = KernelEm1D::New();
  59. Kernel->Initialise(Earth);
  60. Kernel->SetUpSource(dipole, 0);
  61. Kernel->SetUpReceiver(-0.4);
  62. //std::vector< KernelEm1DBase* > KernelVec;
  63. // KernelVec.push_back( )
  64. std::cout.precision(10);
  65. Hankel2 *dig = Hankel2::New();
  66. // dig->ComputeRelated(.23 , Kernel);
  67. // std::cout << " dig->Zgauss "
  68. // << dig->Zgauss(0, TE, 0, 100.,
  69. // 1000.*std::sqrt(MU0*EPSILON0), Kernel)
  70. // << std::endl;
  71. // HankelTransformGaussianQuadrature *gauss =
  72. // HankelTransformGaussianQuadrature::New();
  73. // std::cout << "gauss->Zgauss "
  74. // << gauss->Zgauss(0, TE, 0, 100.,
  75. // 1000.*std::sqrt(MU0*EPSILON0), Kernel)
  76. // << std::endl;
  77. Earth->Delete();
  78. dig->Delete();
  79. //gauss->Delete();
  80. dipole->Delete();
  81. Kernel->Delete();
  82. return EXIT_SUCCESS;
  83. }