0001 function plot_importancefactors(md,options_structure,width,ii);
0002
0003
0004
0005
0006
0007
0008
0009
0010 if ~isnan(options_structure.designvariable),
0011 descriptor=options_structure.designvariable;
0012 else
0013 error('plot_importancefactors error message: Need to supply design variable descriptor');
0014 end
0015 descriptorlength=length(descriptor);
0016
0017
0018 if ~isnan(options_structure.responsefunction),
0019 responsefunctiondescriptor=options_structure.responsefunction;
0020 else
0021 error('plot_importancefactors error message: Need to supply response function descriptor');
0022 end
0023
0024
0025 responsefunctions=md.dakotaresults{2};
0026 found=0;
0027 for i=1:length(responsefunctions),
0028 if strcmpi(responsefunctions(i).descriptor,responsefunctiondescriptor),
0029 found=i;
0030 break;
0031 end
0032 end
0033 if ~found,
0034 error('plot_importancefactors error message: could not find correct response function');
0035 end
0036 responsefunctions=responsefunctions(found);
0037 nfun=size(responsefunctions.desvar,1);
0038
0039
0040 importancefactors=zeros(md.npart,1);
0041 count=0;
0042 for i=1:nfun,
0043 desvar=responsefunctions.desvar{i};
0044 if strncmpi(desvar,descriptor,descriptorlength),
0045 count=count+1;
0046 importancefactors(count)=responsefunctions.impfac(i);
0047 end
0048 end
0049 if count==0,
0050 error('plot_importancefactors error message: could not find to response functions with corresponding design variable');
0051 end
0052
0053
0054 if ~isnan(options_structure.log),
0055 logvalue=options_structure.log;
0056 importancefactors=log(importancefactors)/log(logvalue);
0057 end
0058
0059
0060 [epart npart]=MeshPartition(md,md.npart);
0061
0062
0063 gridimportance=importancefactors(npart);
0064
0065
0066 [x y z elements is2d]=processmesh(md,options_structure);
0067
0068
0069 if ~isnan(options_structure.edgecolor),
0070 edgecolor=options_structure.edgecolor;
0071 else
0072 edgecolor='none';
0073 end
0074
0075
0076 subplot(width,width,ii);
0077
0078
0079 if is2d,
0080 A=elements(:,1); B=elements(:,2); C=elements(:,3);
0081 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', gridimportance,'FaceColor','interp','EdgeColor',edgecolor);
0082 else
0083 error('plot_importancefactors error message: 3d meshes not supported yet');
0084 end
0085
0086
0087 applyoptions(md,[],options_structure);