source: issm/trunk/src/m/plot/plot_importancefactors.m@ 13975

Last change on this file since 13975 was 13975, checked in by Mathieu Morlighem, 12 years ago

merged trunk-jpl and trunk for revision 13974

File size: 2.4 KB
Line 
1function plot_importancefactors(md,options,width,ii)
2%PLOT_IMPORTANCEFACTORS - plot importance factors
3%
4% Usage:
5% plot_importancefactors(md,options,width,i);
6%
7% See also: PLOTMODEL
8
9%first recover design variable descriptor
10if exist(options,'designvariable'),
11 descriptor=getfieldvalue(options,'designvariable');
12else
13 error('plot_importancefactors error message: Need to supply design variable descriptor');
14end
15descriptorlength=length(descriptor);
16
17%then recover responsfunction name
18if exist(options,'responsefunction'),
19 responsefunctiondescriptor=getfieldvalue(options,'responsefunction');
20else
21 error('plot_importancefactors error message: Need to supply response function descriptor');
22end
23
24%go through all response functions and find the one corresponding to the correct responsefunctiondescriptor
25responsefunctions=md.qmu.results{2};
26found=0;
27for i=1:length(responsefunctions),
28 if strcmpi(responsefunctions(i).descriptor,responsefunctiondescriptor),
29 found=i;
30 break;
31 end
32end
33if ~found,
34 error('plot_importancefactors error message: could not find correct response function');
35end
36responsefunctions=responsefunctions(found);
37nfun=size(responsefunctions.desvar,1);
38
39%Now recover response to the correct desgin variable
40importancefactors=zeros(md.qmu.numberofpartitions,1);
41count=0;
42for i=1:nfun,
43 desvar=responsefunctions.desvar{i};
44 if strncmpi(desvar,descriptor,descriptorlength),
45 count=count+1;
46 importancefactors(count)=responsefunctions.impfac(i);
47 end
48end
49if count==0,
50 error('plot_importancefactors error message: could not find to response functions with corresponding design variable');
51end
52
53%log?
54if exist(options,'log'),
55 logvalue=getfieldvalue(options,'log');
56 importancefactors=log(importancefactors)/log(logvalue);
57end
58
59%Ok, get partitioning.
60[epart npart]=MeshPartition(md,md.qmu.numberofpartitions);
61
62%distribute importance factor
63nodeimportance=importancefactors(npart);
64
65%process data and model
66[x y z elements is2d isplanet]=processmesh(md,[],options);
67
68%edgecolor
69edgecolor=getfieldvalue(options,'edgecolor','none');
70
71%standard plot:
72subplot(width,width,ii);
73
74%ok, plot nodeimportance now.
75if is2d,
76 A=elements(:,1); B=elements(:,2); C=elements(:,3);
77 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', nodeimportance,'FaceColor','interp','EdgeColor',edgecolor);
78else
79 error('plot_importancefactors error message: 3d meshes not supported yet');
80end
81
82%apply options
83applyoptions(md,[],options);
Note: See TracBrowser for help on using the repository browser.