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

📄 part_7.br

📁 The Finite Difference Time Domain Method for Electromagnetics With MATLAB Simulations Atef Elshe
💻 BR
字号:
		// Copy the proper streams back into C arrays 
		// so we can output them

		// Check which is the last streams updated		

	        if(i%2==0) {
			streamWrite(Ez, outputEz);
			streamWrite(Hx, outputHx);
			streamWrite(Hy, outputHy);
		} else {
			streamWrite(o_Ez, outputEz);
			streamWrite(o_Hx, outputHx);
			streamWrite(o_Hy, outputHy);
		}


		// Close The Observation and Data Files		
		fclose (pFile);
		fclose (pFile2);
		
		// Output the field states into a text file
		pFile = fopen ("Ezdata.txt","wt");
		pFile2 = fopen ("Hxdata.txt","wt");
		pFile3 = fopen ("Hydata.txt","wt");

		for (j=0; j<ny; j++) {
			for (i=0; i<nx; i++) {
				fprintf (pFile,"%e ",outputEz[nx*j+i]);
		                fprintf (pFile2,"%e ",outputHx[nx*j+i]);
                		fprintf (pFile3,"%e ",outputHy[nx*j+i]);
			}
			fprintf (pFile,"\n");
			fprintf (pFile2,"\n");
			fprintf (pFile3,"\n");
		}
	}

	// Close Field Files
	fclose (pFile);
	fclose (pFile2);
	fclose (pFile3);
	printf("Program complete\n");
	return 0;
}

⌨️ 快捷键说明

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