fullwave25 1.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fullwave25 might be problematic. Click here for more details.

Files changed (225) hide show
  1. fullwave/__init__.py +28 -0
  2. fullwave/constants/__init__.py +5 -0
  3. fullwave/constants/material_properties.py +112 -0
  4. fullwave/grid.py +222 -0
  5. fullwave/medium.py +1042 -0
  6. fullwave/medium_builder/__init__.py +12 -0
  7. fullwave/medium_builder/domain.py +151 -0
  8. fullwave/medium_builder/medium_builder.py +198 -0
  9. fullwave/medium_builder/presets/__init__.py +8 -0
  10. fullwave/medium_builder/presets/data/.keep +0 -0
  11. fullwave/medium_builder/presets/data/abdominal_wall/i2365f_etfw1.mat +0 -0
  12. fullwave/medium_builder/presets/domain_abdominal_wall.py +293 -0
  13. fullwave/medium_builder/presets/domain_background.py +140 -0
  14. fullwave/medium_builder/presets/domain_scatterer.py +179 -0
  15. fullwave/medium_builder/presets/domain_simple.py +92 -0
  16. fullwave/medium_builder/presets/domain_water_gel.py +1 -0
  17. fullwave/sensor.py +161 -0
  18. fullwave/solver/__init__.py +1 -0
  19. fullwave/solver/bins/database/relaxation_params_database_num_relax=2_20251027_1437.mat +0 -0
  20. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenu +0 -0
  21. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_100_cuda129 +0 -0
  22. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_101_cuda129 +0 -0
  23. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_120_cuda129 +0 -0
  24. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda118 +0 -0
  25. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda124 +0 -0
  26. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda126 +0 -0
  27. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda129 +0 -0
  28. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda118 +0 -0
  29. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda124 +0 -0
  30. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda126 +0 -0
  31. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda129 +0 -0
  32. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda118 +0 -0
  33. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda124 +0 -0
  34. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda126 +0 -0
  35. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda129 +0 -0
  36. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda118 +0 -0
  37. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda124 +0 -0
  38. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda126 +0 -0
  39. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda129 +0 -0
  40. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda118 +0 -0
  41. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda124 +0 -0
  42. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda126 +0 -0
  43. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda129 +0 -0
  44. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda118 +0 -0
  45. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda126 +0 -0
  46. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda129 +0 -0
  47. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda118 +0 -0
  48. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda124 +0 -0
  49. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda126 +0 -0
  50. fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda129 +0 -0
  51. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_100_cuda129 +0 -0
  52. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_101_cuda129 +0 -0
  53. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_120_cuda129 +0 -0
  54. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda118 +0 -0
  55. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda124 +0 -0
  56. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda126 +0 -0
  57. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda129 +0 -0
  58. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda118 +0 -0
  59. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda124 +0 -0
  60. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda126 +0 -0
  61. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda129 +0 -0
  62. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda118 +0 -0
  63. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda124 +0 -0
  64. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda126 +0 -0
  65. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda129 +0 -0
  66. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda118 +0 -0
  67. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda124 +0 -0
  68. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda126 +0 -0
  69. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda129 +0 -0
  70. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda118 +0 -0
  71. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda124 +0 -0
  72. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda126 +0 -0
  73. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda129 +0 -0
  74. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda118 +0 -0
  75. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda124 +0 -0
  76. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda126 +0 -0
  77. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda129 +0 -0
  78. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda118 +0 -0
  79. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda124 +0 -0
  80. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda126 +0 -0
  81. fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda129 +0 -0
  82. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_100_cuda129 +0 -0
  83. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_101_cuda129 +0 -0
  84. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_120_cuda129 +0 -0
  85. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda118 +0 -0
  86. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda124 +0 -0
  87. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda126 +0 -0
  88. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda129 +0 -0
  89. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda118 +0 -0
  90. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda124 +0 -0
  91. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda126 +0 -0
  92. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda129 +0 -0
  93. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda118 +0 -0
  94. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda124 +0 -0
  95. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda126 +0 -0
  96. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda129 +0 -0
  97. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda118 +0 -0
  98. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda124 +0 -0
  99. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda126 +0 -0
  100. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda129 +0 -0
  101. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda118 +0 -0
  102. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda124 +0 -0
  103. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda126 +0 -0
  104. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda129 +0 -0
  105. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda118 +0 -0
  106. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda124 +0 -0
  107. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda126 +0 -0
  108. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda129 +0 -0
  109. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda118 +0 -0
  110. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda124 +0 -0
  111. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda126 +0 -0
  112. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda129 +0 -0
  113. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_100_cuda129 +0 -0
  114. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_101_cuda129 +0 -0
  115. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_120_cuda129 +0 -0
  116. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda118 +0 -0
  117. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda124 +0 -0
  118. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda126 +0 -0
  119. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda129 +0 -0
  120. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda118 +0 -0
  121. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda124 +0 -0
  122. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda126 +0 -0
  123. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda129 +0 -0
  124. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda118 +0 -0
  125. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda124 +0 -0
  126. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda126 +0 -0
  127. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda129 +0 -0
  128. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda118 +0 -0
  129. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda124 +0 -0
  130. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda126 +0 -0
  131. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda129 +0 -0
  132. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda118 +0 -0
  133. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda124 +0 -0
  134. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda126 +0 -0
  135. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda129 +0 -0
  136. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda118 +0 -0
  137. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda124 +0 -0
  138. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda126 +0 -0
  139. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda129 +0 -0
  140. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda118 +0 -0
  141. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda124 +0 -0
  142. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda126 +0 -0
  143. fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda129 +0 -0
  144. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_100_cuda129 +0 -0
  145. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_101_cuda129 +0 -0
  146. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_120_cuda129 +0 -0
  147. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda118 +0 -0
  148. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda124 +0 -0
  149. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda126 +0 -0
  150. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda129 +0 -0
  151. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda118 +0 -0
  152. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda124 +0 -0
  153. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda126 +0 -0
  154. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda129 +0 -0
  155. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda118 +0 -0
  156. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda124 +0 -0
  157. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda126 +0 -0
  158. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda129 +0 -0
  159. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda118 +0 -0
  160. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda124 +0 -0
  161. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda126 +0 -0
  162. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda129 +0 -0
  163. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda118 +0 -0
  164. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda124 +0 -0
  165. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda126 +0 -0
  166. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda129 +0 -0
  167. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda118 +0 -0
  168. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda124 +0 -0
  169. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda126 +0 -0
  170. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda129 +0 -0
  171. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda118 +0 -0
  172. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda124 +0 -0
  173. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda126 +0 -0
  174. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda129 +0 -0
  175. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_100_cuda129 +0 -0
  176. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_101_cuda129 +0 -0
  177. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_120_cuda129 +0 -0
  178. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda118 +0 -0
  179. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda124 +0 -0
  180. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda126 +0 -0
  181. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda129 +0 -0
  182. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda118 +0 -0
  183. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda124 +0 -0
  184. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda126 +0 -0
  185. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda129 +0 -0
  186. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda118 +0 -0
  187. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda124 +0 -0
  188. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda126 +0 -0
  189. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda129 +0 -0
  190. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda118 +0 -0
  191. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda124 +0 -0
  192. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda126 +0 -0
  193. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda129 +0 -0
  194. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda118 +0 -0
  195. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda124 +0 -0
  196. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda126 +0 -0
  197. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda129 +0 -0
  198. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda118 +0 -0
  199. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda124 +0 -0
  200. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda126 +0 -0
  201. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda129 +0 -0
  202. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda118 +0 -0
  203. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda124 +0 -0
  204. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda126 +0 -0
  205. fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda129 +0 -0
  206. fullwave/solver/cuda_utils.py +392 -0
  207. fullwave/solver/input_file_writer.py +853 -0
  208. fullwave/solver/launcher.py +134 -0
  209. fullwave/solver/pml_builder.py +1923 -0
  210. fullwave/solver/solver.py +750 -0
  211. fullwave/solver/utils.py +83 -0
  212. fullwave/source.py +173 -0
  213. fullwave/transducer.py +1003 -0
  214. fullwave/utils/__init__.py +12 -0
  215. fullwave/utils/check_functions.py +48 -0
  216. fullwave/utils/coordinates.py +155 -0
  217. fullwave/utils/memory_tempfile.py +439 -0
  218. fullwave/utils/numerical.py +111 -0
  219. fullwave/utils/plot_utils.py +1122 -0
  220. fullwave/utils/pulse.py +72 -0
  221. fullwave/utils/relaxation_parameters.py +212 -0
  222. fullwave/utils/signal_process.py +197 -0
  223. fullwave25-1.0.7.dist-info/METADATA +292 -0
  224. fullwave25-1.0.7.dist-info/RECORD +225 -0
  225. fullwave25-1.0.7.dist-info/WHEEL +4 -0
