nf2ff: improve file search / fix for MPI
Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>pull/14/head
parent
d5cbfec2be
commit
bb6483fd73
|
@ -28,7 +28,6 @@ function nf2ff = CalcNF2FF(nf2ff, Sim_Path, freq, theta, phi, varargin)
|
||||||
% 'Radius': specify the radius for the nf2ff
|
% 'Radius': specify the radius for the nf2ff
|
||||||
% 'Eps_r': specify the relative electric permittivity for the nf2ff
|
% 'Eps_r': specify the relative electric permittivity for the nf2ff
|
||||||
% 'Mue_r': specify the relative magnetic permeability for the nf2ff
|
% 'Mue_r': specify the relative magnetic permeability for the nf2ff
|
||||||
% 'MPI' : set true if MPI was used
|
|
||||||
%
|
%
|
||||||
% 'Mirror': Add mirroring in a given direction (dir), with a given
|
% 'Mirror': Add mirroring in a given direction (dir), with a given
|
||||||
% mirror type (PEC or PMC) and a mirror position in the given
|
% mirror type (PEC or PMC) and a mirror position in the given
|
||||||
|
@ -42,7 +41,6 @@ function nf2ff = CalcNF2FF(nf2ff, Sim_Path, freq, theta, phi, varargin)
|
||||||
% author: Thorsten Liebig, 2012
|
% author: Thorsten Liebig, 2012
|
||||||
|
|
||||||
mode = 0;
|
mode = 0;
|
||||||
MPI = 0;
|
|
||||||
|
|
||||||
filename = nf2ff.name;
|
filename = nf2ff.name;
|
||||||
nf2ff_xml.Planes = {};
|
nf2ff_xml.Planes = {};
|
||||||
|
@ -59,8 +57,6 @@ end
|
||||||
for n=1:2:numel(varargin)-1
|
for n=1:2:numel(varargin)-1
|
||||||
if (strcmp(varargin{n},'Mode'))
|
if (strcmp(varargin{n},'Mode'))
|
||||||
mode = varargin{n+1};
|
mode = varargin{n+1};
|
||||||
elseif (strcmp(varargin{n},'MPI'))
|
|
||||||
MPI = varargin{n+1};
|
|
||||||
elseif (strcmp(varargin{n},'Mirror'))
|
elseif (strcmp(varargin{n},'Mirror'))
|
||||||
if isfield(nf2ff_xml,'Mirror')
|
if isfield(nf2ff_xml,'Mirror')
|
||||||
pos = length(nf2ff_xml.Mirror)+1;
|
pos = length(nf2ff_xml.Mirror)+1;
|
||||||
|
@ -77,19 +73,14 @@ end
|
||||||
|
|
||||||
for (n=1:numel(nf2ff.filenames_E))
|
for (n=1:numel(nf2ff.filenames_E))
|
||||||
if (nf2ff.directions(n)~=0)
|
if (nf2ff.directions(n)~=0)
|
||||||
if (MPI==0)
|
files_E = dir([Sim_Path '/*' nf2ff.filenames_E{n} '.h5']);
|
||||||
nf2ff_xml.Planes{end+1}.ATTRIBUTE.E_Field = [nf2ff.filenames_E{n} '.h5'];
|
files_H = dir([Sim_Path '/*' nf2ff.filenames_H{n} '.h5']);
|
||||||
nf2ff_xml.Planes{end}.ATTRIBUTE.H_Field = [nf2ff.filenames_H{n} '.h5'];
|
if (numel(files_E)~=numel(files_H))
|
||||||
else
|
error 'number of E/H planes mismatch!'
|
||||||
files_E = dir([Sim_Path '/ID*' nf2ff.filenames_E{n} '.h5']);
|
end
|
||||||
files_H = dir([Sim_Path '/ID*' nf2ff.filenames_H{n} '.h5']);
|
for fn = 1:numel(files_E)
|
||||||
if (numel(files_E)~=numel(files_H))
|
nf2ff_xml.Planes{end+1}.ATTRIBUTE.E_Field = files_E(fn).name;
|
||||||
error 'number of E/H planes mismatch!'
|
nf2ff_xml.Planes{end}.ATTRIBUTE.H_Field = files_H(fn).name;
|
||||||
end
|
|
||||||
for fn = 1:numel(files_E)
|
|
||||||
nf2ff_xml.Planes{end+1}.ATTRIBUTE.E_Field = files_E(fn).name;
|
|
||||||
nf2ff_xml.Planes{end}.ATTRIBUTE.H_Field = files_H(fn).name;
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue