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 SubDomains have a parent Grid. However, to avoid breaking existing codes, the legacy API wherein SubDomains 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.