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.

receivercubes.h 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /* This file is part of Lemma, a geophysical modelling and inversion API */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /**
  6. @file
  7. @author Trevor Irons
  8. @date 06/17/2010
  9. @version $Id: receivercubes.h 193 2014-11-10 23:51:41Z tirons $
  10. **/
  11. #ifndef RECEIVERCUBES_INC
  12. #define RECEIVERCUBES_INC
  13. #include "receiverpoints.h"
  14. namespace Lemma {
  15. // ===================================================================
  16. // Class: ReceiverCubes
  17. /** This class builds on Reciver points, but supports a cube around
  18. * each point. It is a direct descendent and may be used wherever
  19. * ReceiverPoints is used
  20. */
  21. // ===================================================================
  22. class ReceiverCubes : public ReceiverPoints {
  23. friend std::ostream &operator<<(std::ostream &stream,
  24. const ReceiverCubes &ob);
  25. friend class EmDipEarth1D;
  26. public:
  27. // ==================== LIFECYCLE =======================
  28. /**
  29. * Returns pointer to new DipoleSource. Location is
  30. * initialized to (0,0,0) type and polarization are
  31. * initialized to nonworking values that will throw
  32. * exceptions if used.
  33. */
  34. static ReceiverCubes* New();
  35. /**
  36. * @copybrief LemmaObject::Delete()
  37. * @copydetails LemmaObject::Delete()
  38. */
  39. void Delete();
  40. // ==================== OPERATORS =======================
  41. // ==================== OPERATIONS =======================
  42. /** Sets the number of reciver cubes.
  43. * This method also resizes all the dynamic vectors in the class
  44. * to support this size.
  45. * @param[in] nrec is the number of cubes in the class.
  46. */
  47. void SetNumberOfReceivers(const int &nrec);
  48. /** Sets the length of the x dimension of a single cube.
  49. * @param[in] i is the cube number.
  50. * @param[in] lx is the length of this cube, in this dimension.
  51. */
  52. void SetLengthX(const int &i, const Real &lx);
  53. /** Sets the length of the y dimension of a single cube.
  54. * @param[in] i is the cube number.
  55. * @param[in] ly is the length of this cube, in this dimension.
  56. */
  57. void SetLengthY(const int &i, const Real &ly);
  58. /** Sets the length of the z dimension of a single cube.
  59. * @param[in] i is the cube number.
  60. * @param[in] lz is the length of this cube, in this dimension.
  61. */
  62. void SetLengthZ(const int &i, const Real &lz);
  63. /** Sets the lengths of all three dimensions of a single cube.
  64. * @param[in] i is the cube number.
  65. * @param[in] lx is the length of this cube, in this dimension.
  66. * @param[in] ly is the length of this cube, in this dimension.
  67. * @param[in] lz is the length of this cube, in this dimension.
  68. */
  69. void SetLength(const int &i, const Real& lx, const Real& ly,
  70. const Real &lz);
  71. /** Sets the length of the x dimension of a single cube.
  72. * @param[in] i is the cube number.
  73. * @param[in] V is a vector of lenths.
  74. */
  75. void SetLength(const int &i, const Vector3r &V);
  76. /** Gets the x dimension of cube i
  77. * @param[in] i is the cube in quesion
  78. * @return The legth of the x dimension of cube i
  79. */
  80. Real GetLengthX(const int &i);
  81. /** Gets the y dimension of cube i
  82. * @param[in] i is the cube in quesion
  83. * @return The length of the y dimension of cube i
  84. */
  85. Real GetLengthY(const int &i);
  86. /** Gets the z dimension of cube i
  87. * @param[in] i is the cube in quesion
  88. * @return The length of the z dimension of cube i
  89. */
  90. Real GetLengthZ(const int &i);
  91. /** Gets the z dimension of cube i
  92. * @param[in] i is the cube in quesion
  93. * @return A vector of the lengths of the cube
  94. */
  95. Vector3r GetLength(const int& i);
  96. /** Returns the volume of a cube
  97. * @param[in] i is the cube of interest
  98. * @return is the volume
  99. */
  100. Real GetVolume(const int&i);
  101. /** Returns the volume of all the receiver cubes.
  102. */
  103. Real GetVolumeSum();
  104. // ==================== ACCESS =======================
  105. // ==================== INQUIRY =======================
  106. // Returns the volume of a cube.
  107. //Real GetCubeVolume(const int&i);
  108. //VectorXr GetCubeVolumes();
  109. protected:
  110. // ==================== LIFECYCLE =======================
  111. /// Default protected constructor.
  112. ReceiverCubes (const std::string &name);
  113. /// Default protected constructor.
  114. ~ReceiverCubes ();
  115. /**
  116. * @copybrief LemmaObject::Release()
  117. * @copydetails LemmaObject::Release()
  118. */
  119. void Release();
  120. // ==================== DATA MEMBERS =========================
  121. /// Dimension of each cube stored here, first indice is x, second y, and
  122. /// third z
  123. Vector3Xr Lengths;
  124. private:
  125. }; // ----- end of class ReceiverCubes -----
  126. } // ----- end of Lemma name -----
  127. #endif // ----- #ifndef RECEIVERCUBES_INC -----