📄 improved2.c
字号:
/* Further improved bare-bones 1D FDTD simulation. */#include "fdtd2.h"#include "ezincarg.h"int main(){ Grid *g; ALLOC_1D(g,1,Grid); // allocate memory for Grid /* Initialize the grid. */ gridInit2(g); /* initialize source function */ ezIncArgInit(1.0,30.0,10.0); /* do time stepping */ for (Time=0; Time<MaxTime; Time++) { /* update magnetic field */ updateH2(g); /* update electric field */ updateE2(g); /* apply source function at time "Time" and location zero */ Ez(0) = ezInc(Time,0.0); printf("%g\n",Ez(50)); } /* end of time-stepping */ return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -