⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 3d-tfsf-demo.c

📁 利用VC++进行FDTD三维远近场变换
💻 C
字号:
/* 3D simulation with a TFSF boundary. */

 #include "fdtd-alloc.h"
 #include "fdtd-macro.h"
 #include "fdtd-proto.h"

 int main()
 {
	 Grid *g;

	 ALLOC_1D(g,1,Grid); // allocate memory for grid structure
	 gridInit(g); // initialize 3D grid

	 tfsfInit(g); // initialize TFSF boundary
	 abcInit(g); // initialize ABC
	 snapshotInit3d(g); // initialize snapshots

	 /* do time stepping */
	 for (Time=0; Time<MaxTime; Time++) {
		 updateH(g); // update magnetic fields
		 tfsf(g); // apply correction to TFSF boundary
		 updateE(g); // update electric fields
		 abc(g); // apply ABC
		 snapshot3d(g); // take a snapshot (if appropriate)
		 printf("\n %f", Ex(8,8,8));
	 } // end of time-stepping

 	return 0;
 }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -