Hi
I am facing a compilation problem with the following code, i can't understand the solution as i am a new user for cpp code.
clear all
run([getkWavePath 'private/getH5Literals']);
filename = 'input12.h5';
% create the computational grid
Nx = 64; % number of grid points in the x direction
Ny = 64; % number of grid points in the y direction
Nz = 64; % number of grid points in the z direction
dx = 0.1e-3; % grid point spacing in the x direction [m]
dy = 0.1e-3; % grid point spacing in the y direction [m]
dz = 0.1e-3; % grid point spacing in the z direction [m]
kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);
% define the properties of the propagation medium
medium.sound_speed = 1500 * ones(Nx, Ny, Nz); % [m/s]
% medium.sound_speed(1:Nx/2, :, :) = 1800; % [m/s]
medium.density = 1000 * ones(Nx, Ny, Nz); % [kg/m^3]
% medium.density(:, Ny/4:end, :) = 1200; % [kg/m^3]
c0=medium.sound_speed;
% make sure the input is in the correct data format
eval(['c0 = ' MATRIX_DATA_TYPE_MATLAB '(c0);']);
% save the sound speed matrix
writeMatrix([filename], c0, 'c0');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % % create initial pressure distribution using makeBall
ball_magnitude = 10; % [Pa]
ball_x_pos = 38; % [grid points]
ball_y_pos = 32; % [grid points]
ball_z_pos = 32; % [grid points]
ball_radius = 5; % [grid points]
p_mask = makeBall(Nx, Ny, Nz, ball_x_pos, ball_y_pos, ball_z_pos, ball_radius);
ball_1 = ball_magnitude *p_mask ;
source.p0 = ball_1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define a square source mask facing in the x-direction using the
% find linear source indices
p_source_index = find(p_mask == 1);
p_source_index = reshape(p_source_index, [], 1);
% make sure the input is in the correct data format
eval(['p_source_index = ' INTEGER_DATA_TYPE_MATLAB '(p_source_index);']);
% save the source index matrix
writeMatrix([filename], p_source_index, 'p_source_index');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% cast matrix to single precision
eval(['ball_1 = ' MATRIX_DATA_TYPE_MATLAB '(ball_1);']);
% save the input signal
writeMatrix([filename], ball_1, 'ball_1');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define a sensor mask through the central plane
sensor_mask = false(Nx, Ny, Nz);
sensor_mask(:, :, Nz/2) = 1;
% extract the indices of the active sensor mask elements
sensor_mask_index = find(sensor_mask);
sensor_mask_index = reshape(sensor_mask_index, [], 1);
% make sure the input is in the correct data format
eval(['sensor_mask_index = ' INTEGER_DATA_TYPE_MATLAB '(sensor_mask_index);']);
sensor.mask=sensor_mask;
% save the sensor mask
writeMatrix([filename], sensor_mask_index, 'sensor_mask_index');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% write grid parameters
writeGrid([filename], [Nx, Ny, Nz], [dx, dy, dz], ...
[10, 10, 10], [10, 10,10], ...
Nt, dt, 1500);
% write flags
writeFlags([filename]);
% set additional file attributes
writeAttributes([filename]);
kspaceFirstOrder3D(kgrid, medium, source, sensor, 'SaveToDisk', filename);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
here i am able to make .h5 file but while compiling the .h5 file with kspaceFirstOrder-OMP
i got ----
+---------------------------------------------------------------+
| kspaceFirstOrder-OMP v1.3 |
+---------------------------------------------------------------+
| Reading simulation configuration: Failed |
+---------------------------------------------------------------+
+---------------------------------------------------------------+
| !!! K-Wave experienced a fatal error !!! |
+---------------------------------------------------------------+
| Error: Invalid format of the input file: iostream stream |
| error |
+---------------------------------------------------------------+
| Execution terminated |
+---------------------------------------------------------------+