Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-de-montserrat committed Nov 13, 2024
1 parent 03310e8 commit f4895ea
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
11 changes: 4 additions & 7 deletions src/Interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,11 @@ end

@parallel_indices (i, j, k) function _velocity2vertex!(Vx_v, Vy_v, Vz_v, Vx, Vy, Vz)
Vx_v[i, j, k] =
0.25 *
(Vx[i, j, k] + Vx[i, j + 1, k] + Vx[i, j, k + 1] + Vx[i, j + 1, k + 1])
0.25 * (Vx[i, j, k] + Vx[i, j + 1, k] + Vx[i, j, k + 1] + Vx[i, j + 1, k + 1])
Vy_v[i, j, k] =
0.25 *
(Vy[i, j, k] + Vy[i + 1, j, k] + Vy[i, j, k + 1] + Vy[i + 1, j, k + 1])
0.25 * (Vy[i, j, k] + Vy[i + 1, j, k] + Vy[i, j, k + 1] + Vy[i + 1, j, k + 1])
Vz_v[i, j, k] =
0.25 *
(Vz[i, j, k] + Vz[i, j + 1, k] + Vz[i + 1, j, k] + Vz[i + 1, j + 1, k])
0.25 * (Vz[i, j, k] + Vz[i, j + 1, k] + Vz[i + 1, j, k] + Vz[i + 1, j + 1, k])
return nothing
end

Expand Down Expand Up @@ -318,4 +315,4 @@ end
Vx_c[i, j, k] = (Vx[i, j + 1] + Vx[i + 1, j + 1]) / 2
Vy_c[i, j, k] = (Vy[i + 1, j] + Vy[i + 1, j + 1]) / 2
return nothing
end
end
3 changes: 2 additions & 1 deletion src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ include("particles/subgrid_diffusion.jl")
export subgrid_characteristic_time!

include("Interpolations.jl")
export vertex2center!, center2vertex!, temperature2center!, velocity2vertex!, velocity2center!
export vertex2center!,
center2vertex!, temperature2center!, velocity2vertex!, velocity2center!

include("advection/weno5.jl")
export WENO_advection!
Expand Down
2 changes: 1 addition & 1 deletion src/ext/AMDGPU/2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ end

function JR2D.velocity2center!(Vx_c::T, Vy_c::T, Vx::T, Vy::T) where {T<:ROCArray}
velocity2center!(Vx_c, Vy_c, Vx, Vy)
nothing
return nothing
end

function JR2D.velocity2displacement!(
Expand Down
6 changes: 4 additions & 2 deletions src/ext/AMDGPU/3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ function JR3D.velocity2vertex!(
return nothing
end

function JR3D.velocity2center!(Vx_c::T, Vy_c::T, Vz_c::T, Vx::T, Vy::T, Vz::T) where {T<:ROCArray}
velocity2center!(Vx_c, Vy_c, Vz_c, Vx, Vy, Vz)
function JR3D.velocity2center!(
Vx_c::T, Vy_c::T, Vz_c::T, Vx::T, Vy::T, Vz::T
) where {T<:ROCArray}
return velocity2center!(Vx_c, Vy_c, Vz_c, Vx, Vy, Vz)
end

function JR3D.velocity2displacement!(
Expand Down
2 changes: 1 addition & 1 deletion src/ext/CUDA/2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ end

function JR2D.velocity2center!(Vx_c::T, Vy_c::T, Vx::T, Vy::T) where {T<:CuArray}
velocity2center!(Vx_c, Vy_c, Vx, Vy)
nothing
return nothing
end

function JR2D.velocity2vertex!(
Expand Down
10 changes: 7 additions & 3 deletions src/ext/CUDA/3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,17 @@ function JR3D.center2vertex!(
return center2vertex!(vertex_yz, vertex_xz, vertex_xy, center_yz, center_xz, center_xy)
end

function JR3D.velocity2vertex!(Vx_v::T, Vy_v::T, Vz_v::T, Vx::T, Vy::T, Vz::T) where {T<:CuArray}
function JR3D.velocity2vertex!(
Vx_v::T, Vy_v::T, Vz_v::T, Vx::T, Vy::T, Vz::T
) where {T<:CuArray}
velocity2vertex!(Vx_v, Vy_v, Vz_v, Vx, Vy, Vz)
return nothing
end

function JR3D.velocity2center!(Vx_c::T, Vy_c::T, Vz_c::T, Vx::T, Vy::T, Vz::T) where {T<:CuArray}
velocity2center!(Vx_c, Vy_c, Vz_c, Vx, Vy, Vz)
function JR3D.velocity2center!(
Vx_c::T, Vy_c::T, Vz_c::T, Vx::T, Vy::T, Vz::T
) where {T<:CuArray}
return velocity2center!(Vx_c, Vy_c, Vz_c, Vx, Vy, Vz)
end

function JR3D.velocity2displacement!(::CUDABackendTrait, stokes::JustRelax.StokesArrays, dt)
Expand Down

0 comments on commit f4895ea

Please sign in to comment.