improved3.c
来自「国外一大学教授讲章」· C语言 代码 · 共 33 行
C
33 行
/* FDTD simulation where main() is primarily used to call other * functions that perform the necessary operations. */#include "fdtd3.h"int main(){ Grid *g; ALLOC_1D(g,1,Grid); // allocate memory for Grid gridInit3(g); // initialize the grid tfsfInit(g); // initialize TFSF boundary snapshotInit(g); // initialize snapshots /* do time stepping */ for (Time=0; Time<MaxTime; Time++) { updateH3(g); // update magnetic field tfsfUpdate(g); // correct field on TFSF boundary abc(g); // apply ABC updateE3(g); // update electric field snapshot(g); // take a snapshot (if appropriate) } /* end of time-stepping */ return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?