Main Lemma Repository
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.

CircularLoop.h 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 02/01/2018 10:24:02 AM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2018, University of Utah
  15. * @copyright Copyright (c) 2018, Lemma Software, LLC
  16. */
  17. #ifndef CIRCULARLOOP_INC
  18. #define CIRCULARLOOP_INC
  19. #pragma once
  20. #include "CompactSupportEMSource.h"
  21. namespace Lemma {
  22. /**
  23. * \ingroup FDEM1D
  24. * \brief Analytic solution of a circular loop.
  25. * \details This specialized class provides the EM response of a circular loop on the surface of the earth.
  26. * More general use cases can use PolygonalWireAntenna.
  27. */
  28. class CircularLoop : public CompactSupportEMSource {
  29. friend std::ostream &operator<<(std::ostream &stream, const CircularLoop &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 CircularLoop::NewSP
  45. */
  46. explicit CircularLoop ( 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 CircularLoop::DeSerialize
  54. */
  55. CircularLoop ( 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 ~CircularLoop ();
  64. /**
  65. * Uses YAML to serialize this object.
  66. * @return a YAML::Node
  67. * @see CircularLoop::DeSerialize
  68. */
  69. virtual YAML::Node Serialize() const;
  70. /*
  71. * Factory method for generating concrete class.
  72. * @return a std::shared_ptr of type CircularLoop
  73. */
  74. static std::shared_ptr< CircularLoop > NewSP();
  75. /**
  76. * Constructs an CircularLoop object from a YAML::Node.
  77. * @see CircularLoop::Serialize
  78. */
  79. static std::shared_ptr<CircularLoop> DeSerialize(const YAML::Node& node);
  80. // ==================== OPERATORS =======================
  81. // ==================== OPERATIONS =======================
  82. // ==================== ACCESS =======================
  83. // ==================== INQUIRY =======================
  84. /**
  85. * Returns the name of the underlying class, similiar to Python's type
  86. * @return string of class name
  87. */
  88. virtual inline std::string GetName() const {
  89. return CName;
  90. }
  91. protected:
  92. // ==================== LIFECYCLE =======================
  93. /** Copy is disabled */
  94. CircularLoop( const CircularLoop& ) = delete;
  95. // ==================== DATA MEMBERS =========================
  96. private:
  97. /** ASCII string representation of the class name */
  98. static constexpr auto CName = "CircularLoop";
  99. }; // ----- end of class CircularLoop -----
  100. } // ----- end of namespace Lemma ----
  101. /* vim: set tabstop=4 expandtab: */
  102. /* vim: set filetype=cpp: */
  103. #endif // ----- #ifndef CIRCULARLOOP_INC -----