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

📄 fdtd_2d_te_lorentz.h

📁 用C++编写的处理色散媒质的FDTD程序
💻 H
字号:
// FDTD_2D_TE_LORENTZ.h: interface for the CFDTD_2D_TE_LORENTZ class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FDTD_2D_TE_LORENTZ_H__0F98089C_FFEA_4332_82A8_891797C7D7AE__INCLUDED_)
#define AFX_FDTD_2D_TE_LORENTZ_H__0F98089C_FFEA_4332_82A8_891797C7D7AE__INCLUDED_

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

#include "FDTD_1D_HzEy_LORENTZ.h"

class CFDTD_2D_TE_LORENTZ: public CFDTD_1D_HzEy_LORENTZ  
{
private:
	double pi;
	double eps_0, mu_0;

	int    ** Index;
	double ** Mater;

	double **Fz, **Hz;
	double **Ex, **Dx, **Gx;
	double ***Sx, ***Sx_2;
	double **Ey, **Dy, **Gy;  
	double ***Sy, ***Sy_2;

	double Fz_r, Gx_r, Gy_r, Sx_r, Sy_r;

	double **W; //the energy values in the computation domain 
	int n_W_x_a, n_W_x_b, n_W_y_a, n_W_y_b; 

	//Geometry - PML
	double *K_E1_a, *K_E2_a, *K_E3_a, *K_E4_a, *K_E7_a, *K_E8_a;
	double *K_E1_b, *K_E2_b, *K_E3_b, *K_E4_b, *K_E7_b, *K_E8_b;
	
	//Geometry - Lorentz material
	double **K_a, **K_b, **K_c;
	
	//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;

	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;//stores the followed field components
	int length_Ind_Foll_W; //number of the followed points and the number of iterations
	int **Ind_Foll_W; //the coordinates of the followed energy
	double **W_Foll;//stores the followed energy

public:
	CFDTD_2D_TE_LORENTZ();
	virtual ~CFDTD_2D_TE_LORENTZ();

    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);

	BOOL Init_W(int n_w_x_a, int n_w_x_b, int n_w_y_a, int n_w_y_b);
	
	void Set_PML_Param(double eps_r, double mu_r);
		
	void calc_Hz_TE();
	void calc_Ex_TE();
	void calc_Ey_TE();
	void calc_W();
	

	//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, int n_ya, int n_yb, double H0, double t0, double tw, 
		                double omega, double phi, int jel, double eps_r, double mu_r);

	//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);
	BOOL Init_Followed_W(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);
	void Set_Data_Followed_W(int n_t);
	void Get_Data_Followed_W(double **&A);
	
	//Outputs the field components
	void Get_Data(double **&A, double **&B, double **&C);
	void Get_W(double **&A);

};

#endif // !defined(AFX_FDTD_2D_TE_LORENTZ_H__0F98089C_FFEA_4332_82A8_891797C7D7AE__INCLUDED_)

⌨️ 快捷键说明

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