Skip to content

Commit

Permalink
Fix index handling in 1D (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
utkinis authored Aug 28, 2024
1 parent 8d2f553 commit 6e3ae01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Chmy"
uuid = "33a72cf0-4690-46d7-b987-06506c2248b9"
authors = ["Ivan Utkin <[email protected]>, Ludovic Raess <[email protected]>, and contributors"]
version = "0.1.18"
version = "0.1.19"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
5 changes: 4 additions & 1 deletion src/BoundaryConditions/batch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,16 @@ end

bc!(arch::Architecture, grid::SG, f_bc::Vararg{FieldAndBC}; kwargs...) = bc!(arch, grid, batch(grid, f_bc...; kwargs...))

@inline to_bc_index(::SG, I) = I .- 1
@inline to_bc_index(::SG{1}, I) = ()

# batched kernels
@kernel function bc_kernel!(side::Side, dim::Dim,
grid::SG{N},
fields::NTuple{K,Field},
conditions::NTuple{K,FieldBoundaryCondition}) where {N,K}
J = @index(Global, NTuple)
I = J .- 1
I = to_bc_index(grid, J)
ntuple(Val(K)) do ifield
Base.@_inline_meta
@inbounds begin
Expand Down

0 comments on commit 6e3ae01

Please sign in to comment.