Reimplement create_staggered_kernel
Compare changes
+ 81
− 81
@@ -6,8 +5,10 @@ import sympy as sp
@@ -6,8 +5,10 @@ import sympy as sp
@@ -23,7 +24,8 @@ def create_kernel(assignments,
@@ -23,7 +24,8 @@ def create_kernel(assignments,
@@ -47,6 +49,7 @@ def create_kernel(assignments,
@@ -47,6 +49,7 @@ def create_kernel(assignments,
@@ -84,6 +87,8 @@ def create_kernel(assignments,
@@ -84,6 +87,8 @@ def create_kernel(assignments,
@@ -186,104 +191,99 @@ def create_indexed_kernel(assignments,
@@ -186,104 +191,99 @@ def create_indexed_kernel(assignments,
where e.g. ``f[0,0](0)`` is interpreted as value at the left cell boundary, ``f[1,0](0)`` the right cell
expressions: sequence of expressions of length dim, defining how the west, southern, (bottom) cell boundary
subexpressions: optional sequence of Assignments, that define subexpressions used in the main expressions
gpu_exclusive_conditions: if/else construct to have only one code block for each of 2**dim code paths
kwargs: passed directly to create_kernel, iteration slice and ghost_layers parameters are not allowed
assert staggered_field.index_dimensions in (1, 2), 'Staggered field must have one or two index dimensions'
"If staggered field has two index dimensions expressions has to be a sequence of sequences of all the " \
case_conditions = sp.And(*[c if value else sp.Not(c) for c, value in zip(full_conditions, include)])