@@ -0,0 +1,140 @@
1
+ """background domain."""
2
+
3
+ from pathlib import Path
4
+
5
+ import numpy as np
6
+ from numpy.typing import NDArray
7
+
8
+ from fullwave import Grid
9
+ from fullwave.constants import MaterialProperties
10
+ from fullwave.medium_builder import Domain
11
+
12
+
13
+ class BackgroundDomain(Domain):
14
+ """represents the base medium properties for the simulation."""
15
+
16
+ def __init__(
17
+ self,
18
+ grid: Grid,
19
+ background_property_name: str | None = None,
20
+ material_properties: MaterialProperties | None = None,
21
+ *,
22
+ path_relaxation_parameters_database: Path = Path(__file__).parent.parent
23
+ / "solver"
24
+ / "bins"
25
+ / "database"
26
+ / "relaxation_params_database_num_relax=2_20251027_1437.mat",
27
+ n_relaxation_mechanisms: int = 2,
28
+ ) -> None:
29
+ """Initialize a Background instance.
30
+
31
+ Parameters
32
+ ----------
33
+ grid: Grid
34
+ Grid instance.
35
+ background_property_name: str, optional
36
+ Background property name.
37
+ Defaults to None.
38
+ material_properties: MaterialProperties, optional
39
+ Material properties.
40
+ Defaults to MaterialProperties().
41
+ path_relaxation_parameters_database: (Path, optional)
42
+ The path to the relaxation parameters database.
43
+ n_relaxation_mechanisms: (int, optional)
44
+ The number of relaxation mechanisms.
45
+
46
+ """
47
+ self.background_property_name = background_property_name
48
+ if material_properties is None:
49
+ self.material_properties: MaterialProperties = MaterialProperties()
50
+ else:
51
+ self.material_properties = material_properties
52
+
53
+ super().__init__(
54
+ name="background",
55
+ grid=grid,
56
+ path_relaxation_parameters_database=path_relaxation_parameters_database,
57
+ n_relaxation_mechanisms=n_relaxation_mechanisms,
58
+ )
59
+
60
+ def _setup_base_geometry(self) -> NDArray[np.float64]:
61
+ if self.is_3d:
62
+ return np.ones((self.nx, self.ny, self.nz))
63
+ return np.ones((self.nx, self.ny))
64
+
65
+ def _setup_sound_speed(self) -> NDArray[np.float64]:
66
+ base_map: NDArray[np.float64]
67
+ if self.is_3d:
68
+ base_map = np.ones((self.nx, self.ny, self.nz))
69
+ else:
70
+ base_map = np.ones((self.nx, self.ny))
71
+ if self.background_property_name is not None:
72
+ sound_speed = (
73
+ base_map
74
+ * getattr(self.material_properties, self.background_property_name)["sound_speed"]
75
+ )
76
+ else:
77
+ sound_speed = base_map * self.material_properties.sound_speed
78
+ return sound_speed
79
+
80
+ def _setup_density(self) -> NDArray[np.float64]:
81
+ base_map: NDArray[np.float64]
82
+ if self.is_3d:
83
+ base_map = np.ones((self.nx, self.ny, self.nz))
84
+ else:
85
+ base_map = np.ones((self.nx, self.ny))
86
+ if self.background_property_name is not None:
87
+ density = (
88
+ base_map
89
+ * getattr(self.material_properties, self.background_property_name)["density"]
90
+ )
91
+ else:
92
+ density = base_map * self.material_properties.density
93
+ return density
94
+
95
+ def _setup_alpha_coeff(self) -> NDArray[np.float64]:
96
+ base_map: NDArray[np.float64]
97
+ if self.is_3d:
98
+ base_map = np.ones((self.nx, self.ny, self.nz))
99
+ else:
100
+ base_map = np.ones((self.nx, self.ny))
101
+
102
+ if self.background_property_name is not None:
103
+ alpha_coeff = (
104
+ base_map
105
+ * getattr(self.material_properties, self.background_property_name)["alpha_coeff"]
106
+ )
107
+ else:
108
+ alpha_coeff = base_map * self.material_properties.alpha_coeff
109
+ return alpha_coeff
110
+
111
+ def _setup_alpha_power(self) -> NDArray[np.float64]:
112
+ base_map: NDArray[np.float64]
113
+ if self.is_3d:
114
+ base_map = np.ones((self.nx, self.ny, self.nz))
115
+ else:
116
+ base_map = np.ones((self.nx, self.ny))
117
+
118
+ if self.background_property_name is not None:
119
+ alpha_power = (
120
+ base_map
121
+ * getattr(self.material_properties, self.background_property_name)["alpha_power"]
122
+ )
123
+ else:
124
+ alpha_power = base_map * self.material_properties.alpha_power
125
+ return alpha_power
126
+
127
+ def _setup_beta(self) -> NDArray[np.float64]:
128
+ base_map: NDArray[np.float64]
129
+ if self.is_3d:
130
+ base_map = np.ones((self.nx, self.ny, self.nz))
131
+ else:
132
+ base_map = np.ones((self.nx, self.ny))
133
+
134
+ if self.background_property_name is not None:
135
+ beta = (
136
+ base_map * getattr(self.material_properties, self.background_property_name)["beta"]
137
+ )
138
+ else:
139
+ beta = base_map * self.material_properties.beta
140
+ return beta
@@ -0,0 +1,179 @@
1
+ """scatterer domain."""
2
+
3
+ from pathlib import Path
4
+
5
+ import numpy as np
6
+ from numpy.typing import NDArray
7
+
8
+ from fullwave import Grid
9
+ from fullwave.constants import MaterialProperties
10
+ from fullwave.medium_builder import Domain
11
+ from fullwave.utils import check_functions
12
+
13
+
14
+ class ScattererDomain(Domain):
15
+ """represents the base medium properties for the simulation."""
16
+
17
+ def __init__(
18
+ self,
19
+ grid: Grid,
20
+ num_scatterer: int,
21
+ ncycles: int,
22
+ material_properties: MaterialProperties | None = None,
23
+ *,
24
+ path_relaxation_parameters_database: Path = Path(__file__).parent.parent
25
+ / "solver"
26
+ / "bins"
27
+ / "database"
28
+ / "relaxation_params_database_num_relax=2_20251027_1437.mat",
29
+ n_relaxation_mechanisms: int = 2,
30
+ seed: int | None = None,
31
+ ) -> None:
32
+ """Initialize a Background instance.
33
+
34
+ Parameters
35
+ ----------
36
+ grid : Grid
37
+ Grid instance.
38
+ num_scatterer : int
39
+ Number of scatterer per resolution cell.
40
+ ncycles : int
41
+ Number of cycles for the transmit pulse.
42
+ material_properties: MaterialProperties, optional
43
+ Material properties.
44
+ Defaults to MaterialProperties().
45
+ path_relaxation_parameters_database: (Path, optional)
46
+ The path to the relaxation parameters database.
47
+ n_relaxation_mechanisms: (int, optional)
48
+ The number of relaxation mechanisms.
49
+ seed: (int, optional)
50
+ Random seed for scatterer generation.
51
+
52
+ """
53
+ check_functions.check_instance(grid, Grid)
54
+ self.grid = grid
55
+ self.is_3d = grid.is_3d
56
+ self.nx = grid.nx
57
+ self.ny = grid.ny
58
+ if self.is_3d:
59
+ self.nz = grid.nz
60
+ self.path_relaxation_parameters_database = path_relaxation_parameters_database
61
+ self.n_relaxation_mechanisms = n_relaxation_mechanisms
62
+
63
+ if material_properties is None:
64
+ self.material_properties: MaterialProperties = MaterialProperties()
65
+ else:
66
+ self.material_properties = material_properties
67
+
68
+ self.num_scatterer = num_scatterer
69
+ self.ncycles = ncycles
70
+
71
+ self.seed = seed
72
+ self.rng = np.random.default_rng(self.seed)
73
+
74
+ self.base_geometry = self._setup_base_geometry()
75
+
76
+ self.scatterer_map, self.scatterer_count, self.scatterer_percent = self._setup_scatter_map()
77
+
78
+ self.sound_speed = self._setup_sound_speed()
79
+ self.density = self._setup_density()
80
+ self.alpha_coeff = self._setup_alpha_coeff()
81
+ self.alpha_power = self._setup_alpha_power()
82
+ self.beta = self._setup_beta()
83
+
84
+ self.air = self._setup_air()
85
+
86
+ def _setup_base_geometry(self) -> NDArray[np.float64]:
87
+ if self.is_3d:
88
+ return np.ones((self.nx, self.ny, self.nz))
89
+ return np.ones((self.nx, self.ny))
90
+
91
+ def _setup_sound_speed(self) -> NDArray[np.float64]:
92
+ if self.is_3d:
93
+ return np.zeros((self.nx, self.ny, self.nz))
94
+ return np.zeros((self.nx, self.ny))
95
+
96
+ def _setup_density(self) -> NDArray[np.float64]:
97
+ return self.scatterer_map * self.material_properties.density
98
+
99
+ def _setup_alpha_coeff(self) -> NDArray[np.float64]:
100
+ if self.is_3d:
101
+ return np.zeros((self.nx, self.ny, self.nz))
102
+ return np.zeros((self.nx, self.ny))
103
+
104
+ def _setup_alpha_power(self) -> NDArray[np.float64]:
105
+ if self.is_3d:
106
+ return np.zeros((self.nx, self.ny, self.nz))
107
+ return np.zeros((self.nx, self.ny))
108
+
109
+ def _setup_beta(self) -> NDArray[np.float64]:
110
+ if self.is_3d:
111
+ return np.zeros((self.nx, self.ny, self.nz))
112
+ return np.zeros((self.nx, self.ny))
113
+
114
+ def _setup_scatter_map(
115
+ self,
116
+ ) -> tuple[NDArray[np.float64], int, float]:
117
+ # if self.is_3d:
118
+ # res_cell = self._rescell3ds(
119
+ # self.grid.wavelength,
120
+ # self.grid.ny / 2 * self.grid.dy,
121
+ # self.grid.domain_size[1],
122
+ # self.ncycles,
123
+ # self.grid.dx,
124
+ # self.grid.dy,
125
+ # self.grid.dz,
126
+ # )
127
+ # else:
128
+ res_cell = self._rescell2ds(
129
+ self.grid.wavelength,
130
+ self.grid.ny / 2 * self.grid.dy,
131
+ self.grid.domain_size[1],
132
+ self.ncycles,
133
+ self.grid.dx,
134
+ self.grid.dy,
135
+ )
136
+ scat_density = self.num_scatterer / res_cell
137
+
138
+ if self.is_3d:
139
+ scatter_map = self.rng.random((self.grid.nx, self.grid.ny, self.grid.nz))
140
+ else:
141
+ scatter_map = self.rng.random((self.grid.nx, self.grid.ny))
142
+
143
+ scatter_map /= scat_density
144
+ scatter_map[scatter_map > 1] = 0.5
145
+ scatter_map -= -0.5
146
+
147
+ scatterer_count = len(scatter_map != 0)
148
+ scatterer_percent = 100 * scatterer_count / (scatter_map.shape[0] * scatter_map.shape[0])
149
+
150
+ scatter_map *= self.base_geometry
151
+ return scatter_map, scatterer_count, scatterer_percent
152
+
153
+ def _rescell2ds(
154
+ self,
155
+ wavelength: float,
156
+ dy2: float, # ?
157
+ ay: float,
158
+ n_cycles: int,
159
+ dy: float,
160
+ dz: float,
161
+ ) -> float:
162
+ res_y = wavelength * dy2 / ay
163
+ res_z = wavelength * n_cycles / 2
164
+ return res_y / dy * res_z / dz
165
+
166
+ def _rescell3ds(
167
+ self,
168
+ wavelength: float,
169
+ dy2: float, # ?
170
+ ay: float,
171
+ n_cycles: int,
172
+ dx: float,
173
+ dy: float,
174
+ dz: float,
175
+ ) -> float:
176
+ res_x = wavelength * n_cycles / 2
177
+ res_y = wavelength * dy2 / ay
178
+ res_z = wavelength * n_cycles / 2
179
+ return res_x / dx * res_y / dy * res_z / dz
@@ -0,0 +1,92 @@
1
+ """simple domain module."""
2
+
3
+ from pathlib import Path
4
+
5
+ import numpy as np
6
+ from numpy.typing import NDArray
7
+
8
+ from fullwave import Grid
9
+ from fullwave.medium_builder.domain import Domain
10
+
11
+
12
+ class SimpleDomain(Domain):
13
+ """A simple domain implementation for custom medium builder domains."""
14
+
15
+ def __init__(
16
+ self,
17
+ grid: Grid,
18
+ name: str,
19
+ geometry: NDArray[np.float64],
20
+ maps: dict[str, NDArray[np.float64] | NDArray[np.int64]],
21
+ *,
22
+ path_relaxation_parameters_database: Path = Path(__file__).parent.parent
23
+ / "solver"
24
+ / "bins"
25
+ / "database"
26
+ / "database"
27
+ / "relaxation_params_database_num_relax=2_20251027_1437.mat",
28
+ n_relaxation_mechanisms: int = 2,
29
+ ) -> None:
30
+ """Initialize a SimpleDomain.
31
+
32
+ This domain is designed to make a arbitrary domain with given maps,
33
+ so that users can easily create a domain with their own maps
34
+ and integrate it into the medium_builder.
35
+
36
+ Parameters
37
+ ----------
38
+ grid: Grid
39
+ The grid instance.
40
+ name : str
41
+ The name of the domain.
42
+ geometry : NDArray
43
+ The geometry array.
44
+ maps : NDArray
45
+ A dictionary containing maps
46
+ for sound speed, density, beta, alpha_coeff, alpha_power, and optionally air.
47
+ path_relaxation_parameters_database : Path, optional
48
+ The path to the relaxation parameters database.
49
+ n_relaxation_mechanisms : int, optional
50
+ The number of relaxation mechanisms.
51
+
52
+ """
53
+ self.grid = grid
54
+ self.is_3d = grid.is_3d
55
+ self.name = name
56
+ self.base_geometry = geometry
57
+ self.sound_speed = maps["sound_speed"]
58
+ self.density = maps["density"]
59
+ self.beta = maps["beta"]
60
+ self.alpha_coeff = maps["alpha_coeff"]
61
+ self.alpha_power = maps["alpha_power"]
62
+ if "air" in maps:
63
+ self.air = maps["air"]
64
+ else:
65
+ self.air = np.zeros_like(geometry, dtype=int)
66
+ super().__init__(
67
+ grid=grid,
68
+ name=name,
69
+ path_relaxation_parameters_database=path_relaxation_parameters_database,
70
+ n_relaxation_mechanisms=n_relaxation_mechanisms,
71
+ )
72
+
73
+ def _setup_base_geometry(self) -> NDArray[np.float64]:
74
+ return self.base_geometry
75
+
76
+ def _setup_sound_speed(self) -> NDArray[np.float64]:
77
+ return self.sound_speed
78
+
79
+ def _setup_density(self) -> NDArray[np.float64]:
80
+ return self.density
81
+
82
+ def _setup_beta(self) -> NDArray[np.float64]:
83
+ return self.beta
84
+
85
+ def _setup_alpha_coeff(self) -> NDArray[np.float64]:
86
+ return self.alpha_coeff
87
+
88
+ def _setup_alpha_power(self) -> NDArray[np.float64]:
89
+ return self.alpha_power
90
+
91
+ def _setup_air(self) -> NDArray[np.int64]:
92
+ return self.air
@@ -0,0 +1 @@
1
+ """water gel domain."""
fullwave/sensor.py ADDED
@@ -0,0 +1,161 @@
1
+ """Source class for Fullwave."""
2
+
3
+ import logging
4
+ from dataclasses import dataclass
5
+ from pathlib import Path
6
+
7
+ import numpy as np
8
+ from matplotlib import pyplot as plt
9
+ from numpy.typing import NDArray
10
+
11
+ from fullwave.utils import plot_utils
12
+ from fullwave.utils.coordinates import coords_to_index_map, coords_to_map, map_to_coords
13
+
14
+ logger = logging.getLogger("__main__." + __name__)
15
+
16
+
17
+ @dataclass
18
+ class Sensor:
19
+ """Sensor class for Fullwave."""
20
+
21
+ outcoords: NDArray[np.int64]
22
+ sampling_modulus_time: int = 1
23
+
24
+ def __init__(self, mask: NDArray[np.bool], sampling_modulus_time: int = 1) -> None:
25
+ """Sensor class for Fullwave.
26
+
27
+ Parameters
28
+ ----------
29
+ mask : NDArray[np.bool]
30
+ Binary matrix where the pressure is recorded at each time-step
31
+ shape: [nx, ny] for 2D, [nx, ny, nz] for 3D
32
+ sampling_modulus_time: int
33
+ Sampling modulus in time. Default is 1 (record at every time step).
34
+ Changing this value to n will record the pressure every n time steps.
35
+ It reduces the size of the output data.
36
+
37
+ """
38
+ mask = np.atleast_2d(mask)
39
+
40
+ self.grid_shape = mask.shape
41
+ self.sampling_modulus_time = sampling_modulus_time
42
+ self.is_3d = len(self.grid_shape) == 3
43
+ outcoords = map_to_coords(mask)
44
+ if self.is_3d:
45
+ self.outcoords = outcoords
46
+ else:
47
+ # self.outcoords = np.stack([outcoords[:, 1], outcoords[:, 0]]).T
48
+ self.outcoords = outcoords
49
+ super().__init__()
50
+
51
+ def validate(self, grid_shape: NDArray[np.int64] | tuple) -> None:
52
+ """Check if the source mask has the correct shape."""
53
+ grid_shape = tuple(grid_shape) if isinstance(grid_shape, np.ndarray) else grid_shape
54
+ assert self.mask.shape == grid_shape, f"{self.mask.shape} != {grid_shape}"
55
+ assert np.any(self.mask), "No active sensor found."
56
+
57
+ @property
58
+ def mask(self) -> NDArray[np.int64]:
59
+ """Returns the source mask.
60
+
61
+ it calculates the source mask from the source coordinates to reduce the memory usage.
62
+ """
63
+ return coords_to_map(
64
+ self.outcoords,
65
+ grid_shape=self.grid_shape,
66
+ is_3d=self.is_3d,
67
+ )
68
+
69
+ @property
70
+ def indexed_mask(self) -> NDArray[np.int64]:
71
+ """Returns the source mask.
72
+
73
+ it calculates the source mask from the source coordinates to reduce the memory usage.
74
+ """
75
+ return coords_to_index_map(
76
+ self.outcoords,
77
+ grid_shape=self.grid_shape,
78
+ is_3d=self.is_3d,
79
+ )
80
+
81
+ @property
82
+ def ncoordsout(self) -> int:
83
+ """Return the number of sensors.
84
+
85
+ ailiased to n_sensors for the compatibility with matlab version
86
+ """
87
+ return self.n_sensors
88
+
89
+ @property
90
+ def n_sensors(self) -> int:
91
+ """Return the number of sensors."""
92
+ return self.outcoords.shape[0]
93
+
94
+ def plot(
95
+ self,
96
+ export_path: Path | str | None = Path("./temp/temp.png"),
97
+ *,
98
+ show: bool = False,
99
+ ) -> None:
100
+ """Plot the transducer mask, optionally exporting and displaying the figure.
101
+
102
+ Raises:
103
+ ValueError: If the sensor is 3D because plotting is not supported.
104
+
105
+ """
106
+ if self.is_3d:
107
+ error_msg = "3D plotting is not supported yet."
108
+ raise ValueError(error_msg)
109
+ plt.close("all")
110
+ fig, ax = plt.subplots()
111
+ fig = plot_utils.plot_array(
112
+ self.mask,
113
+ xlim=[-10, self.mask.shape[1] + 10],
114
+ ylim=[-10, self.mask.shape[0] + 10],
115
+ reverse_y_axis=True,
116
+ save=False,
117
+ clear_all=False,
118
+ fig=fig,
119
+ colorbar=True,
120
+ )
121
+ if export_path is not None:
122
+ plt.savefig(export_path, dpi=300)
123
+ if show:
124
+ plt.show()
125
+
126
+ plt.close("all")
127
+
128
+ def print_info(self) -> None:
129
+ """Print sensor information to the logger."""
130
+ print(str(self))
131
+
132
+ def summary(self) -> None:
133
+ """Alias for print_info."""
134
+ self.print_info()
135
+
136
+ def __str__(self) -> str:
137
+ """Show sensor information.
138
+
139
+ Returns
140
+ -------
141
+ str
142
+ Formatted string containing source information.
143
+
144
+ """
145
+ return (
146
+ f"Sensor: \n"
147
+ f" Number of sensors: {self.n_sensors}\n"
148
+ f" Grid shape: {self.grid_shape}\n"
149
+ f" Is 3D: {self.is_3d}\n"
150
+ )
151
+
152
+ def __repr__(self) -> str:
153
+ """Show sensor information.
154
+
155
+ Returns
156
+ -------
157
+ str
158
+ Formatted string containing source information.
159
+
160
+ """
161
+ return self.__str__()
@@ -0,0 +1 @@
1
+ """fullwave solver module."""