Skip to content

Commit

Permalink
plot geometry for dispersive materials without initializing structure…
Browse files Browse the repository at this point in the history
… object (NanoComp#1827)

* plot geometry without initializing structure class

* update docstrings

* rotate epsilon grid by 90 degrees to properly orient axes

* add support for dispersive ε

* update markdown pages from docstrings

* make frequency and resolution parameters of plot2D dictionary keys of eps_parameters

* reinstate frequency parameter of plot2D and add warning that it is deprecated

* fix order of frequency check
  • Loading branch information
oskooi authored and Mo Chen committed Feb 22, 2022
1 parent 6114f1e commit 96c5901
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,14 @@ def plot_eps(sim, ax, output_plane=None, eps_parameters=None, frequency=None):
elif sim_size.y == 0:
# Plot x on x axis, z on y axis (XZ plane)
extent = [xmin, xmax, zmin, zmax]
<<<<<<< HEAD
if (sim.dimensions == mp.CYLINDRICAL) or sim.is_cylindrical:
xlabel = 'R'
else:
xlabel = "X"
=======
xlabel = 'X'
>>>>>>> plot geometry for dispersive materials without initializing structure object (#1827)
ylabel = 'Z'
xtics = np.linspace(xmin, xmax, Nx)
ytics = np.array([sim_center.y])
Expand Down Expand Up @@ -422,7 +426,11 @@ def plot_boundaries(sim, ax, output_plane=None, boundary_parameters=None):
# consolidate plotting parameters
boundary_parameters = default_boundary_parameters if boundary_parameters is None else dict(default_boundary_parameters, **boundary_parameters)

<<<<<<< HEAD
def get_boundary_volumes(thickness, direction, side, cylindrical=False):
=======
def get_boundary_volumes(thickness, direction, side):
>>>>>>> plot geometry for dispersive materials without initializing structure object (#1827)
from meep.simulation import Volume

thickness = boundary.thickness
Expand Down Expand Up @@ -555,10 +563,14 @@ def plot_fields(sim, ax=None, fields=None, output_plane=None, field_parameters=N
elif sim_size.y == 0:
# Plot x on x axis, z on y axis (XZ plane)
extent = [xmin, xmax, zmin, zmax]
<<<<<<< HEAD
if (sim.dimensions == mp.CYLINDRICAL) or sim.is_cylindrical:
xlabel = 'R'
else:
xlabel = "X"
=======
xlabel = 'X'
>>>>>>> plot geometry for dispersive materials without initializing structure object (#1827)
ylabel = 'Z'
elif sim_size.z == 0:
# Plot x on x axis, y on y axis (XY plane)
Expand Down

0 comments on commit 96c5901

Please sign in to comment.