From 0ff324ae6b1fe4ac0352889470b28c5018851a0d Mon Sep 17 00:00:00 2001 From: ksagiyam Date: Sun, 22 Dec 2024 11:45:05 +0000 Subject: [PATCH] tsfc/fem: fix basis_evaluation cache --- tsfc/fem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tsfc/fem.py b/tsfc/fem.py index 8d5e6bbcab..cebf72405d 100644 --- a/tsfc/fem.py +++ b/tsfc/fem.py @@ -285,7 +285,9 @@ def make_basis_evaluation_key(ctx, finat_element, mt, entity_id): ufl_element = mt.terminal.ufl_element() domain = extract_unique_domain(mt.terminal) coordinate_element = domain.ufl_coordinate_element() - return (ufl_element, mt.local_derivatives, ctx.point_set, ctx.integration_dim, entity_id, coordinate_element, mt.restriction) + # This way of caching is fragile. + # Should Implement _hash_key_() for ModifiedTerminal and use the entire mt as key. + return (ufl_element, mt.local_derivatives, ctx.point_set, ctx.integration_dim, entity_id, coordinate_element, mt.restriction, domain._ufl_hash_data_()) class PointSetContext(ContextBase):