diff --git a/matlab/ReadHDF5Mesh.m b/matlab/ReadHDF5Mesh.m index 1ea2690..5599e10 100644 --- a/matlab/ReadHDF5Mesh.m +++ b/matlab/ReadHDF5Mesh.m @@ -1,10 +1,12 @@ function hdf_mesh = ReadHDF5Mesh(file) % function hdf_mesh = ReadHDF5Mesh(file) % +% Get the raw mesh data stored in the hdf5 dump file created by openEMS +% % returns: -% hdf_mesh.type -% hdf_mesh.names -% hdf_mesh.lines +% hdf_mesh.type (0-> cartesian, 1-> cylindrical mesh type) +% hdf_mesh.names (e.g. 'Mesh/y') +% hdf_mesh.lines (e.g. [0,1,2,3,4]) % % openEMS matlab interface % ----------------------- @@ -27,8 +29,12 @@ for n=1:numel(names) hdf_mesh.lines{n} = double(hdf5read(file,names{n})); end -if (strcmp(names{1},'/mesh/rho')) +if (strcmp(names{1},'/Mesh/alpha')) + % alpha and rho are in the wrong order, flip to have rho, alpha, z + hdf_mesh.names(1:2) = fliplr(hdf_mesh.names(1:2)); + hdf_mesh.lines(1:2) = fliplr(hdf_mesh.lines(1:2)); hdf_mesh.type=1; -else - hdf_mesh.type=0; -end \ No newline at end of file + return +end + +hdf_mesh.type=0;