We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There appears to be in issue when running 3D simulations and calling plot2D to visualize. It shows PML everywhere, when there shouldn't be.
import meep.adjoint as mpa from matplotlib import pyplot as plt import numpy as np diamond = mp.Medium(index=2.4) # Lossless diamond air = mp.Medium(index=1.0) # Lossless air # Geometry radius = 0.88 geometry = [ mp.Cylinder(radius=radius, height=0.22, material=diamond), ] # Source fcen = 1.67969 # Center frequency df = 0.05 # pulse frequency width sources = [ mp.Source(src=mp.GaussianSource(fcen, fwidth=df), component=mp.Ex, center=mp.Vector3(0.88 - 0.15, 0, 0.00)) ] # Dipole source # Simulation sim = mp.Simulation( cell_size=mp.Vector3(7*radius, 7*radius, 10), # Size of the simulation cell geometry=geometry, # Geometry boundary_layers=[mp.PML(1.0,direction=mp.X),mp.PML(1.0,direction=mp.Y),mp.PML(1.0,direction=mp.Z)], # Boundary conditions resolution=10, # Resolution sources=sources, # Sources ) # Plot the geometry sim.init_sim() if mp.am_really_master(): plt.figure() sim.plot2D(output_plane=mp.Volume(center=mp.Vector3(0, 0, 0), size=mp.Vector3(7*radius, 7*radius, 0))) plt.savefig("geom")`
cc @smartalecH
The text was updated successfully, but these errors were encountered:
Similar issues with 2D simulations that simply change the geometry_center.
geometry_center
Sorry, something went wrong.
I guess it is getting confused by the PML in the z direction, and doesn't notice that those PML layers don't intersect the slice being plotted?
This bug is indeed related to the use of PML since replacing mp.PML(...) with mp.Absorber(...) produces the correct output (i.e., no hatched lines).
mp.PML(...)
mp.Absorber(...)
plot_boundaries
plot2D
Successfully merging a pull request may close this issue.
There appears to be in issue when running 3D simulations and calling plot2D to visualize. It shows PML everywhere, when there shouldn't be.
cc @smartalecH
The text was updated successfully, but these errors were encountered: