Skip to content

Commit

Permalink
update BC after @albert-de-montserrat & update test compats
Browse files Browse the repository at this point in the history
  • Loading branch information
aelligp committed May 27, 2024
1 parent e5553fa commit b1f50e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
25 changes: 11 additions & 14 deletions src/boundaryconditions/BoundaryConditions.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# BOUNDARY CONDITIONS KERNELS
include("free_slip.jl")
include("free_surface.jl")
include("no_slip.jl")
include("pure_shear.jl")

@inline bc_index(x::NTuple{2,T}) where {T} = mapreduce(xi -> max(size(xi)...), max, x)
@inline bc_index(x::T) where {T<:AbstractArray} = max(size(x)...)

@inline function bc_index(x::NTuple{3,T}) where {T}
nx, ny, nz = size(x[1])
return max((nx, ny), (ny, nz), (nx, nz))
end

@inline function bc_index(x::T) where {T<:AbstractArray{<:Any,3}}
nx, ny, nz = size(x)
return max((nx, ny), (ny, nz), (nx, nz))
n = mapreduce(xi -> max(size(xi)...), max, x)
return n, n
end

@inline do_bc(bc) = reduce(|, values(bc))
Expand All @@ -20,7 +21,7 @@ Apply the prescribed heat boundary conditions `bc` on the `T`
"""
thermal_bcs!(thermal, bcs) = thermal_bcs!(backend(thermal), thermal, bcs)
function thermal_bcs!(
::CPUBackendTrait, thermal::JustRelax.ThermalArrays, bcs::FlowBoundaryConditions
::CPUBackendTrait, thermal::JustRelax.ThermalArrays, bcs::TemperatureBoundaryConditions
)
return thermal_bcs!(thermal.T, bcs)
end
Expand All @@ -34,6 +35,8 @@ function thermal_bcs!(T::AbstractArray, bcs::TemperatureBoundaryConditions)
return nothing
end

# @inline thermal_bcs!(thermal::ThermalArrays, bcs::TemperatureBoundaryConditions) = thermal_bcs!(thermal.T, bcs)

"""
flow_bcs!(stokes, bcs::FlowBoundaryConditions, di)
Expand All @@ -56,9 +59,3 @@ function _flow_bcs!(bcs, V)

return nothing
end

# BOUNDARY CONDITIONS KERNELS
include("free_slip.jl")
include("free_surface.jl")
include("no_slip.jl")
include("pure_shear.jl")
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"

[compat]
AMDGPU = "0.6, 0.7, 0.8"
CUDA = "4.4.1, 5"
CUDA = "5.3.5"
CellArrays = "0.2"
GeoParams = "0.5, 0.6"
JustPIC = "0.3.3"
Expand Down

0 comments on commit b1f50e2

Please sign in to comment.