Add ConditionalFieldAccess (Field.Access after out-of-bounds check)
Compare changes
+ 3
− 0
@@ -426,6 +426,9 @@ class CustomSympyPrinter(CCodePrinter):
@@ -426,6 +426,9 @@ class CustomSympyPrinter(CCodePrinter):
Adds a wrapper around a Field.Access
that the access is only performed if a certain condition is met.
If I use this, I can safely perform calculations and adjoint calculations with ghost_layers=0
and obtain the correct gradients without separate boundary handling.