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.
- fullwave/__init__.py +28 -0
- fullwave/constants/__init__.py +5 -0
- fullwave/constants/material_properties.py +112 -0
- fullwave/grid.py +222 -0
- fullwave/medium.py +1042 -0
- fullwave/medium_builder/__init__.py +12 -0
- fullwave/medium_builder/domain.py +151 -0
- fullwave/medium_builder/medium_builder.py +198 -0
- fullwave/medium_builder/presets/__init__.py +8 -0
- fullwave/medium_builder/presets/data/.keep +0 -0
- fullwave/medium_builder/presets/data/abdominal_wall/i2365f_etfw1.mat +0 -0
- fullwave/medium_builder/presets/domain_abdominal_wall.py +293 -0
- fullwave/medium_builder/presets/domain_background.py +140 -0
- fullwave/medium_builder/presets/domain_scatterer.py +179 -0
- fullwave/medium_builder/presets/domain_simple.py +92 -0
- fullwave/medium_builder/presets/domain_water_gel.py +1 -0
- fullwave/sensor.py +161 -0
- fullwave/solver/__init__.py +1 -0
- fullwave/solver/bins/database/relaxation_params_database_num_relax=2_20251027_1437.mat +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenu +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_100_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_101_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_120_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_61_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_70_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_75_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_80_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_86_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_89_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/2d/fullwave2_2d_exponential_attenuation_gpu_sm_90_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_100_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_101_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_120_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_61_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_70_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_75_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_80_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_86_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_89_cuda129 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda118 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda124 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda126 +0 -0
- fullwave/solver/bins/exponential_attenuation/gpu/3d/fullwave2_3d_exponential_attenuation_gpu_sm_90_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_100_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_101_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_120_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_61_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_70_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_75_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_80_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_86_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_89_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_isotropic_multi_gpu_sm_90_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_100_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_101_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_120_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_61_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_70_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_75_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_80_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_86_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_89_cuda129 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda118 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda124 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda126 +0 -0
- fullwave/solver/bins/gpu/2d/num_relax=2/fullwave2_2d_2_relax_multi_gpu_sm_90_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_100_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_101_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_120_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_61_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_70_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_75_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_80_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_86_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_89_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_isotropic_multi_gpu_sm_90_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_100_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_101_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_120_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_61_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_70_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_75_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_80_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_86_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_89_cuda129 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda118 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda124 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda126 +0 -0
- fullwave/solver/bins/gpu/3d/num_relax=2/fullwave2_3d_2_relax_multi_gpu_sm_90_cuda129 +0 -0
- fullwave/solver/cuda_utils.py +392 -0
- fullwave/solver/input_file_writer.py +853 -0
- fullwave/solver/launcher.py +134 -0
- fullwave/solver/pml_builder.py +1923 -0
- fullwave/solver/solver.py +750 -0
- fullwave/solver/utils.py +83 -0
- fullwave/source.py +173 -0
- fullwave/transducer.py +1003 -0
- fullwave/utils/__init__.py +12 -0
- fullwave/utils/check_functions.py +48 -0
- fullwave/utils/coordinates.py +155 -0
- fullwave/utils/memory_tempfile.py +439 -0
- fullwave/utils/numerical.py +111 -0
- fullwave/utils/plot_utils.py +1122 -0
- fullwave/utils/pulse.py +72 -0
- fullwave/utils/relaxation_parameters.py +212 -0
- fullwave/utils/signal_process.py +197 -0
- fullwave25-1.0.7.dist-info/METADATA +292 -0
- fullwave25-1.0.7.dist-info/RECORD +225 -0
- fullwave25-1.0.7.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""domain base module."""
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import numpy as np
|
|
8
|
+
from numpy.typing import NDArray
|
|
9
|
+
|
|
10
|
+
from fullwave import Grid, Medium
|
|
11
|
+
from fullwave.utils import check_functions
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class Domain(ABC):
|
|
16
|
+
"""A base domain class defining abstract methods for domain parameter setup.
|
|
17
|
+
|
|
18
|
+
override abstract methods (_setup_*) to use in the derived classes.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: str
|
|
22
|
+
grid: Grid
|
|
23
|
+
nx: int = field(init=False)
|
|
24
|
+
ny: int = field(init=False)
|
|
25
|
+
nz: int = field(init=False)
|
|
26
|
+
base_geometry: NDArray[np.float64] = field(init=False)
|
|
27
|
+
sound_speed: NDArray[np.float64] = field(init=False)
|
|
28
|
+
density: NDArray[np.float64] = field(init=False)
|
|
29
|
+
alpha_coeff: NDArray[np.float64] = field(init=False)
|
|
30
|
+
alpha_power: NDArray[np.float64] = field(init=False)
|
|
31
|
+
beta: NDArray[np.float64] = field(init=False)
|
|
32
|
+
air: NDArray[np.int64] = field(init=False)
|
|
33
|
+
|
|
34
|
+
def __init__(
|
|
35
|
+
self,
|
|
36
|
+
name: str,
|
|
37
|
+
grid: Grid,
|
|
38
|
+
*,
|
|
39
|
+
path_relaxation_parameters_database: Path = Path(__file__).parent.parent
|
|
40
|
+
/ "solver"
|
|
41
|
+
/ "bins"
|
|
42
|
+
/ "database"
|
|
43
|
+
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
|
|
44
|
+
n_relaxation_mechanisms: int = 2,
|
|
45
|
+
) -> None:
|
|
46
|
+
"""Initialize the Domain class.
|
|
47
|
+
|
|
48
|
+
Parameters
|
|
49
|
+
----------
|
|
50
|
+
name: (str)
|
|
51
|
+
The name of the domain.
|
|
52
|
+
grid: (Grid)
|
|
53
|
+
The grid associated with the domain.
|
|
54
|
+
path_relaxation_parameters_database: (Path, optional)
|
|
55
|
+
The path to the relaxation parameters database.
|
|
56
|
+
n_relaxation_mechanisms: (int, optional)
|
|
57
|
+
The number of relaxation mechanisms.
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
self.name = name
|
|
61
|
+
self.grid = grid
|
|
62
|
+
self.is_3d = self.grid.is_3d
|
|
63
|
+
self.path_relaxation_parameters_database = path_relaxation_parameters_database
|
|
64
|
+
self.n_relaxation_mechanisms = n_relaxation_mechanisms
|
|
65
|
+
self.__post_init__()
|
|
66
|
+
|
|
67
|
+
def __post_init__(self) -> None:
|
|
68
|
+
"""Post-initialization processing for Domain.
|
|
69
|
+
|
|
70
|
+
will be called after __init__.
|
|
71
|
+
"""
|
|
72
|
+
check_functions.check_instance(self.grid, Grid)
|
|
73
|
+
|
|
74
|
+
self.nx = self.grid.nx
|
|
75
|
+
self.ny = self.grid.ny
|
|
76
|
+
if self.is_3d:
|
|
77
|
+
self.nz = self.grid.nz
|
|
78
|
+
|
|
79
|
+
self.base_geometry = self._setup_base_geometry()
|
|
80
|
+
|
|
81
|
+
self.sound_speed = self._setup_sound_speed()
|
|
82
|
+
self.density = self._setup_density()
|
|
83
|
+
self.alpha_coeff = self._setup_alpha_coeff()
|
|
84
|
+
self.alpha_power = self._setup_alpha_power()
|
|
85
|
+
self.beta = self._setup_beta()
|
|
86
|
+
self.air = self._setup_air()
|
|
87
|
+
|
|
88
|
+
@abstractmethod
|
|
89
|
+
def _setup_base_geometry(self) -> NDArray[np.float64]:
|
|
90
|
+
if self.is_3d:
|
|
91
|
+
return np.zeros((self.nx, self.ny, self.nz))
|
|
92
|
+
return np.zeros((self.nx, self.ny))
|
|
93
|
+
|
|
94
|
+
@abstractmethod
|
|
95
|
+
def _setup_sound_speed(self) -> NDArray[np.float64]:
|
|
96
|
+
if self.is_3d:
|
|
97
|
+
return np.zeros((self.nx, self.ny, self.nz))
|
|
98
|
+
return np.zeros((self.nx, self.ny))
|
|
99
|
+
|
|
100
|
+
@abstractmethod
|
|
101
|
+
def _setup_density(self) -> NDArray[np.float64]:
|
|
102
|
+
if self.is_3d:
|
|
103
|
+
return np.zeros((self.nx, self.ny, self.nz))
|
|
104
|
+
return np.zeros((self.nx, self.ny))
|
|
105
|
+
|
|
106
|
+
@abstractmethod
|
|
107
|
+
def _setup_alpha_coeff(self) -> NDArray[np.float64]:
|
|
108
|
+
if self.is_3d:
|
|
109
|
+
return np.zeros((self.nx, self.ny, self.nz))
|
|
110
|
+
return np.zeros((self.nx, self.ny))
|
|
111
|
+
|
|
112
|
+
@abstractmethod
|
|
113
|
+
def _setup_alpha_power(self) -> NDArray[np.float64]:
|
|
114
|
+
if self.is_3d:
|
|
115
|
+
return np.zeros((self.nx, self.ny, self.nz))
|
|
116
|
+
return np.zeros((self.nx, self.ny))
|
|
117
|
+
|
|
118
|
+
@abstractmethod
|
|
119
|
+
def _setup_beta(self) -> NDArray[np.float64]:
|
|
120
|
+
if self.is_3d:
|
|
121
|
+
return np.zeros((self.nx, self.ny, self.nz))
|
|
122
|
+
return np.zeros((self.nx, self.ny))
|
|
123
|
+
|
|
124
|
+
def _setup_air(self) -> NDArray[np.int64]:
|
|
125
|
+
if self.is_3d:
|
|
126
|
+
return np.zeros((self.nx, self.ny, self.nz), dtype=bool)
|
|
127
|
+
return np.zeros((self.nx, self.ny), dtype=bool)
|
|
128
|
+
|
|
129
|
+
@property
|
|
130
|
+
def medium(self) -> Medium:
|
|
131
|
+
"""Returns the medium instance with its configured properties."""
|
|
132
|
+
return Medium(
|
|
133
|
+
grid=self.grid,
|
|
134
|
+
sound_speed=self.sound_speed,
|
|
135
|
+
density=self.density,
|
|
136
|
+
alpha_coeff=self.alpha_coeff,
|
|
137
|
+
alpha_power=self.alpha_power,
|
|
138
|
+
beta=self.beta,
|
|
139
|
+
air_map=self.air,
|
|
140
|
+
path_relaxation_parameters_database=self.path_relaxation_parameters_database,
|
|
141
|
+
n_relaxation_mechanisms=self.n_relaxation_mechanisms,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
def plot(
|
|
145
|
+
self,
|
|
146
|
+
export_path: Path | str | None = Path("./temp/temp.png"),
|
|
147
|
+
*,
|
|
148
|
+
show: bool = False,
|
|
149
|
+
) -> None:
|
|
150
|
+
"""Plot the fields using matplotlib."""
|
|
151
|
+
self.medium.plot(export_path=export_path, show=show)
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"""medium builder module."""
|
|
2
|
+
|
|
3
|
+
from collections import OrderedDict
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
from fullwave import Medium
|
|
9
|
+
from fullwave.constants import MaterialProperties
|
|
10
|
+
from fullwave.grid import Grid
|
|
11
|
+
from fullwave.medium_builder.domain import Domain
|
|
12
|
+
from fullwave.utils import check_functions
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class MediumBuilder:
|
|
16
|
+
"""organize the domain properties and export Medium instances.
|
|
17
|
+
|
|
18
|
+
registered domains will be combined to construct the final domain properties.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
grid: Grid,
|
|
24
|
+
background_domain_properties: str = "water",
|
|
25
|
+
*,
|
|
26
|
+
ignore_non_linearity: bool = False,
|
|
27
|
+
material_properties: MaterialProperties | None = None,
|
|
28
|
+
path_relaxation_parameters_database: Path = Path(__file__).parent.parent
|
|
29
|
+
/ "solver"
|
|
30
|
+
/ "bins"
|
|
31
|
+
/ "database"
|
|
32
|
+
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
|
|
33
|
+
n_relaxation_mechanisms: int = 2,
|
|
34
|
+
attenuation_builder: str = "lookup",
|
|
35
|
+
) -> None:
|
|
36
|
+
"""Initialize a DomainOrganizer.
|
|
37
|
+
|
|
38
|
+
with background domain properties, non-linearity flag, and material properties.
|
|
39
|
+
|
|
40
|
+
Parameters
|
|
41
|
+
----------
|
|
42
|
+
grid: Grid
|
|
43
|
+
grid instance.
|
|
44
|
+
background_domain_properties: str
|
|
45
|
+
The background domain properties.
|
|
46
|
+
Defaults to "water".
|
|
47
|
+
ignore_non_linearity: bool
|
|
48
|
+
Ignore non-linearity.
|
|
49
|
+
Defaults to False.
|
|
50
|
+
material_properties: MaterialProperties, optional
|
|
51
|
+
Material properties.
|
|
52
|
+
Defaults to None.
|
|
53
|
+
path_relaxation_parameters_database : Path, optional
|
|
54
|
+
Path to the relaxation parameters database.
|
|
55
|
+
n_relaxation_mechanisms : int, optional
|
|
56
|
+
Number of relaxation mechanisms, by default 2
|
|
57
|
+
attenuation_builder : str, optional
|
|
58
|
+
Attenuation builder type, by default "lookup".
|
|
59
|
+
Currently supports "lookup" only.
|
|
60
|
+
If "lookup", it uses the lookup table for attenuation.
|
|
61
|
+
|
|
62
|
+
"""
|
|
63
|
+
check_functions.check_instance(grid, Grid)
|
|
64
|
+
self.grid = grid
|
|
65
|
+
self.registered_domain_dict: OrderedDict = OrderedDict()
|
|
66
|
+
self.constructed_domain_dict: OrderedDict = OrderedDict()
|
|
67
|
+
|
|
68
|
+
if material_properties is None:
|
|
69
|
+
self.material_properties: MaterialProperties = MaterialProperties()
|
|
70
|
+
else:
|
|
71
|
+
self.material_properties = material_properties
|
|
72
|
+
|
|
73
|
+
self.background_domain_properties: str = background_domain_properties
|
|
74
|
+
self.ignore_non_linearity: bool = ignore_non_linearity
|
|
75
|
+
self.path_relaxation_parameters_database = path_relaxation_parameters_database
|
|
76
|
+
self.n_relaxation_mechanisms = n_relaxation_mechanisms
|
|
77
|
+
self.attenuation_builder = attenuation_builder
|
|
78
|
+
|
|
79
|
+
def register_domain(self, domain: Domain) -> None:
|
|
80
|
+
"""Register a single Domain instances.
|
|
81
|
+
|
|
82
|
+
Parameters
|
|
83
|
+
----------
|
|
84
|
+
domain: Domain
|
|
85
|
+
Domain instances to register.
|
|
86
|
+
|
|
87
|
+
"""
|
|
88
|
+
check_functions.check_instance(domain, Domain)
|
|
89
|
+
|
|
90
|
+
domain_name = domain.name
|
|
91
|
+
c_map = domain.sound_speed
|
|
92
|
+
rho_map = domain.density
|
|
93
|
+
beta_map = domain.beta
|
|
94
|
+
alpha_coeff_map = domain.alpha_coeff
|
|
95
|
+
alpha_power_map = domain.alpha_power
|
|
96
|
+
|
|
97
|
+
base_geometry = domain.base_geometry
|
|
98
|
+
|
|
99
|
+
air_map = domain.air if hasattr(domain, "air") else np.zeros_like(base_geometry)
|
|
100
|
+
|
|
101
|
+
self.registered_domain_dict[domain_name] = {
|
|
102
|
+
"rho_map": rho_map,
|
|
103
|
+
"beta_map": beta_map,
|
|
104
|
+
"c_map": c_map,
|
|
105
|
+
"a_map": alpha_coeff_map,
|
|
106
|
+
"a_power_map": alpha_power_map,
|
|
107
|
+
"air_map": air_map,
|
|
108
|
+
"geometry": base_geometry,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
def register_domain_list(self, domain_list: list[Domain]) -> None:
|
|
112
|
+
"""Register a list of Domain instances.
|
|
113
|
+
|
|
114
|
+
Parameters
|
|
115
|
+
----------
|
|
116
|
+
domain_list: List
|
|
117
|
+
List of Domain instances to register.
|
|
118
|
+
|
|
119
|
+
"""
|
|
120
|
+
for domain in domain_list:
|
|
121
|
+
self.register_domain(domain)
|
|
122
|
+
|
|
123
|
+
def _check_registered_domain(self) -> None:
|
|
124
|
+
if "background" not in self.registered_domain_dict:
|
|
125
|
+
error_msg = "Background domain is not registered."
|
|
126
|
+
raise ValueError(error_msg)
|
|
127
|
+
if len(self.registered_domain_dict) == 0:
|
|
128
|
+
error_msg = "No domain is registered."
|
|
129
|
+
raise ValueError(error_msg)
|
|
130
|
+
if next(iter(self.registered_domain_dict.keys())) != "background":
|
|
131
|
+
error_msg = "The first domain must be background domain."
|
|
132
|
+
raise ValueError(error_msg)
|
|
133
|
+
|
|
134
|
+
def run(self) -> Medium:
|
|
135
|
+
"""Construct maps from registered maps.
|
|
136
|
+
|
|
137
|
+
Combine the maps like an image stecker.
|
|
138
|
+
The first map must be background map.
|
|
139
|
+
|
|
140
|
+
Returns
|
|
141
|
+
-------
|
|
142
|
+
Medium
|
|
143
|
+
A Medium instance with the constructed domain properties.
|
|
144
|
+
|
|
145
|
+
"""
|
|
146
|
+
self._check_registered_domain()
|
|
147
|
+
|
|
148
|
+
for map_name in ["c_map", "rho_map", "a_map", "a_power_map", "beta_map", "air_map"]:
|
|
149
|
+
base_map_data = self.registered_domain_dict["background"][map_name].copy()
|
|
150
|
+
for domain_name in self.registered_domain_dict:
|
|
151
|
+
if domain_name == "background":
|
|
152
|
+
continue
|
|
153
|
+
|
|
154
|
+
non_zero_index = np.where(
|
|
155
|
+
self.registered_domain_dict[domain_name]["geometry"] != 0,
|
|
156
|
+
)
|
|
157
|
+
base_map_data[non_zero_index] = self.registered_domain_dict[domain_name][map_name][
|
|
158
|
+
non_zero_index
|
|
159
|
+
]
|
|
160
|
+
self.constructed_domain_dict[map_name] = base_map_data.copy()
|
|
161
|
+
|
|
162
|
+
if self.ignore_non_linearity:
|
|
163
|
+
self.constructed_domain_dict["beta_map"] = np.zeros_like(
|
|
164
|
+
self.constructed_domain_dict["beta_map"],
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
base_geometry_data = np.zeros_like(self.registered_domain_dict["background"]["geometry"])
|
|
168
|
+
for i, domain_name in enumerate(self.registered_domain_dict.keys()):
|
|
169
|
+
geometry_non_zero_index = np.where(
|
|
170
|
+
self.registered_domain_dict[domain_name]["geometry"] != 0,
|
|
171
|
+
)
|
|
172
|
+
base_geometry_data[geometry_non_zero_index] = i
|
|
173
|
+
self.constructed_domain_dict["geometry"] = base_geometry_data.copy()
|
|
174
|
+
return Medium(
|
|
175
|
+
grid=self.grid,
|
|
176
|
+
sound_speed=self.constructed_domain_dict["c_map"],
|
|
177
|
+
density=self.constructed_domain_dict["rho_map"],
|
|
178
|
+
alpha_coeff=self.constructed_domain_dict["a_map"],
|
|
179
|
+
alpha_power=self.constructed_domain_dict["a_power_map"],
|
|
180
|
+
beta=self.constructed_domain_dict["beta_map"],
|
|
181
|
+
air_map=self.constructed_domain_dict["air_map"],
|
|
182
|
+
path_relaxation_parameters_database=self.path_relaxation_parameters_database,
|
|
183
|
+
n_relaxation_mechanisms=self.n_relaxation_mechanisms,
|
|
184
|
+
attenuation_builder=self.attenuation_builder,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
def plot_current_map(
|
|
188
|
+
self,
|
|
189
|
+
export_path: Path | str | None = Path("./temp/temp.png"),
|
|
190
|
+
*,
|
|
191
|
+
show: bool = False,
|
|
192
|
+
) -> None:
|
|
193
|
+
"""Plot the medium fields using matplotlib."""
|
|
194
|
+
medium = self.run()
|
|
195
|
+
medium.plot(
|
|
196
|
+
export_path=export_path,
|
|
197
|
+
show=show,
|
|
198
|
+
)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""domain presets."""
|
|
2
|
+
|
|
3
|
+
from .domain_abdominal_wall import AbdominalWallDomain
|
|
4
|
+
from .domain_background import BackgroundDomain
|
|
5
|
+
from .domain_scatterer import ScattererDomain
|
|
6
|
+
from .domain_simple import SimpleDomain
|
|
7
|
+
|
|
8
|
+
__all__ = ["AbdominalWallDomain", "BackgroundDomain", "ScattererDomain", "SimpleDomain"]
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
"""abdominal wall domain."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
from numpy.typing import NDArray
|
|
7
|
+
from scipy.io import loadmat
|
|
8
|
+
|
|
9
|
+
from fullwave import Grid
|
|
10
|
+
from fullwave.constants import MaterialProperties
|
|
11
|
+
from fullwave.medium_builder import Domain
|
|
12
|
+
from fullwave.utils import check_functions
|
|
13
|
+
from fullwave.utils.numerical import matlab_interp2easy
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _make_abdominal_property(
|
|
17
|
+
grid: Grid,
|
|
18
|
+
abdominal_wall_mat_path: Path = Path(
|
|
19
|
+
"fullwave/medium_builder/presets/data/abdominal_wall/i2365f_etfw1.mat",
|
|
20
|
+
),
|
|
21
|
+
crop_depth: float = 0.8e-2,
|
|
22
|
+
start_depth: float = 0,
|
|
23
|
+
background_domain_properties: str = "liver",
|
|
24
|
+
*,
|
|
25
|
+
apply_tissue_compression: bool = True,
|
|
26
|
+
compression_ratio: float = 0.655,
|
|
27
|
+
use_center_region: bool = True,
|
|
28
|
+
skip_background_definition: bool = True,
|
|
29
|
+
tranducer_surface: NDArray[np.float64] | None = None,
|
|
30
|
+
) -> dict[str, np.ndarray]:
|
|
31
|
+
mat_data = loadmat(abdominal_wall_mat_path)
|
|
32
|
+
abdominal_wall_properties = mat_data["cut"].astype(float)
|
|
33
|
+
|
|
34
|
+
# this is the pixel size in interpd Visual Human slice.
|
|
35
|
+
dm = 0.33e-3 / 4
|
|
36
|
+
|
|
37
|
+
compression_ratio = compression_ratio if apply_tissue_compression else 1
|
|
38
|
+
|
|
39
|
+
interpolation_x = compression_ratio * dm / grid.dx
|
|
40
|
+
interpolation_y = dm / grid.dy
|
|
41
|
+
|
|
42
|
+
abdominal_wall_properties = matlab_interp2easy(
|
|
43
|
+
abdominal_wall_properties,
|
|
44
|
+
interpolation_x=interpolation_x,
|
|
45
|
+
interpolation_y=interpolation_y,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
crop_depth_index = round(crop_depth / grid.dx) - 1
|
|
49
|
+
start_depth_index = round(start_depth / grid.dx)
|
|
50
|
+
|
|
51
|
+
# axis definition: [axial, lateral], x-> depth, y-> width
|
|
52
|
+
abdominal_wall_properties = abdominal_wall_properties[
|
|
53
|
+
crop_depth_index : crop_depth_index + grid.nx,
|
|
54
|
+
:,
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
if use_center_region:
|
|
58
|
+
offset = grid.ny % 2
|
|
59
|
+
center_y = abdominal_wall_properties.shape[1] // 2
|
|
60
|
+
abdominal_wall_properties = abdominal_wall_properties[
|
|
61
|
+
: grid.nx,
|
|
62
|
+
center_y - grid.ny // 2 : center_y + grid.ny // 2 + offset,
|
|
63
|
+
]
|
|
64
|
+
assert abdominal_wall_properties.shape[1] == grid.ny
|
|
65
|
+
|
|
66
|
+
base_map = np.zeros((grid.nx, grid.ny))
|
|
67
|
+
|
|
68
|
+
if abdominal_wall_properties.shape[0] + start_depth_index > grid.nx:
|
|
69
|
+
abdominal_wall_properties = abdominal_wall_properties[: grid.nx - start_depth_index, :]
|
|
70
|
+
if tranducer_surface is not None:
|
|
71
|
+
for i in range(abdominal_wall_properties.shape[1]):
|
|
72
|
+
abdominal_wall_properties[tranducer_surface[i] - 3 :, i] = abdominal_wall_properties[
|
|
73
|
+
0 : -tranducer_surface[i] + 3,
|
|
74
|
+
i,
|
|
75
|
+
]
|
|
76
|
+
abdominal_wall_properties[0 : tranducer_surface[i] - 3, i] = 0
|
|
77
|
+
|
|
78
|
+
base_map[
|
|
79
|
+
start_depth_index : start_depth_index + abdominal_wall_properties.shape[0],
|
|
80
|
+
: abdominal_wall_properties.shape[1],
|
|
81
|
+
] = abdominal_wall_properties
|
|
82
|
+
|
|
83
|
+
material_properties = MaterialProperties()
|
|
84
|
+
|
|
85
|
+
density = np.ones_like(base_map) * -1
|
|
86
|
+
sound_speed = np.ones_like(base_map) * -1
|
|
87
|
+
alpha_coeff = np.ones_like(base_map) * -1
|
|
88
|
+
alpha_power = np.ones_like(base_map) * -1
|
|
89
|
+
beta = np.ones_like(base_map) * -1
|
|
90
|
+
|
|
91
|
+
for i, tissue_name in enumerate(
|
|
92
|
+
[
|
|
93
|
+
background_domain_properties,
|
|
94
|
+
"connective",
|
|
95
|
+
"muscle",
|
|
96
|
+
"fat",
|
|
97
|
+
"connective",
|
|
98
|
+
"connective",
|
|
99
|
+
],
|
|
100
|
+
):
|
|
101
|
+
if i == 0 and skip_background_definition:
|
|
102
|
+
continue
|
|
103
|
+
target_index = np.where(base_map == i)
|
|
104
|
+
density[target_index] = getattr(material_properties, tissue_name)["density"]
|
|
105
|
+
sound_speed[target_index] = getattr(material_properties, tissue_name)["sound_speed"]
|
|
106
|
+
alpha_coeff[target_index] = getattr(material_properties, tissue_name)["alpha_coeff"]
|
|
107
|
+
alpha_power[target_index] = getattr(material_properties, tissue_name)["alpha_power"]
|
|
108
|
+
beta[target_index] = getattr(material_properties, tissue_name)["beta"]
|
|
109
|
+
|
|
110
|
+
# if use_smoothing:
|
|
111
|
+
# # use gaussian smoothing to smooth the abdominal wall
|
|
112
|
+
# sigma = (5 / 10) ** 2 * grid.ppw / 2
|
|
113
|
+
# rho_map_blurred = matlab_gaussian_filter(density, sigma=sigma)
|
|
114
|
+
# c_map_blurred = matlab_gaussian_filter(sound_speed, sigma=sigma)
|
|
115
|
+
# a_coeff_map_blurred = matlab_gaussian_filter(alpha_coeff, sigma=sigma)
|
|
116
|
+
# a_power_map_blurred = matlab_gaussian_filter(alpha_power, sigma=sigma)
|
|
117
|
+
|
|
118
|
+
# density = rho_map_blurred
|
|
119
|
+
# sound_speed = c_map_blurred
|
|
120
|
+
# alpha_coeff = a_coeff_map_blurred
|
|
121
|
+
# alpha_power = a_power_map_blurred
|
|
122
|
+
|
|
123
|
+
air_map = np.zeros_like(base_map)
|
|
124
|
+
return {
|
|
125
|
+
"base_geometry": base_map > 0,
|
|
126
|
+
"sound_speed": sound_speed,
|
|
127
|
+
"density": density,
|
|
128
|
+
"alpha_coeff": alpha_coeff,
|
|
129
|
+
"alpha_power": alpha_power,
|
|
130
|
+
"beta": beta,
|
|
131
|
+
"air_map": air_map,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class AbdominalWallDomain(Domain):
|
|
136
|
+
"""Represents the abdominal wall domain for simulation."""
|
|
137
|
+
|
|
138
|
+
def __init__(
|
|
139
|
+
self,
|
|
140
|
+
grid: Grid,
|
|
141
|
+
*,
|
|
142
|
+
abdominal_wall_mat_path: Path = Path(
|
|
143
|
+
"fullwave/medium_builder/presets/data/abdominal_wall/i2365f_etfw1.mat",
|
|
144
|
+
),
|
|
145
|
+
crop_depth: float = 0.8e-2,
|
|
146
|
+
start_depth: float = 0,
|
|
147
|
+
name: str = "abdominal_wall",
|
|
148
|
+
background_domain_properties: str = "water",
|
|
149
|
+
material_properties: MaterialProperties | None = None,
|
|
150
|
+
apply_tissue_compression: bool = True,
|
|
151
|
+
use_center_region: bool = True,
|
|
152
|
+
skip_background_definition: bool = True,
|
|
153
|
+
path_relaxation_parameters_database: Path = Path(__file__).parent.parent.parent
|
|
154
|
+
/ "solver"
|
|
155
|
+
/ "bins"
|
|
156
|
+
/ "database"
|
|
157
|
+
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
|
|
158
|
+
n_relaxation_mechanisms: int = 2,
|
|
159
|
+
tranducer_surface: NDArray[np.float64] | None = None,
|
|
160
|
+
) -> None:
|
|
161
|
+
"""Define AbdominalWallDomain instance.
|
|
162
|
+
|
|
163
|
+
test
|
|
164
|
+
|
|
165
|
+
Parameters
|
|
166
|
+
----------
|
|
167
|
+
grid: Grid
|
|
168
|
+
The grid instance.
|
|
169
|
+
abdominal_wall_mat_path: Path, optional
|
|
170
|
+
The path to the abdominal wall mat file.
|
|
171
|
+
Defaults to
|
|
172
|
+
Path("fullwave/medium_builder/presets/data/abdominal_wall/i2365f_etfw1.mat").
|
|
173
|
+
crop_depth: float, optional
|
|
174
|
+
how much you want to crop the abdominal wall from the top.
|
|
175
|
+
Defaults to 0.8e-2.
|
|
176
|
+
start_depth: float, optional
|
|
177
|
+
it defines the place where the abdominal wall starts in the domain.
|
|
178
|
+
The start depth.
|
|
179
|
+
Defaults to 0.
|
|
180
|
+
name: str, optional
|
|
181
|
+
The name of the domain.
|
|
182
|
+
Defaults to "abdominal_wall".
|
|
183
|
+
background_domain_properties: str, optional
|
|
184
|
+
The background domain properties.
|
|
185
|
+
this value will be used to define the background domain properties.
|
|
186
|
+
this is ignored if skip_background_definition is True.
|
|
187
|
+
Defaults to "water".
|
|
188
|
+
material_properties: MaterialProperties, optional
|
|
189
|
+
Material properties to be used.
|
|
190
|
+
Defaults to None.
|
|
191
|
+
apply_tissue_compression: bool, optional
|
|
192
|
+
if apply tissue compression emulation to the abdominal wall.
|
|
193
|
+
Defaults to True.
|
|
194
|
+
use_center_region: bool, optional
|
|
195
|
+
if use the center region of the abdominal wall.
|
|
196
|
+
Defaults to True.
|
|
197
|
+
skip_background_definition: bool, optional
|
|
198
|
+
if skip background definition.
|
|
199
|
+
Defaults to True.
|
|
200
|
+
path_relaxation_parameters_database: Path, optional
|
|
201
|
+
The path to the relaxation parameters database.
|
|
202
|
+
Defaults to
|
|
203
|
+
Path(__file__).parent.parent / "solver" / "bins"
|
|
204
|
+
/ "database"
|
|
205
|
+
/ "relaxation_params_database_num_relax=2_20251027_1437.mat",
|
|
206
|
+
n_relaxation_mechanisms: int, optional
|
|
207
|
+
The number of relaxation mechanisms.
|
|
208
|
+
Defaults to 4.
|
|
209
|
+
tranducer_surface: NDArray[np.float64] | None, optional
|
|
210
|
+
The transducer surface.
|
|
211
|
+
Defaults to None.
|
|
212
|
+
the shape of this array should be (ny,).
|
|
213
|
+
and each value contains the depth of the transducer surface at each lateral position.
|
|
214
|
+
|
|
215
|
+
"""
|
|
216
|
+
self.material_properties = material_properties
|
|
217
|
+
|
|
218
|
+
self.background_domain_properties = background_domain_properties
|
|
219
|
+
self.crop_depth = crop_depth
|
|
220
|
+
self.start_depth = start_depth
|
|
221
|
+
self.abdominal_wall_mat_path = abdominal_wall_mat_path
|
|
222
|
+
|
|
223
|
+
self.apply_tissue_compression = apply_tissue_compression
|
|
224
|
+
self.skip_background_definition = skip_background_definition
|
|
225
|
+
|
|
226
|
+
self.use_center_region = use_center_region
|
|
227
|
+
|
|
228
|
+
check_functions.check_instance(grid, Grid)
|
|
229
|
+
|
|
230
|
+
self.name = name
|
|
231
|
+
self.grid = grid
|
|
232
|
+
self.is_3d = grid.is_3d
|
|
233
|
+
if self.is_3d:
|
|
234
|
+
error_msg = "3D abdominal wall domain is not supported yet."
|
|
235
|
+
raise NotImplementedError(error_msg)
|
|
236
|
+
self.path_relaxation_parameters_database = path_relaxation_parameters_database
|
|
237
|
+
self.n_relaxation_mechanisms = n_relaxation_mechanisms
|
|
238
|
+
self.tranducer_surface = tranducer_surface
|
|
239
|
+
(
|
|
240
|
+
self.base_geometry,
|
|
241
|
+
self.sound_speed,
|
|
242
|
+
self.density,
|
|
243
|
+
self.alpha_coeff,
|
|
244
|
+
self.alpha_power,
|
|
245
|
+
self.beta,
|
|
246
|
+
self.air,
|
|
247
|
+
) = self._setup_maps()
|
|
248
|
+
|
|
249
|
+
def _setup_maps(
|
|
250
|
+
self,
|
|
251
|
+
) -> tuple[np.ndarray, ...]:
|
|
252
|
+
maps = _make_abdominal_property(
|
|
253
|
+
grid=self.grid,
|
|
254
|
+
abdominal_wall_mat_path=self.abdominal_wall_mat_path,
|
|
255
|
+
crop_depth=self.crop_depth,
|
|
256
|
+
start_depth=self.start_depth,
|
|
257
|
+
background_domain_properties=self.background_domain_properties,
|
|
258
|
+
apply_tissue_compression=self.apply_tissue_compression,
|
|
259
|
+
use_center_region=self.use_center_region,
|
|
260
|
+
skip_background_definition=self.skip_background_definition,
|
|
261
|
+
tranducer_surface=self.tranducer_surface,
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
return (
|
|
265
|
+
maps["base_geometry"],
|
|
266
|
+
maps["sound_speed"],
|
|
267
|
+
maps["density"],
|
|
268
|
+
maps["alpha_coeff"],
|
|
269
|
+
maps["alpha_power"],
|
|
270
|
+
maps["beta"],
|
|
271
|
+
maps["air_map"],
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
def _setup_base_geometry(self) -> NDArray[np.float64]:
|
|
275
|
+
return self.base_geometry
|
|
276
|
+
|
|
277
|
+
def _setup_sound_speed(self) -> NDArray[np.float64]:
|
|
278
|
+
return self.sound_speed
|
|
279
|
+
|
|
280
|
+
def _setup_density(self) -> NDArray[np.float64]:
|
|
281
|
+
return self.density
|
|
282
|
+
|
|
283
|
+
def _setup_beta(self) -> NDArray[np.float64]:
|
|
284
|
+
return self.beta
|
|
285
|
+
|
|
286
|
+
def _setup_alpha_coeff(self) -> NDArray[np.float64]:
|
|
287
|
+
return self.alpha_coeff
|
|
288
|
+
|
|
289
|
+
def _setup_alpha_power(self) -> NDArray[np.float64]:
|
|
290
|
+
return self.alpha_power
|
|
291
|
+
|
|
292
|
+
def _setup_air(self) -> NDArray[np.int64]:
|
|
293
|
+
return self.air
|