Skip to content
Snippets Groups Projects

Draft: Changes for compatibility with pystencils 2.0

Open Frederik Hennig requested to merge fhennig/pystencils2.0-compat into master
Viewing commit 902584c2
Show latest version
1 file
+ 6
0
Preferences
Compare changes
@@ -147,6 +147,8 @@ class NoSlip(LbBoundary):
force = sp.Symbol("f")
subexpressions = [Assignment(force, sp.Float(2.0) * f_out(dir_symbol))]
offset = NeighbourOffsetArrays.neighbour_offset(dir_symbol, lb_method.stencil)
if IS_PYSTENCILS_2:
offset = [CastFunc.as_numeric(o) for o in offset]
for i in range(lb_method.stencil.D):
subexpressions.append(Assignment(force_vector[0](f'F_{i}'), force * offset[i]))
else:
@@ -228,6 +230,8 @@ class NoSlipLinearBouzidi(LbBoundary):
force = sp.Symbol("f")
subexpressions.append(Assignment(force, f_xf + rhs))
offset = NeighbourOffsetArrays.neighbour_offset(dir_symbol, lb_method.stencil)
if IS_PYSTENCILS_2:
offset = [CastFunc.as_numeric(o) for o in offset]
for i in range(lb_method.stencil.D):
subexpressions.append(Assignment(force_vector[0](f'F_{i}'), force * offset[i]))
@@ -382,6 +386,8 @@ class QuadraticBounceBack(LbBoundary):
force = sp.Symbol("f")
subexpressions.append(Assignment(force, f_xf + result))
offset = NeighbourOffsetArrays.neighbour_offset(dir_symbol, lb_method.stencil)
if IS_PYSTENCILS_2:
offset = [CastFunc.as_numeric(o) for o in offset]
for i in range(lb_method.stencil.D):
subexpressions.append(Assignment(force_vector[0](f'F_{i}'), force * offset[i]))