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

📄 read_input_file.h

📁 fdtd 3D xyzPML MPI OpenMP
💻 H
字号:
#include <iostream>
#include <fstream>
#include <malloc.h>
#include <new>

using namespace std;

#ifndef _Struct3_
	typedef struct
	{
		#ifdef _OPENMP
			int num_threads; //nr of threads 
		#endif

		//division of the computational space between processes
		long iProcs, jProcs, kProcs;
		
		//total number of cells in x, y and z direction
		long nx, ny, nz; 
		
		//[cells] the sizes of PML zone
		long nPML_x_1, nPML_x_2, nPML_y_1, nPML_y_2, nPML_z_1, nPML_z_2;

		//the PML parameters in x,y and z direction
		double PML_eps_r_x_1, PML_mu_r_x_1;
		double PML_eps_r_x_2, PML_mu_r_x_2;
		double PML_eps_r_y_1, PML_mu_r_y_1;
		double PML_eps_r_y_2, PML_mu_r_y_2;
		double PML_eps_r_z_1, PML_mu_r_z_1;
		double PML_eps_r_z_2, PML_mu_r_z_2;

		//the space divisions in x, y and z
		double dx, dy, dz;

		long num_iter; //the number of FDTD iterations
		double limit_time;//the running time in [s], after it saves out all workspace data in binary

		int load_workspace_data; //true - load the workspace data and continue computations
		char *Path_Load_Workspace_Data; //the location of workspace data from the previous run

		//Save Data
		int save_field; //to save data - Ex, Ey, Ez, Hx, Hy, Hz slices
		long nr_Save; //save with this increment
		long saveFROMinst, saveTOinst; //between these iteration steeps
		long save_slice_nx, save_slice_ny, save_slice_nz; //the planes which will be saved

		//the excitation
		long source_type;    // 1- Gauss; 2- Sin; 3- Gauss-Sin
		long jel_plane_wave; //the type of the excitation 0 - point  source
							 //                           1 - plane wave
		
		//point source
		int readFile_Param_Pt_Source;//in case of point source read from file or directly the pulse param
		long n_Coord; //nr of point sources
		char *path_name_CoordPointSource; //the coordinates of point sources
		char *path_name_ParamPointSource; //the Param of Point sources
		int pt_source_Ex, pt_source_Ey, pt_source_Ez; //Ez point source
		int pt_source_Hx, pt_source_Hy, pt_source_Hz; //Hz point source

		//plane wave
		long n_TS; //the dimension of the Scattered Field zone
		long nPML_1D; //[cells] the sizes of the 1D FDTD PML zone
		double PML_eps_r_1D, PML_mu_r_1D;

		double teta, phi, gamma;  //angles which determine the direction and polarization of the plane wave
						          //teta - polar angle ( 0 - pi ) (related to z axis)
			                      //phi  - azimuth angle ( 0 - 2*pi ) (related to x axis)
		//Parameters of the pulse
		double X0, tw, t0, omega, phase, const_alfa;
		
		//the file which describe the geometry
		char *path_name_Index; 
		//the file with material parameters
		long n_Mat;//nr of materials
		char *path_name_MatParam;

		//the followed points
		int load_foll_field_points; //if 1 - load the followed points from file
		long n_Ind_F;               //nr of followed point
		char *path_name_foll_field_points; //path

		//write out the nr of steeps in FDTD run
		int nr_cout;

		//save the data
		char *path_save_data; //the path where the output data will be saved
	}Input_Data;

	#define _Struct3_
#endif

int readFile_fdtd_data(Input_Data *Inp_D, char *ut_nev);
template <class T>int ReadFileVar(ifstream *inClientFile, char var_name[], T *var);
int ReadFileVarString(ifstream *inClientFile, char var_name[], char **var);

⌨️ 快捷键说明

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