Surface NMR forward modelling
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

KernelV0.cpp 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 11/11/2016 02:44:37 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2016, University of Utah
  15. * @copyright Copyright (c) 2016, Lemma Software, LLC
  16. */
  17. #include <Merlin>
  18. using namespace Lemma;
  19. std::shared_ptr<PolygonalWireAntenna> CircularLoop ( int nd, Real radius, Real Offsetx, Real Offsety ) ;
  20. int main() {
  21. auto earth = LayeredEarthEM::NewSP();
  22. earth->SetNumberOfLayers(3);
  23. earth->SetLayerConductivity( (VectorXcr(3) << Complex(0.,0), Complex(1./50.,0), Complex(1./100.)).finished() );
  24. earth->SetLayerThickness( (VectorXr(1) << 10).finished() );
  25. // Transmitter loops
  26. auto Tx1 = CircularLoop(60, 15, 0, 0);
  27. auto Tx2 = CircularLoop(60, 15, 15, 0);
  28. //auto Tx1 = CircularLoop(60, 15, 0, 0); // was 60
  29. auto Kern = KernelV0::NewSP();
  30. Kern->PushCoil( "Coil 1", Tx1 );
  31. Kern->PushCoil( "Coil 2", Tx2 );
  32. Kern->SetLayeredEarthEM( earth );
  33. // std::cout << *Kern << std::endl;
  34. // We could, I suppose, take the earth model in here? For non-linear that
  35. // may be more natural to work with?
  36. std::vector<std::string> tx = {std::string("Coil 1")};
  37. std::vector<std::string> rx = {std::string("Coil 1")};
  38. Kern->CalculateK0( tx, rx );
  39. //Kern->CalculateK0( "Coil 1", "Coil 1" );
  40. }
  41. std::shared_ptr<Lemma::PolygonalWireAntenna> CircularLoop ( int nd, Real Radius, Real Offsetx, Real Offsety ) {
  42. auto Tx1 = Lemma::PolygonalWireAntenna::NewSP();
  43. Tx1->SetNumberOfPoints(nd);
  44. VectorXr range = VectorXr::LinSpaced(nd, 0, 2*PI);
  45. int ii;
  46. for (ii=0; ii<nd-1; ++ii) {
  47. Tx1->SetPoint(ii, Vector3r(Offsetx+Radius*std::cos(range(ii)), Offsety+Radius*std::sin(range(ii)), -1e-3));
  48. }
  49. Tx1->SetPoint(ii, Vector3r(Offsetx+Radius*1, Offsety, -1e-3));
  50. Tx1->SetCurrent(1.);
  51. Tx1->SetNumberOfTurns(1);
  52. Tx1->SetNumberOfFrequencies(1);
  53. Tx1->SetFrequency(0,2500);
  54. return Tx1;
  55. }