Surface NMR forward modelling
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

KernelV0.h 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 01:47:34 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. #ifndef KERNELV0_INC
  18. #define KERNELV0_INC
  19. #pragma once
  20. #include "LemmaObject.h"
  21. #include "LayeredEarthEM.h"
  22. #include "PolygonalWireAntenna.h"
  23. namespace Lemma {
  24. /**
  25. * \ingroup Merlin
  26. * \brief
  27. * \details
  28. */
  29. class KernelV0 : public LemmaObject {
  30. friend std::ostream &operator<<(std::ostream &stream, const KernelV0 &ob);
  31. protected:
  32. /*
  33. * This key is used to lock the constructor. It is protected so that inhereted
  34. * classes also have the key to contruct their base class.
  35. */
  36. struct ctor_key {};
  37. public:
  38. // ==================== LIFECYCLE =======================
  39. /**
  40. * Default constructor.
  41. * @note This method is locked, and cannot be called directly.
  42. * The reason that the method is public is to enable the use
  43. * of make_shared whilst enforcing the use of shared_ptr,
  44. * in c++-17, this curiosity may be resolved.
  45. * @see KernelV0::NewSP
  46. */
  47. explicit KernelV0 ( const ctor_key& );
  48. /**
  49. * DeSerializing constructor.
  50. * @note This method is locked, and cannot be called directly.
  51. * The reason that the method is public is to enable the use
  52. * of make_shared whilst enforcing the use of shared_ptr,
  53. * in c++-17, this curiosity may be resolved.
  54. * @see KernelV0::DeSerialize
  55. */
  56. KernelV0 ( const YAML::Node& node, const ctor_key& );
  57. /**
  58. * Default destructor.
  59. * @note This method should never be called due to the mandated
  60. * use of smart pointers. It is necessary to keep the method
  61. * public in order to allow for the use of the more efficient
  62. * make_shared constructor.
  63. */
  64. virtual ~KernelV0 ();
  65. /**
  66. * Uses YAML to serialize this object.
  67. * @return a YAML::Node
  68. * @see KernelV0::DeSerialize
  69. */
  70. virtual YAML::Node Serialize() const;
  71. /*
  72. * Factory method for generating concrete class.
  73. * @return a std::shared_ptr of type KernelV0
  74. */
  75. static std::shared_ptr< KernelV0 > NewSP();
  76. /**
  77. * Constructs an KernelV0 object from a YAML::Node.
  78. * @see KernelV0::Serialize
  79. */
  80. static std::shared_ptr<KernelV0> DeSerialize(const YAML::Node& node);
  81. // ==================== OPERATORS =======================
  82. // ==================== OPERATIONS =======================
  83. /**
  84. * @return std::shared_ptr<LayeredEarthEM>
  85. */
  86. inline std::shared_ptr<LayeredEarthEM> GetSigmaModel ( ) {
  87. return SigmaModel;
  88. } // ----- end of method KernelV0::get_SigmaModel -----
  89. /**
  90. * @param[in] value the 1D-EM model used for calculations
  91. */
  92. inline void SetLayeredEarthEM ( std::shared_ptr< LayeredEarthEM > value ) {
  93. SigmaModel = value;
  94. return ;
  95. } // ----- end of method KernelV0::set_SigmaModel -----
  96. /**
  97. * Assign transmiter coils
  98. */
  99. inline void PushCoil( const std::string& label, std::shared_ptr<PolygonalWireAntenna> ant ) {
  100. TxRx[label] = ant;
  101. }
  102. /**
  103. * Calculates a single imaging kernel, however, phased arrays are supported
  104. * so that more than one transmitter and/or receiver can be specified.
  105. * @param[in]
  106. */
  107. void CalculateK0 (const std::vector< std::string >& tx, const std::vector< std::string >& rx );
  108. // ==================== INQUIRY =======================
  109. /**
  110. * Returns the name of the underlying class, similiar to Python's type
  111. * @return string of class name
  112. */
  113. virtual inline std::string GetName() const {
  114. return CName;
  115. }
  116. protected:
  117. // ==================== LIFECYCLE =======================
  118. /** Copy is disabled */
  119. KernelV0( const KernelV0& ) = delete;
  120. private:
  121. void IntegrateOnOctreeGrid( const Real& tolerance );
  122. void EvaluateKids();
  123. void EvaluateKids( const Complex& parentVal );
  124. // ==================== DATA MEMBERS =========================
  125. std::shared_ptr< LayeredEarthEM > SigmaModel = nullptr;
  126. std::map< std::string , std::shared_ptr< PolygonalWireAntenna > > TxRx;
  127. /** ASCII string representation of the class name */
  128. static constexpr auto CName = "KernelV0";
  129. }; // ----- end of class KernelV0 -----
  130. } // ----- end of namespace Lemma ----
  131. /* vim: set tabstop=4 expandtab */
  132. /* vim: set filetype=cpp */
  133. #endif // ----- #ifndef KERNELV0_INC -----