📄 part_1.br
字号:
// GPU Function For H Fields
kernel void process_field_H(float Hx[][], float Chxh[][],
float Chxe[][], float Hy[][], float Chyh[][],
float Chye[][], float Ez[][], float Khx[], float Khy[],
float Bhx[], float Bhy[], float Chx[], float Chy[],
float psiHxy[][], float psiHyx[][],
float dx, float dy,
iter float2 it<>,
out float o_Hx<>, out float o_Hy<>,
out float o_psiHxy<>, out float o_psiHyx<> )
{
float2 t0 = float2(0.0f, 1.0f);
float2 t1 = float2(1.0f, 0.0f);
float pxy, pyx;
pxy = (Bhy[it.y] * psiHxy[it]) + (Chy[it.y] * (Ez[it+t0]-Ez[it]));
pyx = (Bhx[it.x] * psiHyx[it]) + (Chx[it.x] * (Ez[it+t1]-Ez[it]));
o_psiHxy=pxy;
o_psiHyx=pyx;
o_Hx = (Chxh[it] * Hx[it] ) + (Khy[it.y] * Chxe[it] / dy *
(Ez[it+t0]-Ez[it])) + (Chxe[it] * pxy);
o_Hy = (Chyh[it] * Hy[it] ) + (Khx[it.x] * Chye[it] / dx *
(Ez[it+t1]-Ez[it])) + (Chye[it] * pyx);
}
// GPU Function For E Fields
kernel void process_field_Ez( float Ez[][], float Ceze[][],
float Cezh[][], float Hx[][], float Hy[][],
float Cs[][], float Kex[], float Key[],
float Bex[], float Bey[],
float Cex[], float Cey[],
float psiEzx[][], float psiEzy[][],
float dx, float dy,
float gauss, iter float2 it<>,
out float o_Ez<>, out float o_psiEzx<>,
out float o_psiEzy<> )
{
float2 t0 = float2(0.0f, -1.0f);
float2 t1 = float2(-1.0f, 0.0f);
float pzx, pzy;
pzx = (Bex[it.x] * psiEzx[it]) + (Cex[it.x] * (Hy[it]-Hy[it+t1]));
pzy = (Bey[it.y] * psiEzy[it]) + (Cey[it.y] * (Hx[it]-Hx[it+t0]));
o_psiEzx=pzx;
o_psiEzy=pzy;
o_Ez = (Ceze[it] * Ez[it]) + (Kex[it.x] * (Cezh[it] / dx) *
(Hy[it]-Hy[it+t1])) + (Key[it.y] * (Cezh[it] / dy) *
(Hx[it]-Hx[it+t0])) - (Cs[it]*gauss) +
(Cezh[it] * pzx) + (Cezh[it] * pzy);
}
// Copy Kernel To Extract Single Points From a Stream
kernel void Copy( float input<>, out float output<> )
{
output = input;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -