Lemma is an Electromagnetics API
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.

AEMSurvey.cpp 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 09/24/2013 04:09:04 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@xri-geo.com
  14. * @copyright Copyright (c) 2013, XRI Geophysics, LLC
  15. * @copyright Copyright (c) 2013, Trevor Irons
  16. */
  17. #include "AEMSurvey.h"
  18. namespace Lemma {
  19. // ==================== FRIEND METHODS =====================
  20. std::ostream &operator<<(std::ostream &stream, const AEMSurvey &ob) {
  21. stream << *(LemmaObject*)(&ob);
  22. return stream;
  23. }
  24. // ==================== LIFECYCLE =======================
  25. //--------------------------------------------------------------------------------------
  26. // Class: AEMSurvey
  27. // Method: AEMSurvey
  28. // Description: constructor (protected)
  29. //--------------------------------------------------------------------------------------
  30. AEMSurvey::AEMSurvey (const std::string& name) : LemmaObject(name) {
  31. } // ----- end of method AEMSurvey::AEMSurvey (constructor) -----
  32. //--------------------------------------------------------------------------------------
  33. // Class: AEMSurvey
  34. // Method: New()
  35. // Description: public constructor
  36. //--------------------------------------------------------------------------------------
  37. AEMSurvey* AEMSurvey::New() {
  38. AEMSurvey* Obj = new AEMSurvey("AEMSurvey");
  39. Obj->AttachTo(Obj);
  40. return Obj;
  41. }
  42. //--------------------------------------------------------------------------------------
  43. // Class: AEMSurvey
  44. // Method: ~AEMSurvey
  45. // Description: destructor (protected)
  46. //--------------------------------------------------------------------------------------
  47. AEMSurvey::~AEMSurvey () {
  48. for (unsigned int isc=0; isc<Sources.size(); ++isc) Sources[isc]->Delete();
  49. } // ----- end of method AEMSurvey::~AEMSurvey (destructor) -----
  50. //--------------------------------------------------------------------------------------
  51. // Class: AEMSurvey
  52. // Method: Delete
  53. // Description: public destructor
  54. //--------------------------------------------------------------------------------------
  55. void AEMSurvey::Delete() {
  56. this->DetachFrom(this);
  57. }
  58. //--------------------------------------------------------------------------------------
  59. // Class: AEMSurvey
  60. // Method: Release
  61. // Description: destructor (protected)
  62. //--------------------------------------------------------------------------------------
  63. void AEMSurvey::Release() {
  64. delete this;
  65. }
  66. //--------------------------------------------------------------------------------------
  67. // Class: AEMSurvey
  68. // Method: GetSource
  69. //--------------------------------------------------------------------------------------
  70. DipoleSource* AEMSurvey::GetSource ( const int& isource ) {
  71. return Sources[isource] ;
  72. } // ----- end of method AEMSurvey::GetSource -----
  73. //--------------------------------------------------------------------------------------
  74. // Class: AEMSurvey
  75. // Method: GetFrequencies
  76. //--------------------------------------------------------------------------------------
  77. VectorXr AEMSurvey::GetFrequencies ( ) {
  78. return Freqs;
  79. } // ----- end of method AEMSurvey::GetFrequencies -----
  80. //--------------------------------------------------------------------------------------
  81. // Class: AEMSurvey
  82. // Method: GetNumberOfSources
  83. //--------------------------------------------------------------------------------------
  84. int AEMSurvey::GetNumberOfSources ( ) {
  85. return static_cast<int>(Sources.size());
  86. } // ----- end of method AEMSurvey::GetNumberOfSources -----
  87. } // ----- end of Lemma name -----