Skip to content

Commit

Permalink
Update 3D.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-de-montserrat authored May 6, 2024
1 parent 7e6c67b commit f50bab3
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions src/ext/AMDGPU/3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ function thermal_bcs!(::CUDABackendTrait, thermal::JustRelax.ThermalArrays, bcs)
end

# Phases
function JR3D.phase_ratios_center(
function JR3D.phase_ratios_center!(
::CUDABackendTrait,
phase_ratios::JustRelax.PhaseRatio,
particles,
grid::Geometry,
phases,
)
return _phase_ratios_center(phase_ratios, particles, grid, phases)
return _phase_ratios_center!(phase_ratios, particles, grid, phases)
end

# Rheology
Expand Down Expand Up @@ -183,4 +183,40 @@ function JR3D.compute_dt(::CUDABackendTrait, S::JustRelax.StokesArrays, args...)
return _compute_dt(S, args...)
end

function JR3D.subgrid_characteristic_time!(
subgrid_arrays,
particles,
dt₀::RocArray,
phases::JustRelax.PhaseRatio,
rheology,
thermal::JustRelax.ThermalArrays,
stokes::JustRelax.StokesArrays,
xci,
di,
)
ni = size(stokes.P)
@parallel (@idx ni) subgrid_characteristic_time!(
dt₀, phases.center, rheology, thermal.Tc, stokes.P, di
)
return nothing
end

function JR3D.subgrid_characteristic_time!(
subgrid_arrays,
particles,
dt₀::RocArray,
phases::AbstractArray{Int,N},
rheology,
thermal::JustRelax.ThermalArrays,
stokes::JustRelax.StokesArrays,
xci,
di,
) where {N}
ni = size(stokes.P)
@parallel (@idx ni) subgrid_characteristic_time!(
dt₀, phases, rheology, thermal.Tc, stokes.P, di
)
return nothing
end

end

0 comments on commit f50bab3

Please sign in to comment.