Changing the center_frequency to something outside of 5e5 changes the grid size, but the material mask for Scenario 2 is loaded from the data file and not resized to the grid size, so the code errors out.
One option would be to re-interpolate the material masks to the new grid.
Steps to reproduce
Edit plot_scenarios.py to use a different center_frequency (e.g. 1e6), and then run it.
Include a description of your setup including:
Python version: 3.10.12
OS version and name: {'system': 'Linux', 'node': 'ip-172-31-27-213', 'release': '5.15.0-1031-aws', 'version': '#35~20.04.1-Ubuntu SMP Sat Feb 11 16:19:06 UTC 2023', 'machine': 'x86_64', 'processor': 'x86_64'}
Expected results
Steady-state simulation completes successfully.
Actual results
Edit plot_scenarios.py to use a different center_frequency (e.g. 1e6), and then run:
python docs/examples/plot_scenarios.py
Simulating scenario: scenario-2-2d-v0
creating a grid with shape: (901, 681) for extent: [0.225 0.17 ] m
Traceback (most recent call last):
File "/home/ubuntu/micromamba/envs/neurotechdevkit/lib/python3.10/pdb.py", line 1723, in main
pdb._runscript(mainpyfile)
File "/home/ubuntu/micromamba/envs/neurotechdevkit/lib/python3.10/pdb.py", line 1583, in _runscript
self.run(statement)
File "/home/ubuntu/micromamba/envs/neurotechdevkit/lib/python3.10/bdb.py", line 598, in run
exec(cmd, globals, locals)
File "<string>", line 1, in <module>
File "/home/ubuntu/neurotechdevkit/docs/examples/plot_scenarios.py", line 37, in <module>
plot_scenario("scenario-2-2d-v0")
File "/home/ubuntu/neurotechdevkit/docs/examples/plot_scenarios.py", line 16, in plot_scenario
result = scenario.simulate_steady_state(
File "/home/ubuntu/micromamba/envs/neurotechdevkit/lib/python3.10/site-packages/neurotechdevkit/scenarios/_base.py", line 420, in simulate_steady_state
self._problem = self._compile_problem(center_frequency)
File "/home/ubuntu/micromamba/envs/neurotechdevkit/lib/python3.10/site-packages/neurotechdevkit/scenarios/_scenario_2.py", line 137, in _compile_problem
return self._compile_scenario_2_problem(extent, center_frequency)
File "/home/ubuntu/micromamba/envs/neurotechdevkit/lib/python3.10/site-packages/neurotechdevkit/scenarios/_scenario_2.py", line 67, in _compile_scenario_2_problem
problem = add_material_fields_to_problem(
File "/home/ubuntu/micromamba/envs/neurotechdevkit/lib/python3.10/site-packages/neurotechdevkit/scenarios/_utils.py", line 94, in add_material_fields_to_problem
vp.data[material_mask] = material.vp
IndexError: boolean index did not match indexed array along dimension 0; dimension is 901 but corresponding boolean dimension is 451
Describe the bug
Changing the
center_frequency
to something outside of5e5
changes the grid size, but the material mask for Scenario 2 is loaded from the data file and not resized to the grid size, so the code errors out.One option would be to re-interpolate the material masks to the new grid.
Steps to reproduce
Edit
plot_scenarios.py
to use a differentcenter_frequency
(e.g.1e6
), and then run it.Include a description of your setup including:
{'system': 'Linux', 'node': 'ip-172-31-27-213', 'release': '5.15.0-1031-aws', 'version': '#35~20.04.1-Ubuntu SMP Sat Feb 11 16:19:06 UTC 2023', 'machine': 'x86_64', 'processor': 'x86_64'}
Expected results
Steady-state simulation completes successfully.
Actual results
Edit
plot_scenarios.py
to use a differentcenter_frequency
(e.g.1e6
), and then run: