Is there a way to record dp/dx and dp/dy? As I understand they are calculated each step anyway.
For now I use 2 additional sensors to calculate spatial derivatives.
Thanks!
kWave
A MATLAB toolbox for the timedomain
simulation of acoustic wave fields
Easiest (fastest) way to obtain spatial derivatives of pressure
(2 posts) (2 voices)
Posted 3 weeks ago #

Not out of the box. They are calculated in the code as part of the particle velocity update equation, although this calculation also includes a grid shift. I'd suggest two options:
(1) If you don't want to hack kWave and it's feasible to save all the data, record the pressure over the whole grid, then calculate the spatial gradient at each time step after the simulation using
gradientSpect
.(2) If you're happy to hack kWave, just add a new option inside
/private/kspaceFirstOrder_extractSensorData.m
. First add a spectral gradient calculation of the pressure (without the grid shift), and then sample at the sensor points using sensor_mask_index.Brad.
Posted 3 weeks ago #
Reply
You must log in to post.