PyPO User Manual
Kernelsf.cu File Reference

Kernels for CUDA PO calculations. More...

#include "InterfaceCUDA.h"

Functions

__host__ std::array< dim3, 2 > initCUDA (float k, float epsilon, int gt, int gs, float t_direction, int nBlocks, int nThreads)
 
__device__ void fieldAtPoint (float *d_xs, float *d_ys, float *d_zs, float *d_nxs, float *d_nys, float *d_nzs, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, float(&point)[3], float *d_A, cuFloatComplex(&d_ei)[3], cuFloatComplex(&d_hi)[3])
 
__global__ void GpropagateBeam_0_PEC (float *d_xs, float *d_ys, float *d_zs, float *d_A, float *d_xt, float *d_yt, float *d_zt, float *d_nxs, float *d_nys, float *d_nzs, float *d_nxt, float *d_nyt, float *d_nzt, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, cuFloatComplex *d_Jxt, cuFloatComplex *d_Jyt, cuFloatComplex *d_Jzt, cuFloatComplex *d_Mxt, cuFloatComplex *d_Myt, cuFloatComplex *d_Mzt)
 
__global__ void GpropagateBeam_0 (float *d_xs, float *d_ys, float *d_zs, float *d_A, float *d_xt, float *d_yt, float *d_zt, float *d_nxs, float *d_nys, float *d_nzs, float *d_nxt, float *d_nyt, float *d_nzt, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, cuFloatComplex *d_Jxt, cuFloatComplex *d_Jyt, cuFloatComplex *d_Jzt, cuFloatComplex *d_Mxt, cuFloatComplex *d_Myt, cuFloatComplex *d_Mzt)
 
__global__ void GpropagateBeam_2_PEC (float *d_xs, float *d_ys, float *d_zs, float *d_A, float *d_xt, float *d_yt, float *d_zt, float *d_nxs, float *d_nys, float *d_nzs, float *d_nxt, float *d_nyt, float *d_nzt, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, cuFloatComplex *d_Jxt, cuFloatComplex *d_Jyt, cuFloatComplex *d_Jzt, cuFloatComplex *d_Mxt, cuFloatComplex *d_Myt, cuFloatComplex *d_Mzt, cuFloatComplex *d_Ext, cuFloatComplex *d_Eyt, cuFloatComplex *d_Ezt, cuFloatComplex *d_Hxt, cuFloatComplex *d_Hyt, cuFloatComplex *d_Hzt)
 
__global__ void GpropagateBeam_1 (float *d_xs, float *d_ys, float *d_zs, float *d_A, float *d_xt, float *d_yt, float *d_zt, float *d_nxs, float *d_nys, float *d_nzs, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, cuFloatComplex *d_Ext, cuFloatComplex *d_Eyt, cuFloatComplex *d_Ezt, cuFloatComplex *d_Hxt, cuFloatComplex *d_Hyt, cuFloatComplex *d_Hzt)
 
__global__ void GpropagateBeam_2 (float *d_xs, float *d_ys, float *d_zs, float *d_A, float *d_xt, float *d_yt, float *d_zt, float *d_nxs, float *d_nys, float *d_nzs, float *d_nxt, float *d_nyt, float *d_nzt, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, cuFloatComplex *d_Jxt, cuFloatComplex *d_Jyt, cuFloatComplex *d_Jzt, cuFloatComplex *d_Mxt, cuFloatComplex *d_Myt, cuFloatComplex *d_Mzt, cuFloatComplex *d_Ext, cuFloatComplex *d_Eyt, cuFloatComplex *d_Ezt, cuFloatComplex *d_Hxt, cuFloatComplex *d_Hyt, cuFloatComplex *d_Hzt)
 
__global__ void GpropagateBeam_3 (float *d_xs, float *d_ys, float *d_zs, float *d_A, float *d_xt, float *d_yt, float *d_zt, float *d_nxs, float *d_nys, float *d_nzs, float *d_nxt, float *d_nyt, float *d_nzt, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, cuFloatComplex *d_Ext, cuFloatComplex *d_Eyt, cuFloatComplex *d_Ezt, cuFloatComplex *d_Hxt, cuFloatComplex *d_Hyt, cuFloatComplex *d_Hzt, float *d_Prxt, float *d_Pryt, float *d_Przt)
 
__device__ void farfieldAtPoint (float *d_xs, float *d_ys, float *d_zs, float *d_nxs, float *d_nys, float *d_nzs, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, float(&r_hat)[3], float *d_A, cuFloatComplex(&e)[3], cuFloatComplex(&h)[3])
 
void __global__ GpropagateBeam_4 (float *d_xs, float *d_ys, float *d_zs, float *d_nxs, float *d_nys, float *d_nzs, float *d_A, float *d_xt, float *d_yt, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, cuFloatComplex *d_Ext, cuFloatComplex *d_Eyt, cuFloatComplex *d_Ezt, cuFloatComplex *d_Hxt, cuFloatComplex *d_Hyt, cuFloatComplex *d_Hzt)
 
void __device__ scalarfieldAtPoint (float *d_xs, float *d_ys, float *d_zs, cuFloatComplex *d_sfs, float(&point)[3], float *d_A, cuFloatComplex &e)
 
void __global__ GpropagateBeam_5 (float *d_xs, float *d_ys, float *d_zs, float *d_A, float *d_xt, float *d_yt, float *d_zt, cuFloatComplex *d_sfs, cuFloatComplex *d_sft)
 
__host__ void _arrC1ToCUDAC (float *rarr, float *iarr, cuFloatComplex *carr, int size)
 
__host__ void _arrC3ToCUDAC (float *r1arr, float *r2arr, float *r3arr, float *i1arr, float *i2arr, float *i3arr, cuFloatComplex *c1arr, cuFloatComplex *c2arr, cuFloatComplex *c3arr, int size)
 
__host__ void _arrCUDACToC1 (cuFloatComplex *carr, float *rarr, float *iarr, int size)
 
__host__ void _arrCUDACToC3 (cuFloatComplex *c1arr, cuFloatComplex *c2arr, cuFloatComplex *c3arr, float *r1arr, float *r2arr, float *r3arr, float *i1arr, float *i2arr, float *i3arr, int size)
 
void callKernelf_JM (c2Bundlef *res, reflparamsf source, reflparamsf target, reflcontainerf *cs, reflcontainerf *ct, c2Bundlef *currents, float k, float epsilon, float t_direction, int nBlocks, int nThreads)
 
void callKernelf_EH (c2Bundlef *res, reflparamsf source, reflparamsf target, reflcontainerf *cs, reflcontainerf *ct, c2Bundlef *currents, float k, float epsilon, float t_direction, int nBlocks, int nThreads)
 
void callKernelf_JMEH (c4Bundlef *res, reflparamsf source, reflparamsf target, reflcontainerf *cs, reflcontainerf *ct, c2Bundlef *currents, float k, float epsilon, float t_direction, int nBlocks, int nThreads)
 
void callKernelf_EHP (c2rBundlef *res, reflparamsf source, reflparamsf target, reflcontainerf *cs, reflcontainerf *ct, c2Bundlef *currents, float k, float epsilon, float t_direction, int nBlocks, int nThreads)
 
void callKernelf_FF (c2Bundlef *res, reflparamsf source, reflparamsf target, reflcontainerf *cs, reflcontainerf *ct, c2Bundlef *currents, float k, float epsilon, float t_direction, int nBlocks, int nThreads)
 
void callKernelf_scalar (arrC1f *res, reflparamsf source, reflparamsf target, reflcontainerf *cs, reflcontainerf *ct, arrC1f *inp, float k, float epsilon, float t_direction, int nBlocks, int nThreads)
 

Variables

__constant__ cuFloatComplex con [CSIZE]
 
__constant__ float eye [3][3]
 
__constant__ int g_s
 
__constant__ int g_t
 

Detailed Description

Kernels for CUDA PO calculations.

Contains kernels for PO calculations. Multiple kernels are defined, each one optimized for a certain calculation.

Function Documentation

◆ _arrC1ToCUDAC()

__host__ void _arrC1ToCUDAC ( float *  rarr,
float *  iarr,
cuFloatComplex *  carr,
int  size 
)

Convert 2 arrays of floats to 1 array of cuComplex

Parameters
rarrReal part of complex array.
iarrReal part of complex array.
carrArray of cuFloatComplex, to be filled.
sizeSize of arrays.

◆ _arrC3ToCUDAC()

__host__ void _arrC3ToCUDAC ( float *  r1arr,
float *  r2arr,
float *  r3arr,
float *  i1arr,
float *  i2arr,
float *  i3arr,
cuFloatComplex *  c1arr,
cuFloatComplex *  c2arr,
cuFloatComplex *  c3arr,
int  size 
)

Convert 6 arrays of floats to 3 arrays of cuComplex

Parameters
r1arrReal part of complex array.
r2arrReal part of complex array.
r3arrReal part of complex array.
i1arrImaginary part of complex array.
i2arrImaginary part of complex array.
i3arrImaginary part of complex array.
c1arrArray of cuFloatComplex, to be filled.
c2arrArray of cuFloatComplex, to be filled.
c3arrArray of cuFloatComplex, to be filled.
sizeSize of arrays.

◆ _arrCUDACToC1()

__host__ void _arrCUDACToC1 ( cuFloatComplex *  carr,
float *  rarr,
float *  iarr,
int  size 
)

Convert 1 array of cuComplex to 2 arrays of floats.

Parameters
carrArray of cuFloatComplex.
rarrReal part of complex array, to be filled.
iarrImaginary part of complex array, to be filled.
sizeSize of arrays.

◆ _arrCUDACToC3()

__host__ void _arrCUDACToC3 ( cuFloatComplex *  c1arr,
cuFloatComplex *  c2arr,
cuFloatComplex *  c3arr,
float *  r1arr,
float *  r2arr,
float *  r3arr,
float *  i1arr,
float *  i2arr,
float *  i3arr,
int  size 
)

Convert 3 arrays of cuComplex to 6 arrays of floats.

Parameters
c1arrArray of cuFloatComplex.
c2arrArray of cuFloatComplex.
c3arrArray of cuFloatComplex.
r1arrReal part of complex array, to be filled.
r2arrReal part of complex array, to be filled.
r3arrReal part of complex array, to be filled.
i1arrImaginary part of complex array, to be filled.
i2arrImaginary part of complex array, to be filled.
i3arrImaginary part of complex array, to be filled.
sizeSize of arrays.

◆ callKernelf_EH()

void callKernelf_EH ( c2Bundlef res,
reflparamsf  source,
reflparamsf  target,
reflcontainerf cs,
reflcontainerf ct,
c2Bundlef currents,
float  k,
float  epsilon,
float  t_direction,
int  nBlocks,
int  nThreads 
)

Call EH kernel.

Calculate E, H fields on a target surface using CUDA.

Parameters
resPointer to c2Bundlef object.
sourcereflparamsf object containing source surface parameters.
targetreflparamsf object containing target surface parameters.
csPointer to reflcontainerf object containing source grids.
ctPointer to reflcontainerf object containing target grids.
currentsPointer to c2Bundlef object containing source currents.
kWavenumber of radiation in 1 /mm.
epsilonRelative permittivity of source surface.
t_directionTime direction (experimental!).
nBlocksNumber of blocks in GPU grid.
nThreadsNumber of threads in a block.
See also
c2Bundlef
reflparamsf
reflcontainerf

◆ callKernelf_EHP()

void callKernelf_EHP ( c2rBundlef res,
reflparamsf  source,
reflparamsf  target,
reflcontainerf cs,
reflcontainerf ct,
c2Bundlef currents,
float  k,
float  epsilon,
float  t_direction,
int  nBlocks,
int  nThreads 
)

Call EHP kernel.

Calculate reflected E, H fields and P, the reflected Poynting vectorfield, on a target surface using CUDA.

Parameters
resPointer to c2rBundlef object.
sourcereflparamsf object containing source surface parameters.
targetreflparamsf object containing target surface parameters.
csPointer to reflcontainerf object containing source grids.
ctPointer to reflcontainerf object containing target grids.
currentsPointer to c2Bundlef object containing source currents.
kWavenumber of radiation in 1 /mm.
epsilonRelative permittivity of source surface.
t_directionTime direction (experimental!).
nBlocksNumber of blocks in GPU grid.
nThreadsNumber of threads in a block.
See also
c2rBundlef
c2Bundlef
reflparamsf
reflcontainerf

◆ callKernelf_FF()

void callKernelf_FF ( c2Bundlef res,
reflparamsf  source,
reflparamsf  target,
reflcontainerf cs,
reflcontainerf ct,
c2Bundlef currents,
float  k,
float  epsilon,
float  t_direction,
int  nBlocks,
int  nThreads 
)

Call FF kernel.

Calculate E, H fields on a far-field target surface using CUDA.

Parameters
resPointer to c2Bundlef object.
sourcereflparamsf object containing source surface parameters.
targetreflparamsf object containing target surface parameters.
csPointer to reflcontainerf object containing source grids.
ctPointer to reflcontainerf object containing target grids.
currentsPointer to c2Bundlef object containing source currents.
kWavenumber of radiation in 1 /mm.
epsilonRelative permittivity of source surface.
t_directionTime direction (experimental!).
nBlocksNumber of blocks in GPU grid.
nThreadsNumber of threads in a block.
See also
c2Bundlef
reflparamsf
reflcontainerf

◆ callKernelf_JM()

void callKernelf_JM ( c2Bundlef res,
reflparamsf  source,
reflparamsf  target,
reflcontainerf cs,
reflcontainerf ct,
c2Bundlef currents,
float  k,
float  epsilon,
float  t_direction,
int  nBlocks,
int  nThreads 
)

Call JM kernel.

Calculate J, M currents on a target surface using CUDA.

Parameters
resPointer to c2Bundlef object.
sourcereflparamsf object containing source surface parameters.
targetreflparamsf object containing target surface parameters.
csPointer to reflcontainerf object containing source grids.
ctPointer to reflcontainerf object containing target grids.
currentsPointer to c2Bundlef object containing source currents.
kWavenumber of radiation in 1 /mm.
epsilonRelative permittivity of source surface.
t_directionTime direction (experimental!).
nBlocksNumber of blocks in GPU grid.
nThreadsNumber of threads in a block.
See also
c2Bundlef
reflparamsf
reflcontainerf

◆ callKernelf_JMEH()

void callKernelf_JMEH ( c4Bundlef res,
reflparamsf  source,
reflparamsf  target,
reflcontainerf cs,
reflcontainerf ct,
c2Bundlef currents,
float  k,
float  epsilon,
float  t_direction,
int  nBlocks,
int  nThreads 
)

Call JMEH kernel.

Calculate J, M currents and E, H fields on a target surface using CUDA.

Parameters
resPointer to c4Bundlef object.
sourcereflparamsf object containing source surface parameters.
targetreflparamsf object containing target surface parameters.
csPointer to reflcontainerf object containing source grids.
ctPointer to reflcontainerf object containing target grids.
currentsPointer to c2Bundlef object containing source currents.
kWavenumber of radiation in 1 /mm.
epsilonRelative permittivity of source surface.
t_directionTime direction (experimental!).
nBlocksNumber of blocks in GPU grid.
nThreadsNumber of threads in a block.
See also
c4Bundlef
c2Bundlef
reflparamsf
reflcontainerf

◆ callKernelf_scalar()

void callKernelf_scalar ( arrC1f res,
reflparamsf  source,
reflparamsf  target,
reflcontainerf cs,
reflcontainerf ct,
arrC1f inp,
float  k,
float  epsilon,
float  t_direction,
int  nBlocks,
int  nThreads 
)

Call scalar kernel.

Calculate scalar field on a target surface using CUDA.

Parameters
resPointer to arrC1f object.
sourcereflparamsf object containing source surface parameters.
targetreflparamsf object containing target surface parameters.
csPointer to reflcontainerf object containing source grids.
ctPointer to reflcontainerf object containing target grids.
inpPointer to arrC1f object containing source field.
kWavenumber of radiation in 1 /mm.
epsilonRelative permittivity of source surface.
t_directionTime direction (experimental!).
nBlocksNumber of blocks in GPU grid.
nThreadsNumber of threads in a block.
See also
arrC1f
reflparamsf
reflcontainerf

◆ farfieldAtPoint()

__device__ void farfieldAtPoint ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
float(&)  r_hat[3],
float *  d_A,
cuFloatComplex(&)  e[3],
cuFloatComplex(&)  h[3] 
)

Calculate total E and H field at point on far-field target.

Parameters
d_xsArray containing source point's x-coordinate.
d_ysArray containing source point's y-coordinate.
d_zsArray containing source point's z-coordinate.
d_nxsArray containing source point's normal x-component.
d_nysArray containing source point's y-component.
d_nzsArray containing source point's z-component.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
r_hatArray of 3 float, containing xyz coordinates of target point direction.
d_AArray containing area elements.
eArray of 3 cuFloatComplex, to be filled with E-field at point.

◆ fieldAtPoint()

__device__ void fieldAtPoint ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
float(&)  point[3],
float *  d_A,
cuFloatComplex(&)  d_ei[3],
cuFloatComplex(&)  d_hi[3] 
)

Calculate total E and H field at point on target.

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_nxsArray containing source normals x-component.
d_nysArray containing source normals y-component.
d_nzsArray containing source normals z-component.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
pointArray of 3 float, containing xyz coordinates of target point.
d_AArray containing area elements.
d_eiArray of 3 cuFloatComplex, to be filled with E-field at point.
d_hiArray of 3 cuFloatComplex, to be filled with H-field at point.

◆ GpropagateBeam_0()

__global__ void GpropagateBeam_0 ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_A,
float *  d_xt,
float *  d_yt,
float *  d_zt,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
float *  d_nxt,
float *  d_nyt,
float *  d_nzt,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
cuFloatComplex *  d_Jxt,
cuFloatComplex *  d_Jyt,
cuFloatComplex *  d_Jzt,
cuFloatComplex *  d_Mxt,
cuFloatComplex *  d_Myt,
cuFloatComplex *  d_Mzt 
)

Calculate JM on target.

Kernel for calculating J, M currents on target surface.

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_AArray containing area elements.
d_xtArray containing target points x-coordinate.
d_ytArray containing target points y-coordinate.
d_ztArray containing target points z-coordinate.
d_nxsArray containing source normals x-component.
d_nysArray containing source normals y-component.
d_nzsArray containing source normals z-component.
d_nxtArray containing target norms x-component.
d_nytArray containing target norms y-component.
d_nztArray containing target norms z-component.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
d_JxtArray to be filled with target J x-component.
d_JytArray to be filled with target J y-component.
d_JztArray to be filled with target J z-component.
d_MxtArray to be filled with target M x-component.
d_MytArray to be filled with target M y-component.
d_MztArray to be filled with target M z-component.

◆ GpropagateBeam_0_PEC()

__global__ void GpropagateBeam_0_PEC ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_A,
float *  d_xt,
float *  d_yt,
float *  d_zt,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
float *  d_nxt,
float *  d_nyt,
float *  d_nzt,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
cuFloatComplex *  d_Jxt,
cuFloatComplex *  d_Jyt,
cuFloatComplex *  d_Jzt,
cuFloatComplex *  d_Mxt,
cuFloatComplex *  d_Myt,
cuFloatComplex *  d_Mzt 
)

Calculate JM on PEC target

Kernel for calculating J, M currents on a perfectly conducting target surface. This reduces the calculation of the currents to Je = 2 n^Hinc and Jm = -2 n^Einc

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_AArray containing area elements.
d_xtArray containing target points x-coordinate.
d_ytArray containing target points y-coordinate.
d_ztArray containing target points z-coordinate.
d_nxsArray containing source normals x-component.
d_nysArray containing source normals y-component.
d_nzsArray containing source normals z-component.
d_nxtArray containing target norms x-component.
d_nytArray containing target norms y-component.
d_nztArray containing target norms z-component.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
d_JxtArray to be filled with target J x-component.
d_JytArray to be filled with target J y-component.
d_JztArray to be filled with target J z-component.
d_MxtArray to be filled with target M x-component.
d_MytArray to be filled with target M y-component.
d_MztArray to be filled with target M z-component.

◆ GpropagateBeam_1()

__global__ void GpropagateBeam_1 ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_A,
float *  d_xt,
float *  d_yt,
float *  d_zt,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
cuFloatComplex *  d_Ext,
cuFloatComplex *  d_Eyt,
cuFloatComplex *  d_Ezt,
cuFloatComplex *  d_Hxt,
cuFloatComplex *  d_Hyt,
cuFloatComplex *  d_Hzt 
)

Calculate EH on target.

Kernel for calculating E, H fields on target surface.

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_AArray containing area elements.
d_xtArray containing target points x-coordinate.
d_ytArray containing target points y-coordinate.
d_ztArray containing target points z-coordinate.
d_nxsArray containing source normals x-component.
d_nysArray containing source normals y-component.
d_nzsArray containing source normals z-component.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
d_ExtArray to be filled with target E x-component.
d_EytArray to be filled with target E y-component.
d_EztArray to be filled with target E z-component.
d_HxtArray to be filled with target H x-component.
d_HytArray to be filled with target H y-component.
d_HztArray to be filled with target H z-component.

◆ GpropagateBeam_2()

__global__ void GpropagateBeam_2 ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_A,
float *  d_xt,
float *  d_yt,
float *  d_zt,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
float *  d_nxt,
float *  d_nyt,
float *  d_nzt,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
cuFloatComplex *  d_Jxt,
cuFloatComplex *  d_Jyt,
cuFloatComplex *  d_Jzt,
cuFloatComplex *  d_Mxt,
cuFloatComplex *  d_Myt,
cuFloatComplex *  d_Mzt,
cuFloatComplex *  d_Ext,
cuFloatComplex *  d_Eyt,
cuFloatComplex *  d_Ezt,
cuFloatComplex *  d_Hxt,
cuFloatComplex *  d_Hyt,
cuFloatComplex *  d_Hzt 
)

Calculate JM on target.

Kernel for calculating J, M currents on target surface.

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_AArray containing area elements.
d_xtArray containing target points x-coordinate.
d_ytArray containing target points y-coordinate.
d_ztArray containing target points z-coordinate.
d_nxsArray containing source normals x-component.
d_nysArray containing source normals y-component.
d_nzsArray containing source normals z-component.
d_nxtArray containing target norms x-component.
d_nytArray containing target norms y-component.
d_nztArray containing target norms z-component.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
d_JxtArray to be filled with target J x-component.
d_JytArray to be filled with target J y-component.
d_JztArray to be filled with target J z-component.
d_MxtArray to be filled with target M x-component.
d_MytArray to be filled with target M y-component.
d_MztArray to be filled with target M z-component.
d_ExtArray to be filled with target E x-component.
d_EytArray to be filled with target E y-component.
d_EztArray to be filled with target E z-component.
d_HxtArray to be filled with target H x-component.
d_HytArray to be filled with target H y-component.
d_HztArray to be filled with target H z-component.

◆ GpropagateBeam_2_PEC()

__global__ void GpropagateBeam_2_PEC ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_A,
float *  d_xt,
float *  d_yt,
float *  d_zt,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
float *  d_nxt,
float *  d_nyt,
float *  d_nzt,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
cuFloatComplex *  d_Jxt,
cuFloatComplex *  d_Jyt,
cuFloatComplex *  d_Jzt,
cuFloatComplex *  d_Mxt,
cuFloatComplex *  d_Myt,
cuFloatComplex *  d_Mzt,
cuFloatComplex *  d_Ext,
cuFloatComplex *  d_Eyt,
cuFloatComplex *  d_Ezt,
cuFloatComplex *  d_Hxt,
cuFloatComplex *  d_Hyt,
cuFloatComplex *  d_Hzt 
)

Calculate JMEH on PEC target

Kernel for calculating J, M, E & H currents on a perfectly conducting target surface. This reduces the calculation of the currents to Je = 2 n^Hinc and Jm = 2 n^Einc

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_AArray containing area elements.
d_xtArray containing target points x-coordinate.
d_ytArray containing target points y-coordinate.
d_ztArray containing target points z-coordinate.
d_nxsArray containing source normals x-component.
d_nysArray containing source normals y-component.
d_nzsArray containing source normals z-component.
d_nxtArray containing target norms x-component.
d_nytArray containing target norms y-component.
d_nztArray containing target norms z-component.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
d_JxtArray to be filled with target J x-component.
d_JytArray to be filled with target J y-component.
d_JztArray to be filled with target J z-component.
d_MxtArray to be filled with target M x-component.
d_MytArray to be filled with target M y-component.
d_MztArray to be filled with target M z-component.
d_ExtArray to be filled with target E x-component.
d_EytArray to be filled with target E y-component.
d_EztArray to be filled with target E z-component.
d_HxtArray to be filled with target H x-component.
d_HytArray to be filled with target H y-component.
d_HztArray to be filled with target H z-component.

◆ GpropagateBeam_3()

__global__ void GpropagateBeam_3 ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_A,
float *  d_xt,
float *  d_yt,
float *  d_zt,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
float *  d_nxt,
float *  d_nyt,
float *  d_nzt,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
cuFloatComplex *  d_Ext,
cuFloatComplex *  d_Eyt,
cuFloatComplex *  d_Ezt,
cuFloatComplex *  d_Hxt,
cuFloatComplex *  d_Hyt,
cuFloatComplex *  d_Hzt,
float *  d_Prxt,
float *  d_Pryt,
float *  d_Przt 
)

Calculate reflected EH and P on target.

Kernel for calculating reflected E, H fields and P, the reflected Poynting vector field, on target surface.

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_AArray containing area elements.
d_xtArray containing target points x-coordinate.
d_ytArray containing target points y-coordinate.
d_ztArray containing target points z-coordinate.
d_nxsArray containing source normals x-component.
d_nysArray containing source normals y-component.
d_nzsArray containing source normals z-component.
d_nxtArray containing target norms x-component.
d_nytArray containing target norms y-component.
d_nztArray containing target norms z-component.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
d_ExtArray to be filled with target E x-component.
d_EytArray to be filled with target E y-component.
d_EztArray to be filled with target E z-component.
d_HxtArray to be filled with target H x-component.
d_HytArray to be filled with target H y-component.
d_HztArray to be filled with target H z-component.
d_PrxtArray to be filled with target P x-component.
d_PrytArray to be filled with target P y-component.
d_PrztArray to be filled with target P z-component.

◆ GpropagateBeam_4()

void __global__ GpropagateBeam_4 ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_nxs,
float *  d_nys,
float *  d_nzs,
float *  d_A,
float *  d_xt,
float *  d_yt,
cuFloatComplex *  d_Jx,
cuFloatComplex *  d_Jy,
cuFloatComplex *  d_Jz,
cuFloatComplex *  d_Mx,
cuFloatComplex *  d_My,
cuFloatComplex *  d_Mz,
cuFloatComplex *  d_Ext,
cuFloatComplex *  d_Eyt,
cuFloatComplex *  d_Ezt,
cuFloatComplex *  d_Hxt,
cuFloatComplex *  d_Hyt,
cuFloatComplex *  d_Hzt 
)

Calculate EH on far-field target.

Kernel for calculating E, H fields on a far-field target.

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_AArray containing area elements.
d_xtArray containing target direction x-coordinate.
d_ytArray containing target direction y-coordinate.
d_JxArray containing source J x-component.
d_JyArray containing source J y-component.
d_JzArray containing source J z-component.
d_MxArray containing source M x-component.
d_MyArray containing source M y-component.
d_MzArray containing source M z-component.
d_ExtArray to be filled with target E x-component.
d_EytArray to be filled with target E y-component.
d_EztArray to be filled with target E z-component.
d_HxtArray to be filled with target H x-component.
d_HytArray to be filled with target H y-component.
d_HztArray to be filled with target H z-component.

◆ GpropagateBeam_5()

void __global__ GpropagateBeam_5 ( float *  d_xs,
float *  d_ys,
float *  d_zs,
float *  d_A,
float *  d_xt,
float *  d_yt,
float *  d_zt,
cuFloatComplex *  d_sfs,
cuFloatComplex *  d_sft 
)

Calculate scalar field on target.

Kernel for calculating scalar field on a target, given a scattered field and source surface..

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_AArray containing area elements.
d_xtArray containing target direction x-coordinate.
d_ytArray containing target direction y-coordinate.
d_ztArray containing target direction z-coordinate.
d_sfsArray containing source scalar field.
d_sftArray to be filled with target scalar field.

◆ initCUDA()

__host__ std::array<dim3, 2> initCUDA ( float  k,
float  epsilon,
int  gt,
int  gs,
float  t_direction,
int  nBlocks,
int  nThreads 
)

Initialize CUDA.

Instantiate program and populate constant memory.

Parameters
kWavenumber of incoming field in 1 / mm.
epsilonRelative electric permittivity of source.
gtNumber of cells on target.
gsNumber of cells on source.
t_directionTime direction (experimental!).
nBlocksNumber of blocks per grid.
nThreadsNumber of threads per block.
Returns
BT Array of two dim3 objects, containing number of blocks per grid and number of threads per block.

◆ scalarfieldAtPoint()

void __device__ scalarfieldAtPoint ( float *  d_xs,
float *  d_ys,
float *  d_zs,
cuFloatComplex *  d_sfs,
float(&)  point[3],
float *  d_A,
cuFloatComplex &  e 
)

Calculate scalarfield on target.

Kernel for calculating scalarfield on a target.

Parameters
d_xsArray containing source points x-coordinate.
d_ysArray containing source points y-coordinate.
d_zsArray containing source points z-coordinate.
d_sfsArray containing source scalarfield.
pointArray containing target point.
d_AArray containing area elements.
eArray to be filled with results.