thliebig / openEMS

openEMS is a free and open-source electromagnetic field solver using the EC-FDTD method.
http://openEMS.de
GNU General Public License v3.0
413 stars 146 forks source link

FDTD: reformat code of update equations. #101

Closed biergaizi closed 9 months ago

biergaizi commented 1 year ago

The original update equations in the FDTD engine have extremely long lines. I found they're difficult to read and work with. This patch inserts line breaks, and aligns all array indexes by x/y/z coordinates to make it easy to visually compare during debugging.

This commit also serves as the foundation of the mentioned future work in Issue #100.

thliebig commented 9 months ago

I assume this is ready to merge first? Changes look good

biergaizi commented 9 months ago

I have changed my mind, my new plan is to stop working on this minor change with merely a 20% speedup in favor of merging the more powerful tiling engine with a larger speedup into the upstream in the future.

thliebig commented 9 months ago

Well you don't even want the cleanup/reformat code merged?

biergaizi commented 9 months ago

Good point, even if I no longer plan to change the existing engines, merging this formatting patch still improves readability so it would be a net positive to future developers anyway. I've reopened this Pull Request, feel free to merge it.