| 1 | function plot_parthist(md,options,nlines,ncols,i);
|
|---|
| 2 | %PLOT_PARTHIST - plot partitioning histogram
|
|---|
| 3 | %
|
|---|
| 4 | % Usage:
|
|---|
| 5 | % plot_parthist(md,options,nlines,ncols,i);
|
|---|
| 6 | %
|
|---|
| 7 | % See also: PLOTMODEL
|
|---|
| 8 |
|
|---|
| 9 | %process data and model
|
|---|
| 10 | [x y z elements is2d isplanet]=processmesh(md,[],options);
|
|---|
| 11 |
|
|---|
| 12 | %plot mesh
|
|---|
| 13 | subplot(nlines,ncols,i);
|
|---|
| 14 |
|
|---|
| 15 | imin=min(md.qmu.partition);
|
|---|
| 16 | imax=max(md.qmu.partition);
|
|---|
| 17 |
|
|---|
| 18 | part=zeros(imax-imin+1,2);
|
|---|
| 19 |
|
|---|
| 20 | for i=imin:imax
|
|---|
| 21 | ind=find(md.qmu.partition == i);
|
|---|
| 22 | part(i-imin+1,1)=length(ind);
|
|---|
| 23 | part(i-imin+1,2)=sum(md.vertex_weight(ind));
|
|---|
| 24 | end
|
|---|
| 25 |
|
|---|
| 26 | %subplot(2,1,1)
|
|---|
| 27 | bar(imin:imax,part(:,1));
|
|---|
| 28 | %xlim([imin-0.5 imax+0.5])
|
|---|
| 29 | %title('Number of Nodes in Each Partition')
|
|---|
| 30 | options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
|
|---|
| 31 | options=addfielddefault(options,'title','Number of Nodes in Each Partition');
|
|---|
| 32 | options=addfielddefault(options,'colorbar','off');
|
|---|
| 33 |
|
|---|
| 34 | %subplot(2,1,2)
|
|---|
| 35 | %bar(imin:imax,part(:,2));
|
|---|
| 36 | %xlim([imin-0.5 imax+0.5])
|
|---|
| 37 | %title('Total Weight in Each Partition')
|
|---|
| 38 | %options=addfielddefault(options,'xlim',[imin-0.5 imax+0.5]);
|
|---|
| 39 | %options=addfielddefault(options,'title','Total Weight in Each Partition');
|
|---|
| 40 | %options=addfielddefault(options,'colorbar','off');
|
|---|
| 41 |
|
|---|
| 42 | %apply options
|
|---|
| 43 | applyoptions(md,[],options);
|
|---|