flaport / fdtd

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

outputing to VTK issue with interal grid structure #70

Open jstjep00 opened 2 months ago

jstjep00 commented 2 months ago

Hey Floris, First off love the repo, thank you for writing it.

I wanted to jump on implementing imageToVTK function from library pyevtk that is part of the visualization and then potentially creating a PR. I jumped on few issues regarding difference between points/cells within the VTK class references and the grid that is implemented within the code. As I understood both the flux and electric field are represented as cells within the grid, but imageToVTK function requires electric field to be in terms of points which there are the actual points of the grid cells (which there are nx + 1, ny + 1, nz + 1)

My question is whether or not this means the discretization algorithm needs to be changed or could this be sidestepped by expanding the shape that permittivity is expecting for.

King regards, Josip