function pass = cavity %pass = cavity % % Checks, if different engines produces identical results CLEANUP = 1; % if enabled and result is PASS, remove simulation folder STOP_IF_FAILED = 1; % if enabled and result is FAILED, stop with error engines = {'' '--engine=sse' '--engine=sse-compressed' '--engine=multithreaded'}; % engines = {'--engine=sse-compressed' '--engine=sse-compressed-linear'}; % engines = {'' '--engine=sse-compressed'}; isOctave = exist('OCTAVE_VERSION','builtin') ~= 0; if isOctave old_crr = confirm_recursive_rmdir(0); end global Sim_Path Sim_CSX Sim_Path = 'tmp'; Sim_CSX = 'cavity.xml'; for n=1:numel(engines) result{n} = sim( engines{n} ); end pass = compare( result ); if pass disp( 'enginetests/cavity.m (engine comparison): pass' ); else disp( 'enginetests/cavity.m (engine comparison): * FAILED *' ); end if pass && CLEANUP rmdir( Sim_Path, 's' ); end if ~pass && STOP_IF_FAILED error 'test failed' end if isOctave confirm_recursive_rmdir(old_crr); end return function result = sim( openEMS_options ) global Sim_Path Sim_CSX physical_constants; % structure a = 5e-2; b = 2e-2; d = 6e-2; if ~((b