I am using the SSE3 Linux binaries for this work, but I have seen the same error in the Windows AVX2 binaries.
I'm not sure if this is a real bug or just me missing something somewhere, but it seems that when I try to use a plane wave source with the C++ version of k-wave I get an error reading in the HD5 file.
As an example, running the following works:
% create the computational grid
Nx = 108;
Ny = 108;
Nz = 108;
dx = .05;
dy = .05;
dz = .05;
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);
model = ones(Nx, Ny, Nz);
% density
rho_v=[1e3];
% speed of sound
c_v=[1500];
medium.sound_speed = c_v(model); % [m/s]
medium.density = rho_v(model); % [kg/m^3]
medium.alpha_coeff = 0; % [dB/(MHz^2 cm)]
medium.alpha_power = 0.999;
sensor.mask = ones(Nx, Ny, Nz);
% record the maximum pressure
sensor.record = {'p_max'};
source.u_mask = ones(Nx, Ny, Nz);
source.uz = zeros(Nx, Ny, Nz);
source.uz(:, :, 3) = 1;
source.uz = smooth(kgrid, source.uz, true);
source.uz = reshape(source.uz, [], 1);
input_args = {'PlotScale', 'auto', ...
'PMLInside', false, 'PlotPML', false};
sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:})
But when I replace kspaceFirstOrder3D
with kspaceFirstOrder3DC
, it errors out giving me
K-Wave panic: Data loading was not successful!
Error: Dataset "uz_source_input" has wrong dimension sizes!
The size is appropriate for Matlab, but doesn't seem to work for C++. Am I doing something incorrectly?