Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-de-montserrat committed Apr 5, 2024
1 parent a318545 commit dd95e76
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
47 changes: 38 additions & 9 deletions src/stokes/PressureKernels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,35 @@ after the implementation of Kiss et al. (2023). The temperature difference `ΔTc
as well as α as the thermal expansivity.
"""
function compute_P!(
P, P0, RP, ∇V, η, rheology::NTuple{N,MaterialParams}, phase_ratio, dt, r, θ_dτ, kwargs::NamedTuple
) where N
compute_P!(P, P0, RP, ∇V, η, rheology, phase_ratio, dt, r, θ_dτ; kwargs...)
P,
P0,
RP,
∇V,
η,
rheology::NTuple{N,MaterialParams},
phase_ratio,
dt,
r,
θ_dτ,
kwargs::NamedTuple,
) where {N}
return compute_P!(P, P0, RP, ∇V, η, rheology, phase_ratio, dt, r, θ_dτ; kwargs...)
end

function compute_P!(
P, P0, RP, ∇V, η, rheology::NTuple{N,MaterialParams}, phase_ratio, dt, r, θ_dτ; ΔTc = nothing, kwargs...
) where N
P,
P0,
RP,
∇V,
η,
rheology::NTuple{N,MaterialParams},
phase_ratio,
dt,
r,
θ_dτ;
ΔTc=nothing,
kwargs...,
) where {N}
ni = size(P)
@parallel (@idx ni) compute_P_kernel!(
P, P0, RP, ∇V, η, rheology, phase_ratio, dt, r, θ_dτ, ΔTc
Expand All @@ -48,12 +69,20 @@ function compute_P!(
end

@parallel_indices (I...) function compute_P_kernel!(
P, P0, RP, ∇V, η, rheology::NTuple{N,MaterialParams}, phase_ratio::C, dt, r, θ_dτ, ::Nothing
P,
P0,
RP,
∇V,
η,
rheology::NTuple{N,MaterialParams},
phase_ratio::C,
dt,
r,
θ_dτ,
::Nothing,
) where {N,C<:JustRelax.CellArray}
K = fn_ratio(get_bulk_modulus, rheology, phase_ratio[I...])
RP[I...], P[I...] = _compute_P!(
P[I...], P0[I...], ∇V[I...], η[I...], K, dt, r, θ_dτ
)
RP[I...], P[I...] = _compute_P!(P[I...], P0[I...], ∇V[I...], η[I...], K, dt, r, θ_dτ)
return nothing
end

Expand Down
2 changes: 1 addition & 1 deletion src/stokes/Stokes2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ function JustRelax.solve!(
θ_dτ,
)
free_surface_bcs!(stokes, flow_bcs)

@parallel center2vertex!(stokes.τ.xy, stokes.τ.xy_c)
update_halo!(stokes.τ.xy)

Expand Down

0 comments on commit dd95e76

Please sign in to comment.