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.

DCIPElectrode.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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/10/2014 10:53:34 AM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@xri-geo.com
  14. * @copyright Copyright (c) 2014, XRI Geophysics, LLC
  15. * @copyright Copyright (c) 2014, Trevor Irons
  16. */
  17. #ifndef DCIPELECTRODE_INC
  18. #define DCIPELECTRODE_INC
  19. #include "LemmaObject.h"
  20. namespace Lemma {
  21. /**
  22. \brief Describes the location of an electrode used in a DC/IP survey
  23. \details This class is used together with FEM4EllipticPDE to solve DC/IP
  24. problems.
  25. */
  26. class DCIPElectrode : public LemmaObject {
  27. friend std::ostream &operator<<(std::ostream &stream,
  28. const DCIPElectrode &ob);
  29. public:
  30. // ==================== LIFECYCLE =======================
  31. /**
  32. * \brief Returns new shared pointer to DCIP object.
  33. * \details Use this method, as the default constructor is locked.
  34. */
  35. static std::shared_ptr<DCIPElectrode> NewSP();
  36. /**
  37. * Uses YAML to serialize this object.
  38. * @return a YAML::Node
  39. */
  40. YAML::Node Serialize() const;
  41. /**
  42. * Constructs an object from a YAML::Node.
  43. */
  44. static std::shared_ptr<DCIPElectrode> DeSerialize(const YAML::Node& node);
  45. /** Default protected constructor, use New */
  46. explicit DCIPElectrode (const ctor_key& key);
  47. /** Protected DeDerializing constructor, use factory DeSerialize method*/
  48. DCIPElectrode (const YAML::Node& node, const ctor_key& key);
  49. /** Default protected destructor, use Delete */
  50. virtual ~DCIPElectrode ();
  51. // ==================== OPERATORS =======================
  52. // ==================== OPERATIONS =======================
  53. // ==================== ACCESS =======================
  54. /** Sets the physical location of the electrode
  55. * @param[in] loc is the location
  56. */
  57. void SetLocation(const Vector3r& loc);
  58. /** Sets the tag (label) for the electrode
  59. */
  60. void SetLabel(const std::string& tag);
  61. /** Sets the tag (label) for the electrode
  62. */
  63. std::string GetLabel( );
  64. int GetNodeID() {return Node_ID;}
  65. // ==================== INQUIRY =======================
  66. /** Returns the name of the underlying class, similiar to Python's type */
  67. virtual std::string GetName() const {
  68. return this->CName;
  69. }
  70. protected:
  71. // ==================== LIFECYCLE =======================
  72. private:
  73. // ==================== DATA MEMBERS =========================
  74. /** ASCII string representation of the class name */
  75. static constexpr auto CName = "DCIPElectrode";
  76. /** no copy */
  77. DCIPElectrode ( const DCIPElectrode& ) = delete;
  78. /** The location of the electrode */
  79. Vector3r Location;
  80. /** Local Node_ID on a mesh */
  81. int Node_ID;
  82. /** String label for the electrode */
  83. std::string Label;
  84. }; // ----- end of class DCIPElectrode -----
  85. } // ----- end of Lemma name -----
  86. #endif // ----- #ifndef DCIPELECTRODE_INC -----