Skip to content

Commit

Permalink
rm deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
aelligp committed Aug 13, 2024
1 parent 41ded93 commit 555e47e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 72 deletions.
70 changes: 0 additions & 70 deletions src/boundaryconditions/free_slip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,73 +101,3 @@ end
end
return nothing
end

@parallel_indices (j) function free_slip_x!(A::AbstractArray{T,2}) where {T}
A[1, j] = A[2, j]
A[end, j] = A[end - 1, j]
return nothing
end

@parallel_indices (i) function free_slip_y!(A::AbstractArray{T,2}) where {T}
A[i, 1] = A[i, 2]
A[i, end] = A[i, end - 1]
return nothing
end

@inbounds @parallel_indices (i) function _apply_free_slip!(Ax, Ay, freeslip_x, freeslip_y)
if freeslip_x && i size(Ax, 1)
Ax[i, 1] = Ax[i, 2]
Ax[i, end] = Ax[i, end - 1]
end
if freeslip_y && i size(Ay, 2)
Ay[1, i] = Ay[2, i]
Ay[end, i] = Ay[end - 1, i]
end
return nothing
end

function apply_free_slip!(freeslip::NamedTuple{<:Any,NTuple{2,T}}, Vx, Vy) where {T}
freeslip_x, freeslip_y = freeslip
n = max(size(Vx, 1), size(Vy, 2))
# free slip boundary conditions
@parallel (1:n) _apply_free_slip!(Vx, Vy, freeslip_x, freeslip_y)

return nothing
end

# 3D KERNELS

@parallel_indices (j, k) function free_slip_x!(A::AbstractArray{T,3}) where {T}
A[1, j, k] = A[2, j, k]
A[end, j, k] = A[end - 1, j, k]
return nothing
end

@parallel_indices (i, k) function free_slip_y!(A::AbstractArray{T,3}) where {T}
A[i, 1, k] = A[i, 2, k]
A[i, end, k] = A[i, end - 1, k]
return nothing
end

@parallel_indices (i, j) function free_slip_z!(A::AbstractArray{T,3}) where {T}
A[i, j, 1] = A[i, j, 2]
A[i, j, end] = A[i, j, end - 1]
return nothing
end

function apply_free_slip!(freeslip::NamedTuple{<:Any,NTuple{3,T}}, Vx, Vy, Vz) where {T}
freeslip_x, freeslip_y, freeslip_z = freeslip
# free slip boundary conditions
if freeslip_x
@parallel (1:size(Vy, 2), 1:size(Vy, 3)) free_slip_x!(Vy)
@parallel (1:size(Vz, 2), 1:size(Vz, 3)) free_slip_x!(Vz)
end
if freeslip_y
@parallel (1:size(Vx, 1), 1:size(Vx, 3)) free_slip_y!(Vx)
@parallel (1:size(Vz, 1), 1:size(Vz, 3)) free_slip_y!(Vz)
end
if freeslip_z
@parallel (1:size(Vx, 1), 1:size(Vx, 2)) free_slip_z!(Vx)
@parallel (1:size(Vy, 1), 1:size(Vy, 2)) free_slip_z!(Vy)
end
end
3 changes: 1 addition & 2 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export AbstractBoundaryConditions,
VelocityBoundaryConditions,
flow_bcs!,
thermal_bcs!,
pureshear_bc!,
apply_free_slip!
pureshear_bc!

include("MiniKernels.jl")

Expand Down

0 comments on commit 555e47e

Please sign in to comment.