Replace multifunction for apply_restrictions with a class method (defined in a protocol). Caching of results is now achieved using functools.lru_cache rather than inside the multifunction.
This will allow apply_restrictions to be implemented for types defined outside UFL without having to add the implementation of this to algorithms/apply_restrictions.py.
As far as users are concerned, there should be no noticable change.
Replace multifunction for apply_restrictions with a class method (defined in a protocol). Caching of results is now achieved using
functools.lru_cache
rather than inside the multifunction.This will allow
apply_restrictions
to be implemented for types defined outside UFL without having to add the implementation of this toalgorithms/apply_restrictions.py
.As far as users are concerned, there should be no noticable change.
I propose that we aim to make this change for all multifunctions (https://github.com/FEniCS/ufl/issues/273).