📄 shuju8.h
字号:
/*引入总场域,引入均匀平面波*/
#include <stdio.h>
#include <math.h>
float f=3.0e8; /*定义频率2G*/
#define Pi 3.141592653
#define pi 3.141592653
#define c 300000000
#define Np 1050 //fft变换的点数
#define dt 3.333e-11 /*定义时间单位步长1*10^(-8)*/
#define NN 1050/*定义跌代次数*/
const float ee=1/(36*Pi)*0.000000001;
const float u=4*Pi*0.0000001;
const float er=1.0; //介质介电常数
const float sig=0; //介质导电率
float e=ee;
//const float a=39.22/1000; //天线尺寸(波长数)
//const float b=46.30/1000;
//const float d=1.0/1000; //天线厚度
//const float A=3*a; //介质板电尺寸
//const float B=3*b; //介质板电尺寸
//const float D=7.976/1000; //介质板厚度
const int DD=40; //每波长剖分段数
//const float dx=a/DD;
//const float dy=b/DD;
//const float dz=1.99/1000; //常数为介质剖分段数
const int D=10; //两个阵子间距
const float dx=(c/f)/DD;
const float dy=(c/f)/DD;
const float dz=(c/f)/DD; //常数为介质剖分段数
const int Nx=74; /*定义剖分网格数*/
const int Ny=74; /*定义剖分网格数*/
const int Nz=74; /*定义剖分网格数*/
const int DDD=3; //外推数据边界到PML边界距离
//const int kx=10; //溃源位置(相对天线正中)
//const int ky=10; //溃源位置(相对天线正中)
const float r0=(c/f)/400;
const float r1=(c/f)/400;
#define NNN 6 //定义PML层厚度
#define sgmmax 0.3054
float Ezx[Nx+1][Ny+1][Nz];/*定义全局z向电场*/
float Exy[Nx][Ny+1][Nz+1];/*定义全局x向电场*/
float Eyx[Nx+1][Ny][Nz+1];/*定义全局y向电场*/
float Hzx[Nx][Ny][Nz+1];/*定义全局z向磁场*/
float Hxy[Nx+1][Ny][Nz];/*定义全局x向磁场*/
float Hyx[Nx][Ny+1][Nz];/*定义全局y向磁场*/
/*1代表前一时刻,2代表后一时刻*/
float Ezy[Nx+1][Ny+1][Nz];/*定义全局z向电场*/
float Exz[Nx][Ny+1][Nz+1];/*定义全局x向电场*/
float Eyz[Nx+1][Ny][Nz+1];/*定义全局y向电场*/
float Hzy[Nx][Ny][Nz+1];/*定义全局z向磁场*/
float Hxz[Nx+1][Ny][Nz];/*定义全局x向磁场*/
float Hyz[Nx][Ny+1][Nz];/*定义全局y向磁场*/
/*1代表前一时刻,2代表后一时刻*/
//float E1[NN]; /*E场值随时间变化*/
//float H1[NN]; /*H场值随时间变化*/
float sgmx,sgmy,sgmz,sgmmx,sgmmy,sgmmz;
float Iz=0,Uz=0;
int flag=1; //定义传值时间
void fuzhi();
int chuanbo1(int M);
int chuanbo2(int M);
int bianjie();
void waitui(int M);
void zukang();
void zhubobi();
void ffft(float *p1,float *p2);
void distill(int M);
//int shuchu(int M);
// float fxhs[90][90],rou[NN/2]; //远区电场,驻波比
float rou[NN/2]; //远区电场,驻波比
float si[181],co[181];
int flag3=1; /*定义传值时刻*/
struct bb
{
float shi;
float xu;
}pp1[Np],pp2[Np],zk[Np/2],fxhs[181];
struct bb chu(struct bb p,struct bb q);
struct bb pr[300];
float In1[DD/2+1],In2[DD/2+1];
struct cc
{
float zhengfu;
float xiangwei;
}current1[DD/2+1],current2[DD/2+1];
struct cc Jxu[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1],Jxl[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1];
struct cc Jxd[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1],Jxr[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1];
struct cc Jyu[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD],Jyf[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD];
struct cc Jyd[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD],Jyb[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD];
struct cc Jzl[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1],Jzf[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD];
struct cc Jzr[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1],Jzb[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD];
struct cc Jmxu[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1],Jmxl[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1];
struct cc Jmxd[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1],Jmxr[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1];
struct cc Jmyu[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD],Jmyf[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD];
struct cc Jmyd[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD],Jmyb[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD];
struct cc Jmzl[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1],Jmzf[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD];
struct cc Jmzr[Nx-2*NNN-2*DDD][Ny-2*NNN-2*DDD+1],Jmzb[Nx-2*NNN-2*DDD+1][Ny-2*NNN-2*DDD];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -