flaport / fdtd

A 3D electromagnetic FDTD simulator written in Python with optional GPU support
https://fdtd.readthedocs.io
MIT License
455 stars 116 forks source link

about electric and magnetic field in each time step. #21

Closed sassan72 closed 3 years ago

sassan72 commented 3 years ago

I want to check the matrices for electric and magnetic field at each time update step. How can i do it with your fdtd code? is it possible to show me in an example how? thanks in advance.

flaport commented 3 years ago

try something like this:

for i in range(N):
    grid.step()
    E = grid.E # do something with the Electric field
    H = grid.H # do something with the Magnetic field