testsuite: enginetest updated

pull/1/head
Sebastian Held 2010-11-03 15:02:36 +01:00
parent aab744fefa
commit ba755018ba
1 changed files with 38 additions and 6 deletions

View File

@ -5,10 +5,11 @@ function pass = cavity
CLEANUP = 1; % if enabled and result is PASS, remove simulation folder CLEANUP = 1; % if enabled and result is PASS, remove simulation folder
STOP_IF_FAILED = 1; % if enabled and result is FAILED, stop with error STOP_IF_FAILED = 1; % if enabled and result is FAILED, stop with error
global ENABLE_PLOTS;
ENABLE_PLOTS = 0;
engines = {'' '--engine=sse' '--engine=sse-compressed' '--engine=multithreaded'}; engines = {'' '--engine=sse' '--engine=sse-compressed' '--engine=multithreaded'};
% engines = {'--engine=sse-compressed' '--engine=sse-compressed-linear'}; % engines = [engines {'--engine=sse-compressed-linear' '--engine=multithreaded-linear'}];
% engines = {'' '--engine=sse-compressed'};
isOctave = exist('OCTAVE_VERSION','builtin') ~= 0; isOctave = exist('OCTAVE_VERSION','builtin') ~= 0;
if isOctave if isOctave
@ -66,7 +67,7 @@ f_stop = 10e9;
% setup FDTD parameter % setup FDTD parameter
FDTD = InitFDTD( 1000, 0 ); FDTD = InitFDTD( 1000, 0 );
FDTD = SetGaussExcite(FDTD,(f_stop-f_start)/2,(f_stop-f_start)/2); FDTD = SetGaussExcite(FDTD,(f_stop-f_start)/2,(f_stop-f_start)/2);
BC = {'MUR' 'PML_8' 'PEC' 'PEC' 'PEC' 'PEC'}; % PEC boundaries BC = {'MUR' 'PML_8' 'PMC' 'PEC' 'PEC' 'PEC'}; % boundaries
FDTD = SetBoundaryCond(FDTD,BC); FDTD = SetBoundaryCond(FDTD,BC);
% setup CSXCAD geometry % setup CSXCAD geometry
@ -85,7 +86,16 @@ p(1,2) = mesh.x(floor(end*2/3)+1);
p(2,2) = mesh.y(floor(end*2/3)+1); p(2,2) = mesh.y(floor(end*2/3)+1);
p(3,2) = mesh.z(floor(end*2/3)+1); p(3,2) = mesh.z(floor(end*2/3)+1);
CSX = AddCurve( CSX, 'excite1', 0, p ); CSX = AddCurve( CSX, 'excite1', 0, p );
% probes
CSX = AddProbe( CSX, 'E_probe', 2 );
p(1,1) = mesh.x(floor(end*1/3));
p(2,1) = mesh.y(floor(end*1/3));
p(3,1) = mesh.z(floor(end*1/3));
CSX = AddPoint( CSX, 'E_probe', 0, p );
CSX = AddProbe( CSX, 'H_probe', 3 );
CSX = AddPoint( CSX, 'H_probe', 0, p );
% material % material
CSX = AddMaterial( CSX, 'RO4350B', 'Epsilon', 3.66 ); CSX = AddMaterial( CSX, 'RO4350B', 'Epsilon', 3.66 );
start = [mesh.x(3) mesh.y(3) mesh.z(3)]; start = [mesh.x(3) mesh.y(3) mesh.z(3)];
@ -117,7 +127,7 @@ H.mesh = ReadHDF5Mesh( [Sim_Path '/Ht.h5'] );
H.data = ReadHDF5FieldData( [Sim_Path '/Ht.h5'] ); H.data = ReadHDF5FieldData( [Sim_Path '/Ht.h5'] );
result.E = E; result.E = E;
result.H = H; result.H = H;
result.probes = ReadUI( {'E_probe','H_probe'}, Sim_Path );
@ -126,7 +136,7 @@ pass = 0;
% n=1: reference simulation % n=1: reference simulation
for n=2:numel(results) for n=2:numel(results)
% iterate over all simulations % iterate over all simulations
EHfields = fieldnames(results{1}); EHfields = {'E','H'};
for m=1:numel(EHfields) for m=1:numel(EHfields)
% iterate over all fields (E, H) % iterate over all fields (E, H)
EHfield = EHfields{m}; EHfield = EHfields{m};
@ -143,4 +153,26 @@ for n=2:numel(results)
end end
disp( ['simulation ' num2str(n) ' is identical to simulation 1'] ); disp( ['simulation ' num2str(n) ' is identical to simulation 1'] );
end end
global ENABLE_PLOTS;
if ENABLE_PLOTS
figure
l = {};
for n=1:numel(results)
plot( results{n}.probes.TD{1}.t, results{n}.probes.TD{1}.val );
hold all
l = [l ['sim ' num2str(n)]];
end
legend( l );
figure
l = {};
for n=1:numel(results)
plot( results{n}.probes.TD{2}.t, results{n}.probes.TD{2}.val );
hold all
l = [l ['sim ' num2str(n)]];
end
legend( l );
end
pass = 1; pass = 1;