This type of thing has been discussed before, but I usually advocate “ghost cells” (periodic padding) rather than paying the price of wrapping indices on every array access. See e.g. Arrays with periodic boundaries - #4 by stevengj
stevengj
3
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Circular array in Julia | 27 | 5866 | November 16, 2021 | |
| Arrays with periodic boundaries | 5 | 6854 | June 30, 2022 | |
| Using generalized array indexes | 0 | 383 | November 25, 2016 | |
| Matrix Design in Julia 1.1.0 | 10 | 1172 | April 2, 2019 | |
| A better way to chose a random neighbor | 3 | 891 | May 12, 2022 |