-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98cf4bf
commit d02955d
Showing
1 changed file
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
@parallel_indices (I...) function compute_SH!( | ||
H, τ, τII, τ_old, τII_old, ε, phase_ratios, rheology, dt | ||
) | ||
SH, τ::NTuple{N, T}, τ_old::NTuple{N, T}, ε::NTuple{N, T}, rheology, dt | ||
) where {N, T} | ||
_Gdt = inv(fn_ratio(get_G, rheology) * dt) | ||
τij, τij_o, εij = JustRelax.cache_tensors(τ, τ_old, ε, I...) | ||
εij_el = @. 0.5 * ((τij - τij_o) * _Gdt) | ||
SH[I...] = compute_shearheating(rheology, τij, εij, εij_el) | ||
return nothing | ||
end | ||
|
||
@parallel_indices (I...) function compute_SH!( | ||
SH, τ::NTuple{N, T}, τ_old::NTuple{N, T}, ε::NTuple{N, T}, phase_ratios::CellArray, rheology, dt | ||
) where {N, T} | ||
phase = @inbounds phase_ratios[I...] | ||
_Gdt = inv(fn_ratio(get_G, rheology, phase) * dt) | ||
τij, τij_o, εij = JustRelax.cache_tensors(τ, τ_old, ε, I...) | ||
τII[I...] = τII_ij = second_invariant(τij...) | ||
τII_old[I...] = τII_ij_old = second_invariant(τij_o...) | ||
|
||
εij_el = 0.5 * ((τII_ij - τII_ij_old) * _Gdt) | ||
H[I...] = H_s = compute_shearheating(rheology, phase, τij, εij, εij_el) | ||
εij_el = @. 0.5 * ((τij - τij_o) * _Gdt) | ||
SH[I...] = compute_shearheating(rheology, phase, τij, εij, εij_el) | ||
return nothing | ||
end | ||
end |