matlab: fix and updates in ReadHDF5Mesh

pull/1/head
Thorsten Liebig 2010-09-27 08:43:34 +02:00
parent af922a10bc
commit 8623e32925
1 changed files with 13 additions and 7 deletions

View File

@ -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;
return
end
hdf_mesh.type=0;