2010-04-05 21:16:52 +00:00
|
|
|
function hdf_mesh = ReadHDF5Mesh(file)
|
2010-04-24 14:43:22 +00:00
|
|
|
% function hdf_mesh = ReadHDF5Mesh(file)
|
|
|
|
%
|
|
|
|
% returns:
|
|
|
|
% hdf_mesh.type
|
|
|
|
% hdf_mesh.names
|
|
|
|
% hdf_mesh.lines
|
|
|
|
%
|
|
|
|
% openEMS matlab interface
|
|
|
|
% -----------------------
|
|
|
|
% author: Thorsten Liebig
|
2010-05-28 13:13:45 +00:00
|
|
|
%
|
|
|
|
% See also ReadHDF5FieldData
|
2010-04-05 21:16:52 +00:00
|
|
|
|
|
|
|
info = hdf5info(file);
|
|
|
|
|
|
|
|
for n=1:numel(info.GroupHierarchy.Groups)
|
|
|
|
if strcmp(info.GroupHierarchy.Groups(n).Name,'/Mesh')
|
|
|
|
for m=1:numel(info.GroupHierarchy.Groups(n).Datasets)
|
|
|
|
names{m} = info.GroupHierarchy.Groups(n).Datasets(m).Name;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
hdf_mesh.names = names;
|
|
|
|
for n=1:numel(names)
|
2010-05-25 10:17:09 +00:00
|
|
|
hdf_mesh.lines{n} = double(hdf5read(file,names{n}));
|
2010-04-23 06:17:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
if (strcmp(names{1},'/mesh/rho'))
|
|
|
|
hdf_mesh.type=1;
|
|
|
|
else
|
|
|
|
hdf_mesh.type=0;
|
2010-04-05 21:16:52 +00:00
|
|
|
end
|