Skip to content

Commit

Permalink
add missing FDTD steady state field in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
simbilod committed Sep 14, 2023
1 parent 64dc00e commit 9a473b6
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion docs/notebooks/meep_03_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
plt.show()
# -

# Then we directly execute the simulation:
# ## FDFD simulation

sim.init_sim()
sim.solve_cw(1e-6, 10000, 10)
Expand All @@ -95,3 +95,25 @@
plt.axis("off")
plt.show()
# -

# ## Steady-state FDTD simulation
#
# We can also just run the time-domain simulation with the continuous source until the field is stabilized:

sim.run(until=400)

# +
eps_data = sim.get_epsilon()
ez_data = np.real(sim.get_efield_z())

import matplotlib.pyplot as plt

plt.figure()
sim.plot2D(
fields=mp.Ez,
plot_sources_flag=True,
plot_monitors_flag=False,
plot_boundaries_flag=True,
)
plt.axis("off")
plt.show()

0 comments on commit 9a473b6

Please sign in to comment.