from time import *
from pylab import *
from scipy import sin, pi, exp

from kufdtd.kufdtd_base import *
from kufdtd.matter.dielectric import Dielectric
from kufdtd.boundary.cpml import Cpml

ds = 10e-9
number_cells = [200, 200]
grid_opt = 'efaced'
unit_opt = 'Enorm'

# construct the matter object
space = Dielectric('2DEz', ds, number_cells, grid_opt, unit_opt)
space.allocate_arrays()
Nx, Ny = number_cells[0], number_cells[1]
Ez = space.efield[2]
space.set_coefficients()

# construct the PML object
number_pml_cells = 10
kapa_max = 7
alpha = 0.05
grade_order = 4
cpml_parameters = (kapa_max, alpha, grade_order)
pml_space = Cpml(space, number_pml_cells, cpml_parameters)
pml_space.allocate_pml_arrays()
pml_apply_opt = ('fb', 'fb')  # front and back
from time import *
from pylab import *
from scipy import sin,pi,exp

from kufdtd.kufdtd_base import *
from kufdtd.matter.dielectric import Dielectric
from kufdtd.boundary.cpml import Cpml

ds = 10e-9
number_cells = [200, 200, 30]
grid_opt = 'efaced'
unit_opt = 'Enorm'

# construct the matter object
space = Dielectric('3D', ds, number_cells, grid_opt, unit_opt)
space.allocate_arrays()
Nx, Ny, Nz = number_cells[0], number_cells[1], number_cells[2]
Ex, Ey, Ez = space.efield[0], space.efield[1], space.efield[2]
space.set_coefficients()

# construct the PML object
number_pml_cells = 10
kapa_max = 7
alpha = 0.05
grade_order = 4
cpml_parameters = (kapa_max, alpha, grade_order)
pml_space = Cpml(space, number_pml_cells, cpml_parameters)
pml_space.allocate_pml_arrays()
pml_apply_opt = ('fb', 'fb', 'fb') # front and back