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.

ChargedWellCasing.h 4.6KB

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