testsuite: enginetest updated
parent
aab744fefa
commit
ba755018ba
|
@ -5,10 +5,11 @@ function pass = cavity
|
|||
|
||||
CLEANUP = 1; % if enabled and result is PASS, remove simulation folder
|
||||
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-compressed' '--engine=sse-compressed-linear'};
|
||||
% engines = {'' '--engine=sse-compressed'};
|
||||
% engines = [engines {'--engine=sse-compressed-linear' '--engine=multithreaded-linear'}];
|
||||
|
||||
isOctave = exist('OCTAVE_VERSION','builtin') ~= 0;
|
||||
if isOctave
|
||||
|
@ -66,7 +67,7 @@ f_stop = 10e9;
|
|||
% setup FDTD parameter
|
||||
FDTD = InitFDTD( 1000, 0 );
|
||||
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);
|
||||
|
||||
% 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(3,2) = mesh.z(floor(end*2/3)+1);
|
||||
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
|
||||
CSX = AddMaterial( CSX, 'RO4350B', 'Epsilon', 3.66 );
|
||||
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'] );
|
||||
result.E = E;
|
||||
result.H = H;
|
||||
|
||||
result.probes = ReadUI( {'E_probe','H_probe'}, Sim_Path );
|
||||
|
||||
|
||||
|
||||
|
@ -126,7 +136,7 @@ pass = 0;
|
|||
% n=1: reference simulation
|
||||
for n=2:numel(results)
|
||||
% iterate over all simulations
|
||||
EHfields = fieldnames(results{1});
|
||||
EHfields = {'E','H'};
|
||||
for m=1:numel(EHfields)
|
||||
% iterate over all fields (E, H)
|
||||
EHfield = EHfields{m};
|
||||
|
@ -143,4 +153,26 @@ for n=2:numel(results)
|
|||
end
|
||||
disp( ['simulation ' num2str(n) ' is identical to simulation 1'] );
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue