Browse Source

style fixes

master
Jan Petykiewicz 2 years ago
parent
commit
fe2f4f4510
  1. 2
      opencl_fdtd/kernels/common.cl
  2. 4
      opencl_fdtd/kernels/update_j.cl
  3. 4
      opencl_fdtd/simulation.py

2
opencl_fdtd/kernels/common.cl

@ -2,7 +2,7 @@
/* Common code for E, H updates
*
* Template parameters:
* ftype type name (e.g. float or double)
* ftype type name (e.g. float or double)
* shape list of 3 ints specifying shape of fields
*/
#}

4
opencl_fdtd/kernels/update_j.cl

@ -1,11 +1,11 @@
/*
* Update E-field from J field
* Update E-field from J field
*
* Template parameters:
* common_header: Rendered contents of common.cl
*
* OpenCL args:
* E, Jr, Ji, c, s, xmin, xmax, ymin, ymax, zmin, zmax
* E, Jr, Ji, c, s, xmin, xmax, ymin, ymax, zmin, zmax
*/
{{common_header}}

4
opencl_fdtd/simulation.py

@ -286,13 +286,13 @@ class Simulation(object):
alpha_max = pml['cfs_alpha']
def par(x):
scaling = ((x / (pml['thickness'])) ** pml['m'])
scaling = (x / pml['thickness']) ** pml['m']
sigma = scaling * sigma_max
kappa = 1 + scaling * (kappa_max - 1)
alpha = ((1 - x / pml['thickness']) ** pml['ma']) * alpha_max
p0 = numpy.exp(-(sigma / kappa + alpha) * self.dt)
p1 = sigma / (sigma + kappa * alpha) * (p0 - 1)
p2 = 1/kappa
p2 = 1 / kappa
return p0, p1, p2
xe, xh = (numpy.arange(1, pml['thickness'] + 1, dtype=self.arg_type)[::-1] for _ in range(2))

Loading…
Cancel
Save