hdf5 dump reader: remember original mesh indices
Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>pull/12/head
parent
3930db8be3
commit
84b7a7b56e
|
@ -62,6 +62,10 @@ mesh_i.lines{1} = x_i;
|
|||
mesh_i.lines{2} = y_i;
|
||||
mesh_i.lines{3} = z_i;
|
||||
|
||||
% clear or create empty original indices list, since such do not make any
|
||||
% sense with interpolated field values
|
||||
mesh_i.original_indices = {};
|
||||
|
||||
if (isfield(field,'TD'))
|
||||
field_i.TD = interpolate_fields(field.TD,x,y,z, x_i, y_i, z_i);
|
||||
field_i.TD.time = field.TD.time;
|
||||
|
|
|
@ -47,6 +47,15 @@ for n=1:3
|
|||
mesh_i.lines{n} = mesh.lines{n}(ind_range{n});
|
||||
end
|
||||
|
||||
% store original indices
|
||||
if (isfield(mesh_i,'original_indices'))
|
||||
for n=1:3
|
||||
mesh_i.original_indices{n} = mesh_i.original_indices{n}(ind_range{n});
|
||||
end
|
||||
else
|
||||
mesh_i.original_indices = ind_range;
|
||||
end
|
||||
|
||||
field_i = field;
|
||||
|
||||
if (isfield(field,'FD'))
|
||||
|
|
|
@ -33,6 +33,15 @@ mesh_i.lines{1} = x_i;
|
|||
mesh_i.lines{2} = y_i;
|
||||
mesh_i.lines{3} = z_i;
|
||||
|
||||
% store original indices
|
||||
if (isfield(mesh_i,'original_indices'))
|
||||
for n=1:3
|
||||
mesh_i.original_indices{n} = mesh_i.original_indices{n}(ss_idx{n});
|
||||
end
|
||||
else
|
||||
mesh_i.original_indices = ss_idx;
|
||||
end
|
||||
|
||||
if (isfield(field,'TD'))
|
||||
field_i.TD = subsample_fields(field.TD,ss_idx);
|
||||
field_i.TD.time = field.TD.time;
|
||||
|
|
|
@ -74,6 +74,13 @@ for n=1:2:(nargin-1)
|
|||
field.FD.values{n}(:,end+1,:,:) = field.FD.values{n}(:,1,:,:);
|
||||
end
|
||||
end
|
||||
if (isfield(mesh,'original_indices'))
|
||||
if (~isempty(mesh.original_indices))
|
||||
mesh.original_indices{2} = [mesh.original_indices{2} 1];
|
||||
end
|
||||
else
|
||||
mesh.original_indices = {1:numel(mesh.lines{1}),[1:numel(mesh.lines{2}) 1],[1:numel(mesh.lines{3})]};
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue