source: issm/branches/trunk-jpl-damage/src/m/model/plot/plot_qmumean.m@ 11503

Last change on this file since 11503 was 9650, checked in by Mathieu Morlighem, 14 years ago

Added qmu object

File size: 1.5 KB
Line 
1function plot_qmumean(md,options,nlines,ncols,i);
2%PLOT_QMUMEAN - plot mean of a scaled response
3%
4% Usage:
5% plot_qmumean(md,options,nlines,ncols,i);
6%
7% See also: PLOTMODEL
8
9%plot mesh
10subplot(nlines,ncols,i);
11
12%edgecolor
13edgecolor=getfieldvalue(options,'edgecolor','none');
14
15%process data and model
16[x y z elements is2d isplanet]=processmesh(md,[],options);
17
18%find response function
19if exist(options,'qmudata'),
20 descriptor=getfieldvalue(options,'qmudata');
21 if ~ischar(descriptor),
22 error('plot_qmumean error message: descriptor should be a string');
23 end
24else
25 error('plot_qmumean error message: provide descriptor of response function in ''qmudata'' option');
26end
27
28%go pick up the response:
29allresponses=md.qmu.results.dresp_out;
30responses=zeros(md.qmu.numberofpartitions,1);
31
32count=1;
33for i=1:length(allresponses),
34 d=allresponses(i).descriptor;
35 if strncmpi(d,'scaled_',7),
36 d=d(8:end);
37 if strncmpi(d,descriptor,length(descriptor)),
38 responses(count)=allresponses(i).mean;
39 count=count+1;
40 end
41 end
42end
43
44%log?
45if exist(options,'log'),
46 responses=log(responses)/log(getfieldvalue(options,'log'));
47end
48
49%now, project onto vertices
50responses_on_node=responses(md.qmu.partition+1);
51
52%plot
53A=elements(:,1); B=elements(:,2); C=elements(:,3);
54patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', responses_on_node,'FaceColor','interp','EdgeColor',edgecolor);
55
56%apply options
57options=addfielddefault(options,'title',['Mean distribution of ' descriptor]);
58options=addfielddefault(options,'colorbar',0);
59applyoptions(md,[],options);
Note: See TracBrowser for help on using the repository browser.