Lemma is an Electromagnetics API
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CircularLoop.cpp 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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:45:39 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. #include "CircularLoop.h"
  18. namespace Lemma {
  19. // ==================== FRIEND METHODS =====================
  20. std::ostream &operator << (std::ostream &stream, const CircularLoop &ob) {
  21. stream << ob.Serialize() << "\n---\n"; // End of doc ---
  22. return stream;
  23. }
  24. // ==================== LIFECYCLE =======================
  25. //--------------------------------------------------------------------------------------
  26. // Class: CircularLoop
  27. // Method: CircularLoop
  28. // Description: constructor (locked)
  29. //--------------------------------------------------------------------------------------
  30. CircularLoop::CircularLoop (const ctor_key&) : CompactSupportEMSource( CompactSupportEMSource::ctor_key() ) {
  31. } // ----- end of method CircularLoop::CircularLoop (constructor) -----
  32. //--------------------------------------------------------------------------------------
  33. // Class: CircularLoop
  34. // Method: CircularLoop
  35. // Description: DeSerializing constructor (locked)
  36. //--------------------------------------------------------------------------------------
  37. CircularLoop::CircularLoop (const YAML::Node& node, const ctor_key&) : CompactSupportEMSource(node, CompactSupportEMSource::ctor_key()) {
  38. } // ----- end of method CircularLoop::CircularLoop (constructor) -----
  39. //--------------------------------------------------------------------------------------
  40. // Class: CircularLoop
  41. // Method: NewSP()
  42. // Description: public constructor returing a shared_ptr
  43. //--------------------------------------------------------------------------------------
  44. std::shared_ptr< CircularLoop > CircularLoop::NewSP() {
  45. return std::make_shared< CircularLoop >( ctor_key() );
  46. }
  47. //--------------------------------------------------------------------------------------
  48. // Class: CircularLoop
  49. // Method: ~CircularLoop
  50. // Description: destructor (protected)
  51. //--------------------------------------------------------------------------------------
  52. CircularLoop::~CircularLoop () {
  53. } // ----- end of method CircularLoop::~CircularLoop (destructor) -----
  54. //--------------------------------------------------------------------------------------
  55. // Class: CircularLoop
  56. // Method: Serialize
  57. //--------------------------------------------------------------------------------------
  58. YAML::Node CircularLoop::Serialize ( ) const {
  59. YAML::Node node = CompactSupportEMSource::Serialize();
  60. node.SetTag( GetName() );
  61. // FILL IN CLASS SPECIFICS HERE
  62. return node;
  63. } // ----- end of method CircularLoop::Serialize -----
  64. //--------------------------------------------------------------------------------------
  65. // Class: CircularLoop
  66. // Method: DeSerialize
  67. //--------------------------------------------------------------------------------------
  68. std::shared_ptr<CircularLoop> CircularLoop::DeSerialize ( const YAML::Node& node ) {
  69. if (node.Tag() != "CircularLoop" ) {
  70. throw DeSerializeTypeMismatch( "CircularLoop", node.Tag());
  71. }
  72. return std::make_shared< CircularLoop > ( node, ctor_key() );
  73. } // ----- end of method CircularLoop::DeSerialize -----
  74. } // ---- end of namespace Lemma ----
  75. /* vim: set tabstop=4 expandtab: */
  76. /* vim: set filetype=cpp: */