From dd95e7647842885f99fa77493cf4d9a57e497ce3 Mon Sep 17 00:00:00 2001 From: albert-de-montserrat Date: Fri, 5 Apr 2024 10:55:46 +0200 Subject: [PATCH] format --- src/stokes/PressureKernels.jl | 47 ++++++++++++++++++++++++++++------- src/stokes/Stokes2D.jl | 2 +- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/stokes/PressureKernels.jl b/src/stokes/PressureKernels.jl index f1fc9b85..f1bc4379 100644 --- a/src/stokes/PressureKernels.jl +++ b/src/stokes/PressureKernels.jl @@ -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 @@ -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 diff --git a/src/stokes/Stokes2D.jl b/src/stokes/Stokes2D.jl index c4ab0b78..d9c0c9f4 100644 --- a/src/stokes/Stokes2D.jl +++ b/src/stokes/Stokes2D.jl @@ -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)