Changeset 1912
- Timestamp:
- 08/26/09 09:27:58 (15 years ago)
- Location:
- issm/trunk/test/Verification
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/test/Verification/PigControlMethodBM2d_21/runme.m
r1908 r1912 30 30 end 31 31 32 %packages and misfits to be tested32 %packages and solutions to be tested 33 33 if nargin==2, 34 misfits=varargin{2};34 solutions=varargin{2}; 35 35 else 36 misfits={'absolute','relative','logarithmic'};36 solutions={'diagnostic_absolute','diagnostic_relative','diagnostic_logarithmic'}; 37 37 end 38 38 if nargin, … … 49 49 package=packages{i}; 50 50 51 for j=1:length( misfits),52 misfit=misfits{j};51 for j=1:length(solutions), 52 solution=solutions{j}; 53 53 54 54 %check solution requested 55 if ((strcmpi(package,'macayeal') & ~strcmpi( misfit,'absolute')) | strcmpi(package,'ice')),56 disp(['package: ' package ' and misfit: ' misfit' in test: ' testname ' not supported yet']);55 if ((strcmpi(package,'macayeal') & ~strcmpi(solution,'absolute')) | strcmpi(package,'ice')), 56 disp(['package: ' package ' and solution: ' solution ' in test: ' testname ' not supported yet']); 57 57 continue 58 58 end … … 64 64 md=parameterize(md,'Pig.par'); 65 65 md=setelementstype(md,'macayeal','all'); 66 if strcmpi(misfit,'absolute'),67 md.fit(:)=0;68 elseif strcmpi(misfit,'relative'),69 md.fit(:)=1;70 elseif strcmpi(misfit,'logarithmic'),71 md.fit(:)=2;72 end73 66 md=modelextract(md,md.elementoniceshelf); 74 67 75 %launch control method 76 if ~testscheckmisfit(misfit), continue; end 77 md=solve(md,'analysis_type','control','package',packagefinal); 68 %compute solution 69 [md analysis_type sub_analysis_type packagefinal]=testsparameterization(md,solution,package); 70 if ~testschecksolution(md.type,solution), continue; end 71 md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal); 78 72 79 73 %compute fields to be checked … … 81 75 82 76 %load archive 83 eval(['load Archive' package misfit]);77 eval(['load Archive' package solution ]); 84 78 85 79 for k=1:length(fields), … … 87 81 %Get field and tolerance 88 82 field=fields{k}; 89 tolerance=testsgettolerance(md,package, misfit,field);83 tolerance=testsgettolerance(md,package,solution,field); 90 84 91 85 %compare to archive 92 eval(['Archive=Archive' package misfit'_field' num2str(k) ';']);86 eval(['Archive=Archive' package solution '_field' num2str(k) ';']); 93 87 eval(['error_diff=full(max(abs(Archive-md.results.' field '))/(max(abs(Archive))+eps));']); 94 88 95 89 %disp test result 96 90 if (error_diff>tolerance); 97 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s misfit: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,misfit,package));91 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package)); 98 92 else 99 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s misfit: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,misfit,package));93 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package)); 100 94 end 101 95 -
issm/trunk/test/Verification/PigControlMethodDragM2d_20/runme.m
r1908 r1912 30 30 end 31 31 32 %packages and misfits to be tested32 %packages and solutions to be tested 33 33 if nargin==2, 34 misfits=varargin{2};34 solutions=varargin{2}; 35 35 else 36 misfits={'absolute','relative','logarithmic'};36 solutions={'diagnostic_absolute','diagnostic_relative','diagnostic_logarithmic'}; 37 37 end 38 38 if nargin, … … 49 49 package=packages{i}; 50 50 51 for j=1:length( misfits),52 misfit=misfits{j};51 for j=1:length(solutions), 52 solution=solutions{j}; 53 53 54 54 %check package … … 64 64 md=parameterize(md,'Pig.par'); 65 65 md=setelementstype(md,'macayeal','all'); 66 if strcmpi(misfit,'absolute'),67 md.fit(:)=0;68 elseif strcmpi(misfit,'relative'),69 md.fit(:)=1;70 elseif strcmpi(misfit,'logarithmic'),71 md.fit(:)=2;72 end73 66 74 %launch control method 75 if ~testscheckmisfit(misfit), continue; end 76 md=solve(md,'analysis_type','control','package',packagefinal); 67 %compute solution 68 [md analysis_type sub_analysis_type packagefinal]=testsparameterization(md,solution,package); 69 if ~testschecksolution(md.type,solution), continue; end 70 md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal); 77 71 78 72 %compute fields to be checked … … 80 74 81 75 %load archive 82 eval(['load Archive' package misfit]);76 eval(['load Archive' package solution ]); 83 77 84 78 for k=1:length(fields), … … 86 80 %Get field and tolerance 87 81 field=fields{k}; 88 tolerance=testsgettolerance(md,package, misfit,field);82 tolerance=testsgettolerance(md,package,solution,field); 89 83 90 84 %compare to archive 91 eval(['Archive=Archive' package misfit'_field' num2str(k) ';']);85 eval(['Archive=Archive' package solution '_field' num2str(k) ';']); 92 86 eval(['error_diff=full(max(abs(Archive-md.results.' field '))/(max(abs(Archive))+eps));']); 93 87 94 88 %disp test result 95 89 if (error_diff>tolerance); 96 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s misfit: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,misfit,package));90 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package)); 97 91 else 98 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s misfit: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,misfit,package));92 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package)); 99 93 end 100 94 -
issm/trunk/test/Verification/PigControlMethodDragP3d_22/runme.m
r1908 r1912 30 30 end 31 31 32 %packages and misfits to be tested32 %packages and solutions to be tested 33 33 if nargin==2, 34 misfits=varargin{2};34 solutions=varargin{2}; 35 35 else 36 misfits={'absolute','relative','logarithmic'};36 solutions={'diagnostic_absolute','diagnostic_relative','diagnostic_logarithmic'}; 37 37 end 38 38 if nargin, … … 49 49 package=packages{i}; 50 50 51 for j=1:length( misfits),52 misfit=misfits{j};51 for j=1:length(solutions), 52 solution=solutions{j}; 53 53 54 54 %check package … … 65 65 md=extrude(md,4,2); 66 66 md=setelementstype(md,'pattyn','all'); 67 if strcmpi(misfit,'absolute'),68 md.fit(:)=0;69 elseif strcmpi(misfit,'relative'),70 md.fit(:)=1;71 elseif strcmpi(misfit,'logarithmic'),72 md.fit(:)=2;73 end74 67 75 %launch control method 76 if ~testscheckmisfit(misfit), continue; end 77 md=solve(md,'analysis_type','control','package',packagefinal); 68 %compute solution 69 [md analysis_type sub_analysis_type packagefinal]=testsparameterization(md,solution,package); 70 if ~testschecksolution(md.type,solution), continue; end 71 md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal); 78 72 79 73 %compute fields to be checked … … 81 75 82 76 %load archive 83 eval(['load Archive' package misfit]);77 eval(['load Archive' package solution ]); 84 78 85 79 for k=1:length(fields), … … 87 81 %Get field and tolerance 88 82 field=fields{k}; 89 tolerance=testsgettolerance(md,package, misfit,field);83 tolerance=testsgettolerance(md,package,solution,field); 90 84 91 85 %compare to archive 92 eval(['Archive=Archive' package misfit'_field' num2str(k) ';']);86 eval(['Archive=Archive' package solution '_field' num2str(k) ';']); 93 87 eval(['error_diff=full(max(abs(Archive-md.results.' field '))/(max(abs(Archive))+eps));']); 94 88 95 89 %disp test result 96 90 if (error_diff>tolerance); 97 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s misfit: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,misfit,package));91 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package)); 98 92 else 99 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s misfit: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,misfit,package));93 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package)); 100 94 end 101 95 -
issm/trunk/test/Verification/PigControlMethodDragS3d_23/runme.m
r1908 r1912 30 30 end 31 31 32 %packages and misfits to be tested32 %packages and solutions to be tested 33 33 if nargin==2, 34 misfits=varargin{2};34 solutions=varargin{2}; 35 35 else 36 misfits={'absolute','relative','logarithmic'};36 solutions={'diagnostic_absolute','diagnostic_relative','diagnostic_logarithmic'}; 37 37 end 38 38 if nargin, … … 49 49 package=packages{i}; 50 50 51 for j=1:length( misfits),52 misfit=misfits{j};51 for j=1:length(solutions), 52 solution=solutions{j}; 53 53 54 54 %check package … … 65 65 md=extrude(md,4,3); 66 66 md=setelementstype(md,'pattyn','all','stokes','all'); 67 if strcmpi(misfit,'absolute'),68 md.fit(:)=0;69 elseif strcmpi(misfit,'relative'),70 md.fit(:)=1;71 elseif strcmpi(misfit,'logarithmic'),72 md.fit(:)=2;73 end74 67 75 %launch control method 76 if ~testscheckmisfit(misfit), continue; end 77 md=solve(md,'analysis_type','control','package',packagefinal); 68 %compute solution 69 [md analysis_type sub_analysis_type packagefinal]=testsparameterization(md,solution,package); 70 if ~testschecksolution(md.type,solution), continue; end 71 md=solve(md,'analysis_type',analysis_type,'sub_analysis_type',sub_analysis_type,'package',packagefinal); 78 72 79 73 %compute fields to be checked … … 81 75 82 76 %load archive 83 eval(['load Archive' package misfit]);77 eval(['load Archive' package solution ]); 84 78 85 79 for k=1:length(fields), … … 87 81 %Get field and tolerance 88 82 field=fields{k}; 89 tolerance=testsgettolerance(md,package, misfit,field);83 tolerance=testsgettolerance(md,package,solution,field); 90 84 91 85 %compare to archive 92 eval(['Archive=Archive' package misfit'_field' num2str(k) ';']);86 eval(['Archive=Archive' package solution '_field' num2str(k) ';']); 93 87 eval(['error_diff=full(max(abs(Archive-md.results.' field '))/(max(abs(Archive))+eps));']); 94 88 95 89 %disp test result 96 90 if (error_diff>tolerance); 97 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s misfit: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,misfit,package));91 disp(sprintf(['\n\nERROR difference: %-7.2g > %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package)); 98 92 else 99 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s misfit: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,misfit,package));93 disp(sprintf(['\n\nSUCCESS difference: %-7.2g < %7.2g test: %-25s solution: %-16s package: %-14s field: ' field '.\n\n'],error_diff,tolerance,testname,solution,package)); 100 94 end 101 95
Note:
See TracChangeset
for help on using the changeset viewer.