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.

ForwardFID.cpp 4.9KB

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 08/28/2017 09:03:03 AM
  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. #include "ForwardFID.h"
  18. namespace Lemma {
  19. // ==================== FRIEND METHODS =====================
  20. std::ostream &operator << (std::ostream &stream, const ForwardFID &ob) {
  21. stream << ob.Serialize() << "\n---\n"; // End of doc ---
  22. return stream;
  23. }
  24. // ==================== LIFECYCLE =======================
  25. //--------------------------------------------------------------------------------------
  26. // Class: ForwardFID
  27. // Method: ForwardFID
  28. // Description: constructor (locked)
  29. //--------------------------------------------------------------------------------------
  30. ForwardFID::ForwardFID (const ctor_key&) : MerlinObject( ) {
  31. } // ----- end of method ForwardFID::ForwardFID (constructor) -----
  32. //--------------------------------------------------------------------------------------
  33. // Class: ForwardFID
  34. // Method: ForwardFID
  35. // Description: DeSerializing constructor (locked)
  36. //--------------------------------------------------------------------------------------
  37. ForwardFID::ForwardFID (const YAML::Node& node, const ctor_key&) : MerlinObject(node) {
  38. } // ----- end of method ForwardFID::ForwardFID (constructor) -----
  39. //--------------------------------------------------------------------------------------
  40. // Class: ForwardFID
  41. // Method: NewSP()
  42. // Description: public constructor returing a shared_ptr
  43. //--------------------------------------------------------------------------------------
  44. std::shared_ptr< ForwardFID > ForwardFID::NewSP() {
  45. return std::make_shared< ForwardFID >( ctor_key() );
  46. }
  47. //--------------------------------------------------------------------------------------
  48. // Class: ForwardFID
  49. // Method: ~ForwardFID
  50. // Description: destructor (protected)
  51. //--------------------------------------------------------------------------------------
  52. ForwardFID::~ForwardFID () {
  53. } // ----- end of method ForwardFID::~ForwardFID (destructor) -----
  54. //--------------------------------------------------------------------------------------
  55. // Class: ForwardFID
  56. // Method: Serialize
  57. //--------------------------------------------------------------------------------------
  58. YAML::Node ForwardFID::Serialize ( ) const {
  59. YAML::Node node = MerlinObject::Serialize();
  60. node.SetTag( GetName() );
  61. // FILL IN CLASS SPECIFICS HERE
  62. if (Kernel != nullptr) {
  63. node["Kernel"] = Kernel->Serialize();
  64. }
  65. node["WindowEdges"] = WindowEdges;
  66. node["WindowCentres"] = WindowCentres;
  67. node["RDP"] = RDP;
  68. return node;
  69. } // ----- end of method ForwardFID::Serialize -----
  70. //--------------------------------------------------------------------------------------
  71. // Class: ForwardFID
  72. // Method: DeSerialize
  73. //--------------------------------------------------------------------------------------
  74. std::shared_ptr<ForwardFID> ForwardFID::DeSerialize ( const YAML::Node& node ) {
  75. if (node.Tag() != "ForwardFID" ) {
  76. throw DeSerializeTypeMismatch( "ForwardFID", node.Tag());
  77. }
  78. return std::make_shared< ForwardFID > ( node, ctor_key() );
  79. } // ----- end of method ForwardFID::DeSerialize -----
  80. //--------------------------------------------------------------------------------------
  81. // Class: ForwardFID
  82. // Method: SetWindowEdges
  83. //--------------------------------------------------------------------------------------
  84. void ForwardFID::SetWindowEdges ( const VectorXr& Edges ) {
  85. WindowEdges = Edges;
  86. return ;
  87. } // ----- end of method ForwardFID::SetWindowEdges -----
  88. //--------------------------------------------------------------------------------------
  89. // Class: ForwardFID
  90. // Method: ForwardModel
  91. //--------------------------------------------------------------------------------------
  92. std::shared_ptr<DataFID> ForwardFID::ForwardModel ( ) {
  93. auto FID = DataFID::NewSP();
  94. return FID;
  95. } // ----- end of method ForwardFID::ForwardModel -----
  96. } // ---- end of namespace Lemma ----
  97. /* vim: set tabstop=4 expandtab: */
  98. /* vim: set filetype=cpp: */