matlab: fix and updates in ReadHDF5Mesh
This commit is contained in:
parent
af922a10bc
commit
8623e32925
@ -1,10 +1,12 @@
|
|||||||
function hdf_mesh = ReadHDF5Mesh(file)
|
function hdf_mesh = ReadHDF5Mesh(file)
|
||||||
% 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:
|
% returns:
|
||||||
% hdf_mesh.type
|
% hdf_mesh.type (0-> cartesian, 1-> cylindrical mesh type)
|
||||||
% hdf_mesh.names
|
% hdf_mesh.names (e.g. 'Mesh/y')
|
||||||
% hdf_mesh.lines
|
% hdf_mesh.lines (e.g. [0,1,2,3,4])
|
||||||
%
|
%
|
||||||
% openEMS matlab interface
|
% openEMS matlab interface
|
||||||
% -----------------------
|
% -----------------------
|
||||||
@ -27,8 +29,12 @@ for n=1:numel(names)
|
|||||||
hdf_mesh.lines{n} = double(hdf5read(file,names{n}));
|
hdf_mesh.lines{n} = double(hdf5read(file,names{n}));
|
||||||
end
|
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;
|
hdf_mesh.type=1;
|
||||||
else
|
return
|
||||||
hdf_mesh.type=0;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
hdf_mesh.type=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user