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

📄 fdtd_2d_te.h

📁 2DFDTD程序
💻 H
字号:
// FDTD_2D_TE.h: interface for the FDTD_2D_TE class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FDTD_2D_TE_H__63717802_D77A_4960_B3AE_37AD9CB18E09__INCLUDED_)
#define AFX_FDTD_2D_TE_H__63717802_D77A_4960_B3AE_37AD9CB18E09__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "FDTD_1D_HzEy.h"

class FDTD_2D_TE:public FDTD_1D_HzEy 
{
private:
	double pi;
	double eps_0, mu_0;

	int ** Index;
	double ** Mater;

	double **Fz, **Hz;
	double **Ex, **Gx;
	double **Ey, **Gy;  

	double Fz_r, Gx_r, Gy_r;

	double *K_E2_a, *K_E4_a, *K_E5_a;
	double *K_E2_b, *K_E4_b, *K_E5_b;

	//dimensions of the computational space
    int nx, ny;
	double dx, dy, dt;
	//number of materials present in the investigated geometry
	int n_Mat;
	//dimension of the PML region
	int n_PML;
	
	int i, j;

	double mu_r, eps_r;

	int jel_source_type; //the type of the excitation
	double H0, t0, tw, omega, phi;   //parameters of the excitation
	//Soft source
	int n_x_P, n_y_P;    //coordinates of the point source 
	int **Coord; //line source (multiple point source)
	int n_Coord; //the number of points in the line source
	//Total field - Scattered field plane wave formulation
	int n_x_a, n_x_b, n_y_a, n_y_b; //coordinates of the Total field-Scattered field region

	int **Ind_Foll; //the coordinates of the followed field components
	int length_Ind_Foll, n_tot; //number of the followed points and the number of iterations
	double **Hz_Foll, **Ex_Foll, **Ey_Foll;//strores the followed field components
	
public:
	FDTD_2D_TE();
	virtual ~FDTD_2D_TE();

    BOOL Init_Main_Param(int ** &index, int n_x, int n_y, double ** &mater, int n_mat, 
	  				     int n_pml, double d_t, double d_x, double d_y);
	
	void Set_PML_Param();
		
	void calc_Hz_TE();
	void calc_Ex_TE();
	void calc_Ey_TE();
	

	//Functions referring to excitation
	//Point Source
	void Init_Gauss_Point_Source(int n_x_p, int n_y_p, double h0, double t_0, double t_w);
	void Init_Sinus_Point_Source(int n_x_p, int n_y_p, double h0, double omega, 
		                         double phase);
	void Init_PulseGS_Point_Source(int n_x_p, int n_y_p, double h0, double t_0, double t_w,
		                           double omega, double phase);
	void Point_Source(double time); 

	//Line Source
	void Init_Gauss_Line_Source(int ** &Coord, int n_Co, double h0, double t_0, double t_w);
	void Line_Source(double time); 

	//Plane wave with Total field - Scattered field formulation
	void Init_TotFScatF(int n_xa, int n_xb, double H0, double t0, double tw, double omega, 
		                double phi, int jel);
	void incident_Hz();
	void incident_Ex();
	void incident_Ey();

	//Periodic Boundary conditions
	void periodic_Hz();
	void periodic_Ex();

	//Free the allocated memory
	void Free_Mem();

	//the coordinates of the followed field components
	BOOL Init_Followed(int **Ind_Followed, int n, int n_t);
	void Set_Data_Followed(int n_t);
	void Get_Data_Followed(double **&A, double **&B, double **&C);
	
	//Outputs the field components
	void Get_Data(double **&A, double **&B, double **&C);
};

#endif // !defined(AFX_FDTD_2D_TE_H__63717802_D77A_4960_B3AE_37AD9CB18E09__INCLUDED_)

⌨️ 快捷键说明

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