📄 runfdtd.m
字号:
function RunFDTD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Electromagnetic Finite-Difference Time-Domain %
% Version 1.20, Release 1 %
% %
% (C) Copyright 2005 %
% Sharif University of Technology %
% School of Electrical Engineering %
% All Rights Reserved %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global Time TimeSteps SnapshotTimes BoundaryType
global xProbe yProbe U TimeDecimation PowerTime
global Animate True False
USave=[];
d=-1;
InitialField;
for Time=1:TimeSteps
AdvanceMTime;
AdvanceETime;
AddSource;
if ismember(Time,SnapshotTimes)
GenerateSnapShot;
end
if Time>=PowerTime
MeasurePower;
end
d=mod(d+1,TimeDecimation);
if d==0
USave=[USave; real(U(xProbe,yProbe))];
end
if Animate==True
PlotSnapshot
pause
end
end
if BoundaryType==0 | BoundaryType==6
PlotSnapshot;
end
SaveField(USave)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -