1*c4762a1bSJed Brown% 2*c4762a1bSJed Brown% Loads the output from ex7 (option -ts_monitor_solution_binary) and puts it into a useful 3*c4762a1bSJed Brown% format for visualizing. Removes the first 49 y grid lines since they have noise from the initial 4*c4762a1bSJed Brown% conditions. For example: 5*c4762a1bSJed Brown% 6*c4762a1bSJed Brown% contourf(A{49}) and contourf(B{49}) 7*c4762a1bSJed Brown% 8*c4762a1bSJed BrownAA = PetscBinaryRead('binaryoutput','cell',10000); 9*c4762a1bSJed Brownl = size(AA); l = l(2); 10*c4762a1bSJed BrownA = cell(1,l-80-1); 11*c4762a1bSJed Brownfor i=1:l-80-1; A{1,i} = AA{i+79}; end; 12*c4762a1bSJed Brownl = size(A); l = l(2); 13*c4762a1bSJed Brownn = size(A{1}); n = sqrt(n(1)); 14*c4762a1bSJed Brownfor i=1:l; A{i} = reshape(A{i},n,n); end 15*c4762a1bSJed BrownB = A; 16*c4762a1bSJed Brown 17*c4762a1bSJed Brownfor i=1:l 18*c4762a1bSJed Brown for j=1:n; A{i}(:,j) = min(A{i}(:,j)); end 19*c4762a1bSJed Brown for j=1:n; B{i}(:,j) = B{i}(:,j) - min(B{i}(:,j)); end 20*c4762a1bSJed Brownend 21*c4762a1bSJed Brown 22*c4762a1bSJed Brownfor i=1:l 23*c4762a1bSJed Brown A{i} = A{i}(:,50:n); 24*c4762a1bSJed Brown B{i} = B{i}(:,50:n); 25*c4762a1bSJed Brownend 26*c4762a1bSJed Brown 27*c4762a1bSJed Browna = zeros(l-1,1); 28*c4762a1bSJed Brownfor i=1:l-1; a(i) = max(max(A{i+1}))/max(max(A{i})); end 29*c4762a1bSJed Brownb = zeros(l-1,1); 30*c4762a1bSJed Brownfor i=1:l-1; b(i) = max(max(B{i+1}))/max(max(B{i})); end 31