-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCuDeTionlineoutmovie.m
113 lines (103 loc) · 3.02 KB
/
CuDeTionlineoutmovie.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
%movie for flash lineoutsets
function []=CuDeTionlineoutmovie(var1, var2, FLASH, xoffset, y1unit, y2unit,loops )
if ~exist('xoffset','var')
xoffset=0;
end
if ~exist('y1unit','var')
y1unit=1;
end
if ~exist('y2unit','var')
y2unit=1;
end
figure
title('Cu density and ion temperature at 0.00 ns');
i=0;
%var1='dens';
%var2='tele'
x1=xoffset+FLASH.([var1,num2str(i,'%04i')])(:,1);
y1=FLASH.([var1,num2str(i,'%04i')])(:,2)./y1unit;
x2=xoffset+FLASH.([var2,num2str(i,'%04i')])(:,1);
y2=FLASH.([var2,num2str(i,'%04i')])(:,2)./y2unit;
hline1=plot(x1,y1,'LineWidth',1);
title('Cu density and ion temperature at at 0.00 ns');
%hold on;
%surf(Z)
%axis tight manual
ax1 = gca; %get current axes
ax1.Box='off';
ax1.YScale='linear';
%ax1_pos = ax1.Position; % position of first axes
ax1.YLim=[0 5];
ax1.XLim=[0 0.12];
ax1.NextPlot = 'replaceChildren';
%after 2014b, it's OK, to use a dot to set properties.
ax1.XAxisLocation='top';
ax1.YAxisLocation='left';
ax1.FontSize=14;
%legend('Mass Density');
%xlabel('Position (cm)');
ylabel('Cu Density (g/cc)');
ax1_pos = ax1.Position; % position of first axes
ax2 = axes('Position',ax1_pos,...
'XAxisLocation','bottom',...
'YAxisLocation','right',...
'Color','none',...
'YScale','linear');
ax2.YLim=[0 10];
ax2.XLim=ax1.XLim;
ax2.FontSize=ax1.FontSize;
hline2=line(x2,y2,'Parent', ax2,'LineWidth',1,'Color','r');
ax2.NextPlot = 'replaceChildren';
grid(ax2,'on');
ylabel('Temperature (eV)');
xlabel('Position (cm)');
%legend('Electron Temperautre');
%loops = 90;
F(loops) = struct('cdata',[],'colormap',[]);
for j = 1:loops
x1=xoffset+FLASH.([var1,num2str(j,'%04i')])(:,1);
y1=FLASH.([var1,num2str(j,'%04i')])(:,2)./y1unit;
x2=xoffset+FLASH.([var2,num2str(j,'%04i')])(:,1);
y2=FLASH.([var2,num2str(j,'%04i')])(:,2)./y2unit;
axes(ax1);
%hline1=plot(ax1, x1,y1,'LineWidth',1);
hline1=plot( x1,y1,'Parent',ax1,'LineWidth',1);
title(['Cu density and ion temperature at ',num2str(j*0.2,'%.2f'),' ns']);
%hold on;
%surf(Z)
%axis tight manual
%ax1 = gca; %get current axes
%ax1.Box='off';
%ax1.YScale='log';
%ax1_pos = ax1.Position; % position of first axes
%ax1.YLim=[1e-9 100];
%ax1.NextPlot = 'replaceChildren';
%after 2014b, it's OK, to use a dot to set properties.
%ax1.XAxisLocation='bottom';
%ax1.YAxisLocation='left';
%legend('Mass Density');
%xlabel('Position (cm)');
%ax2 = axes('Position',ax1_pos,...
% 'XAxisLocation','top',...
% 'YAxisLocation','right',...
% 'Color','none',...
% 'YScale','log');
axes(ax2);
hline2=plot(x2,y2,'Parent',ax2,'LineWidth',1,'Color','r');
%ylabel('Temperature (eV)');
%ax2.Box='off';
% drawnow
F(j) = getframe(gcf);%use gcf to get whole figure frame.
%hLine = line([1 1], [0 0]); % draw line this can add aline
%delete(hLine) % delete the line
end
movie(F,1)
%movie(F,2)
%myVideo=VideoWrite('try.avi');
%Undefined function 'VideoWrite' for input arguments of type 'char'.
myVideo=VideoWriter([inputname(3),var1,var2,'.avi']);
myVideo.FrameRate = 10; % Default 30
myVideo.Quality = 75; % Default 75
open(myVideo);
writeVideo(myVideo, F);
close(myVideo)