Skip to content

Artifacts around slanted prism objects #55

@danielwboyce

Description

@danielwboyce

See comments on NanoComp/meep#1129. Artifacts and fuzziness appear along the prism boundary with nonzero values of sidewall_angle. See these comments in particular (1)(2)(3).

Some strange artifacts are found in the epsilon profile of a hexagonal prism in the xy plane of a 2d cell whenever the sidewall_angle is not zero as shown below.

import meep as mp
import numpy as np
import math
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt

cell_size = mp.Vector3(2.5,2.5)

resolution = 50

vertices = [mp.Vector3(-1,0),
            mp.Vector3(-0.5,math.sqrt(3)/2),
            mp.Vector3(0.5,math.sqrt(3)/2),
            mp.Vector3(1,0),
            mp.Vector3(0.5,-math.sqrt(3)/2),
            mp.Vector3(-0.5,-math.sqrt(3)/2)]

geometry = [mp.Prism(vertices,                     
                     height=1.5,
                     center=mp.Vector3(),
                     sidewall_angle=np.radians(15),
                     material=mp.Medium(index=3.5))]

sim = mp.Simulation(resolution=resolution,
                    cell_size=cell_size,
                    geometry=geometry)

sim.init_sim()
plt.figure()
sim.plot2D()
plt.savefig('prism_sidewall.png')

sidewall_angle=0

prism_sidewall_0

sidewall_angle=np.radians(15)

prism_sidewall_15

sidewall_angle=np.radians(27)

prism_sidewall_27

Note that the size of the cross section is shrinking as the sidewall_angle increases. This is correct given the intersection of the prism with the z=0 plane.

Artifacts along the prism boundaries also appear in 3d.

import meep as mp
import numpy as np
import math
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt

cell_size = mp.Vector3(3,3,3)

resolution = 50

vertices = [mp.Vector3(-1,0),
            mp.Vector3(-0.5,math.sqrt(3)/2),
            mp.Vector3(0.5,math.sqrt(3)/2),
            mp.Vector3(1,0),
            mp.Vector3(0.5,-math.sqrt(3)/2),
            mp.Vector3(-0.5,-math.sqrt(3)/2)]

geometry = [mp.Prism(vertices,
                     axis=mp.Vector3(0,0,1),
                     height=1.5,
                     center=mp.Vector3(),
                     sidewall_angle=np.radians(10),
                     material=mp.Medium(index=3.5))]

sim = mp.Simulation(resolution=resolution,
                    cell_size=cell_size,
                    geometry=geometry)

sim.run(mp.at_beginning(mp.output_epsilon),until=0)
$ h5topng -o eps-xy.png -z 75 prism_sidewall-eps-000000.00.h5
$ h5topng -o eps-xz.png -y 75 prism_sidewall-eps-000000.00.h5
$ h5topng -o eps-yz.png -x 75 prism_sidewall-eps-000000.00.h5

eps-xy.png

eps-xy

eps-xz.png

eps-xz

eps-yz.png

eps-yz

When the sidewall angle is 0, no artifacts appear along the boundaries.

eps-xy.png

eps-xy

eps-xz.png

eps-xz

eps-yz.png

eps-yz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions