PEC and PMC for all wave operators

This commit is contained in:
jan 2016-07-03 16:45:38 -07:00
commit e288e59021
2 changed files with 51 additions and 15 deletions

View file

@ -177,12 +177,18 @@ def test1():
J = waveguide_mode.compute_source(**wg_args, **wg_results)
H_overlap = waveguide_mode.compute_overlap_e(**wg_args, **wg_results)
pecg = gridlock.Grid(edge_coords, initial=0, num_grids=3)
pecg = gridlock.Grid(edge_coords, initial=0.0, num_grids=3)
# pecg.draw_cuboid(center=[700, 0, 0], dimensions=[80, 1e8, 1e8], eps=1)
pecg.grids = [numpy.sign(r) for r in pecg.grids]
# pecg.visualize_isosurface()
A = fdfd_tools.operators.e_full(omega, dxes, vec(grid.grids), pec=vec(pecg.grids)).tocsr()
pmcg = gridlock.Grid(edge_coords, initial=0.0, num_grids=3)
# pmcg.draw_cuboid(center=[700, 0, 0], dimensions=[80, 1e8, 1e8], eps=1)
# pmcg.visualize_isosurface()
A = fdfd_tools.operators.e_full(omega, dxes,
epsilon=vec(grid.grids),
pec=vec(pecg.grids),
pmc=vec(pmcg.grids)).tocsr()
b = -1j * omega * vec(J)
x = solve_A(A, b)
E = unvec(x, grid.shape)