Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-de-montserrat committed Aug 12, 2024
1 parent 40e46e7 commit 999f0a5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,16 @@ function compute_dt(::CPUBackendTrait, S::JustRelax.StokesArrays, args...)
return _compute_dt(S, args...)
end

@inline _compute_dt(S::JustRelax.StokesArrays, di) = _compute_dt(@velocity(S), di, Inf, maximum)
@inline _compute_dt(S::JustRelax.StokesArrays, di) =
_compute_dt(@velocity(S), di, Inf, maximum)

@inline _compute_dt(S::JustRelax.StokesArrays, di, dt_diff) =
_compute_dt(@velocity(S), di, dt_diff, maximum)

@inline _compute_dt(S::JustRelax.StokesArrays, di, dt_diff, ::IGG) =
_compute_dt(@velocity(S), di, dt_diff, maximum_mpi)

@inline function _compute_dt(V::NTuple, di, dt_diff, max_fun::F) where F<:Function
@inline function _compute_dt(V::NTuple, di, dt_diff, max_fun::F) where {F<:Function}
n = inv(length(V) + 0.1)
dt_adv = mapreduce(x -> x[1] * inv(max_fun(abs.(x[2]))), max, zip(di, V)) * n
return min(dt_diff, dt_adv)
Expand Down

0 comments on commit 999f0a5

Please sign in to comment.