Surface NMR forward modelling
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.

LayeredEarthMR.h 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 08/28/2017 03:32:26 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2017, University of Utah
  15. * @copyright Copyright (c) 2017, Lemma Software, LLC
  16. */
  17. #ifndef LAYEREDEARTHMR_INC
  18. #define LAYEREDEARTHMR_INC
  19. #pragma once
  20. #include "LayeredEarth.h"
  21. #include "MerlinConfig.h"
  22. namespace Lemma {
  23. /**
  24. * \ingroup Merlin
  25. * \brief
  26. * \details
  27. */
  28. class LayeredEarthMR : public LayeredEarth {
  29. friend std::ostream &operator<<(std::ostream &stream, const LayeredEarthMR &ob);
  30. protected:
  31. /*
  32. * This key is used to lock the constructor. It is protected so that inhereted
  33. * classes also have the key to contruct their base class.
  34. */
  35. struct ctor_key {};
  36. public:
  37. // ==================== LIFECYCLE =======================
  38. /**
  39. * Default constructor.
  40. * @note This method is locked, and cannot be called directly.
  41. * The reason that the method is public is to enable the use
  42. * of make_shared whilst enforcing the use of shared_ptr,
  43. * in c++-17, this curiosity may be resolved.
  44. * @see LayeredEarthMR::NewSP
  45. */
  46. explicit LayeredEarthMR ( const ctor_key& );
  47. /**
  48. * DeSerializing constructor.
  49. * @note This method is locked, and cannot be called directly.
  50. * The reason that the method is public is to enable the use
  51. * of make_shared whilst enforcing the use of shared_ptr,
  52. * in c++-17, this curiosity may be resolved.
  53. * @see LayeredEarthMR::DeSerialize
  54. */
  55. LayeredEarthMR ( const YAML::Node& node, const ctor_key& );
  56. /**
  57. * Default destructor.
  58. * @note This method should never be called due to the mandated
  59. * use of smart pointers. It is necessary to keep the method
  60. * public in order to allow for the use of the more efficient
  61. * make_shared constructor.
  62. */
  63. virtual ~LayeredEarthMR ();
  64. /**
  65. * Uses YAML to serialize this object.
  66. * @return a YAML::Node
  67. * @see LayeredEarthMR::DeSerialize
  68. */
  69. virtual YAML::Node Serialize() const;
  70. /*
  71. * Factory method for generating concrete class.
  72. * @return a std::shared_ptr of type LayeredEarthMR
  73. */
  74. static std::shared_ptr< LayeredEarthMR > NewSP();
  75. /**
  76. * Constructs an LayeredEarthMR object from a YAML::Node.
  77. * @see LayeredEarthMR::Serialize
  78. */
  79. static std::shared_ptr<LayeredEarthMR> DeSerialize(const YAML::Node& node);
  80. // ==================== OPERATORS =======================
  81. // ==================== OPERATIONS =======================
  82. // ==================== ACCESS =======================
  83. void SetNumberOfLayers(const int& nlay);
  84. void SetT2StarBins(const Real& first, const Real& last, const int& nT2);
  85. // ==================== INQUIRY =======================
  86. /**
  87. * Returns the name of the underlying class, similiar to Python's type
  88. * @return string of class name
  89. */
  90. virtual inline std::string GetName() const {
  91. return CName;
  92. }
  93. protected:
  94. // ==================== LIFECYCLE =======================
  95. /** Copy is disabled */
  96. LayeredEarthMR( const LayeredEarthMR& ) = delete;
  97. // ==================== DATA MEMBERS =========================
  98. private:
  99. /** ASCII string representation of the class name */
  100. static constexpr auto CName = "LayeredEarthMR";
  101. VectorXr T2StarBins;
  102. VectorXr T2StarBinEdges; // Convenience for pcolor
  103. }; // ----- end of class LayeredEarthMR -----
  104. } // ----- end of namespace Lemma ----
  105. /* vim: set tabstop=4 expandtab: */
  106. /* vim: set filetype=cpp: */
  107. #endif // ----- #ifndef LAYEREDEARTHMR_INC -----