Skip to content

Low brightness in beam visualization. #2248

Answered by oskooi
waveguiding asked this question in Q&A
Discussion options

You must be logged in to vote

The problem is that you are using an mp.Hz source in a 2D simulation but plotting the mp.Ez fields which is zero by orthogonality. This is why your figure contains no fields. In your call to plot2D, replace fields.mp.Ez with fields=mp.Hz.

More generally, you can also try creating an animation of the time-dependent field propagation. There are a couple of ways to do this:

  1. Write a step function to output the fields (in this case, mp.Hz is the scalar field in the 2D simulation) to disk as an HDF5 file using mp.output_hfield_z at every Δt time units. Then, in post processing from the shell terminal, convert the HDF5 files to PNG via $ h5topng -vZc bluered -C epsilon.h5 hz-000*.h5 where epsil…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by oskooi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants