@@ -3739,6 +3739,27 @@ end
3739
3739
right_idx (space)
3740
3740
end
3741
3741
3742
+ @inline function should_call_left_boundary (idx, space, bc, loc)
3743
+ (; op) = bc
3744
+ return Operators. has_boundary (op, loc) &&
3745
+ idx < Operators. left_interior_idx (
3746
+ space,
3747
+ op,
3748
+ Operators. get_boundary (op, loc),
3749
+ bc. args... ,
3750
+ )
3751
+ end
3752
+
3753
+ @inline function should_call_right_boundary (idx, space, bc, loc)
3754
+ (; op) = bc
3755
+ return Operators. has_boundary (op, loc) &&
3756
+ idx > Operators. right_interior_idx (
3757
+ space,
3758
+ bc. op,
3759
+ Operators. get_boundary (bc. op, loc),
3760
+ bc. args... ,
3761
+ )
3762
+ end
3742
3763
3743
3764
Base. @propagate_inbounds function getidx (
3744
3765
parent_space,
@@ -3760,9 +3781,7 @@ Base.@propagate_inbounds function getidx(
3760
3781
)
3761
3782
space = reconstruct_placeholder_space (axes (bc), parent_space)
3762
3783
op = bc. op
3763
- if has_boundary (op, loc) &&
3764
- idx <
3765
- left_interior_idx (space, bc. op, get_boundary (bc. op, loc), bc. args... )
3784
+ if should_call_left_boundary (idx, space, bc, loc)
3766
3785
stencil_left_boundary (
3767
3786
op,
3768
3787
get_boundary (op, loc),
@@ -3787,9 +3806,7 @@ Base.@propagate_inbounds function getidx(
3787
3806
)
3788
3807
op = bc. op
3789
3808
space = reconstruct_placeholder_space (axes (bc), parent_space)
3790
- if has_boundary (op, loc) &&
3791
- idx >
3792
- right_interior_idx (space, bc. op, get_boundary (bc. op, loc), bc. args... )
3809
+ if should_call_right_boundary (idx, space, bc, loc)
3793
3810
stencil_right_boundary (
3794
3811
op,
3795
3812
get_boundary (op, loc),
0 commit comments