?? fdtd_2d_te_lorentz_periodic.cpp
字號:
// FDTD_2D_TE_LORENTZ_PERIODIC.cpp: implementation of the CFDTD_2D_TE_LORENTZ_PERIODIC class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "fdtd_2D_TE_PML_Lorentz_period.h"
#include "FDTD_2D_TE_LORENTZ_PERIODIC.h"
#include "Matrix.h"
#include "Math.h"
#include <stdlib.h> /* For _MAX_PATH definition */
#include <malloc.h>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CFDTD_2D_TE_LORENTZ_PERIODIC::CFDTD_2D_TE_LORENTZ_PERIODIC()
{
Hz = NULL;
Ex = NULL; Dx = NULL; Gx = NULL;
Sx = NULL; Sx_2 = NULL;
Ey = NULL; Dy = NULL;
Sy = NULL; Sy_2 = NULL;
//PML
K_E1_a = NULL; K_E1_b = NULL;
K_E3_a = NULL; K_E3_b = NULL;
K_E6_a = NULL; K_E6_b = NULL;
//Material
K_a = NULL; K_b = NULL; K_c = NULL;
Hz_Foll = NULL; Ex_Foll = NULL; Ey_Foll = NULL;
pi = 3.1415926535897932384626433832795;
eps_0 = 8.854e-12; // [F/m]
mu_0 = 4*pi*1e-7; // [H/m]
}
CFDTD_2D_TE_LORENTZ_PERIODIC::~CFDTD_2D_TE_LORENTZ_PERIODIC()
{
Free_Mem();
}
///////////////////////////////////////////////////////////////////////////////////////
//Init Main Parameters
///////////////////////////////////////////////////////////////////////////////////////
BOOL CFDTD_2D_TE_LORENTZ_PERIODIC::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)
{
Index = index; //contains the indices of the material type. Dimension [nx][ny]
//dimensions of the computational space
nx = n_x;
ny = n_y;
//contains the material parameters [eps_r mu_r]
Mater = mater;
n_Mat = n_mat;
//dimension of the PML region
n_PML = n_pml;
dx = d_x;
dy = d_y;
dt = d_t; //the time step
//////////////////////////////////////////////////////
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -