devito
devito copied to clipboard
Retaining legacy API when reversing reference between Grid and SubDomain prevents solve cache from clearing
To implement Functions on SubDomains, the reference between Grid
and SubDomain
must be reversed such that SubDomain
s have a parent Grid
. However, to avoid breaking existing codes, the legacy API wherein SubDomain
s are passed to Grid
on instantiation must be retained. This creates a circular reference between Grid
and SubDomain
, preventing the cache from clearing. When the legacy API is removed, tests/test_caching.py::TestMemoryLeaks::test_solve
should be updated to reflect this.