From d5c1f751d1e05bd2c4fe3afcce2ed6aec0322840 Mon Sep 17 00:00:00 2001 From: Edward Caunt Date: Mon, 22 Apr 2024 14:10:06 +0100 Subject: [PATCH] boundary: Cache substitutions to avoid recomputation --- schism/finite_differences/boundary.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schism/finite_differences/boundary.py b/schism/finite_differences/boundary.py index a582788..2dc16f5 100644 --- a/schism/finite_differences/boundary.py +++ b/schism/finite_differences/boundary.py @@ -1,6 +1,7 @@ """Immersed boundary object forming the core API""" import devito as dv +from devito.tools.memoization import memoized_meth from schism.geometry.skin import ModifiedSkin from schism.basic.basis import Basis @@ -42,6 +43,7 @@ def __init__(self, conditions, geometry, **kwargs): self._conditions = conditions self._geometry = geometry + @memoized_meth def substitutions(self, derivs): """ Get the substitution for the specified derivative. This will return