Skip to content

Commit

Permalink
Merge branch 'main' into pa-restart
Browse files Browse the repository at this point in the history
  • Loading branch information
aelligp committed May 7, 2024
2 parents ecb54e7 + 5a30156 commit 7547dd2
Show file tree
Hide file tree
Showing 50 changed files with 1,079 additions and 334 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AMDGPU = "0.6, 0.7, 0.8"
Adapt = "3"
CUDA = "4.4.1, 5"
CellArrays = "0.2"
GeoParams = "0.5"
GeoParams = "0.5.8"
HDF5 = "0.17.1"
ImplicitGlobalGrid = "0.15.0"
MPI = "0.20"
Expand Down
1 change: 0 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GeoParams = "e018b62d-d9de-4a26-8697-af89c310ae38"
JustRelax = "34418575-392d-4e26-8c6d-96b0910afa06"

[compat]
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ makedocs(;

warnonly = Documenter.except(:footnote),
pages=[
"Home" => "man/index.md",
"Home" => "index.md",
"User guide"=> Any[
"Installation" => "man/installation.md",
"Backend" => "man/backend.md",
Expand Down
Binary file added docs/src/assets/Blankenbach_Temp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/Blankenbach_Time_Series_V_Nu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/src/man/index.md → docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The package serves several purposes:
* It provides a collection of solvers to be used in quickly developing new applications
* It provides some standardization so that application codes can

- more easily handle local material properties through the use of [GeoParams.jl]((https://github.com/JuliaGeodynamics/GeoParams.jl))
- more easily handle local material properties through the use of [GeoParams.jl](https://github.com/JuliaGeodynamics/GeoParams.jl)
- more easily switch between a pseudo-transient solver and another solvers (e.g. an explicit thermal solvers)

* It provides a natural repository for contributions of new solvers for use by the larger community
Expand Down
4 changes: 2 additions & 2 deletions docs/src/man/Blankenbach.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ fig

### Final model
Temperature field
![Temperatuere](../assets/Blankenbach/Temp.png)
![Temperature](../assets/Blankenbach_Temp.png)

And time history of the rms-velocity and Nusselt number
![time series](../assets/Blankenbach/Time_Series_V_Nu.png)
![time series](../assets/Blankenbach_Time_Series_V_Nu.png)
2 changes: 1 addition & 1 deletion docs/src/man/listfunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

Here an overview of all functions:
```@autodocs
Modules = [JustRelax]
Modules = [JustRelax, JustRelax.JustRelax2D, JustRelax.JustRelax3D, JustRelax.DataIO]
```
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function main2D(igg; ar=1, nx=32, ny=32, nit = 1e1, figdir="figs2D", do_vtk =fal
pPhases, = init_cell_arrays(particles, Val(1))
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions miniapps/benchmarks/stokes2D/Blankenbach2D/Benchmark2D_sgd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function main2D(igg; ar=1, nx=32, ny=32, nit = 1e1, figdir="figs2D", do_vtk =fal
particle_args = (pT, pT0, pPhases)
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -257,7 +257,7 @@ function main2D(igg; ar=1, nx=32, ny=32, nit = 1e1, figdir="figs2D", do_vtk =fal
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (T_buffer, ), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

# Nusselt number, Nu = H/ΔT/L ∫ ∂T/∂z dx ----
Nu_it = (ly / (1000.0*lx)) *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function main2D(igg; ar=1, nx=32, ny=32, nit = 1e1, figdir="figs2D", do_vtk =fal
particle_args = (pT, pT0, pPhases)
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -247,7 +247,7 @@ function main2D(igg; ar=1, nx=32, ny=32, nit = 1e1, figdir="figs2D", do_vtk =fal
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (T_buffer, ), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

# Nusselt number, Nu = ∫ ∂T/∂z dx ----
Nu_it = sum( ((abs.(thermal.T[2:end-1,end] - thermal.T[2:end-1,end-1])) ./ di[2]) .*di[1])
Expand Down
4 changes: 2 additions & 2 deletions miniapps/benchmarks/stokes2D/VanKeken.jl/VanKeken.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function main2D(igg; ny=64, nx=64, figdir="model_figs")
particle_args = (pPhases, )
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

# STOKES ---------------------------------------------
# Allocate arrays needed for every Stokes problem
Expand Down Expand Up @@ -170,7 +170,7 @@ function main2D(igg; ny=64, nx=64, figdir="model_figs")
# inject && break
inject_particles_phase!(particles, pPhases, (), (), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

@show it += 1
t += dt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function main(igg, nx, ny)
# Elliptical temperature anomaly
init_phases!(pPhases, particles)
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -186,7 +186,7 @@ function main(igg, nx, ny)
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (), (), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

@show it += 1
t += dt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function RT_2D(igg, nx, ny)
A = 5e3 # Amplitude of the anomaly
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles, A)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -197,7 +197,7 @@ function RT_2D(igg, nx, ny)
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (), (), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

@show it += 1
t += dt
Expand Down
4 changes: 2 additions & 2 deletions miniapps/benchmarks/stokes2D/shear_heating/Shearheating2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function main2D(igg; ar=8, ny=16, nx=ny*8, figdir="figs2D", do_vtk =false)
r_anomaly = 3e3 # radius of perturbation
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles, xc_anomaly, yc_anomaly, r_anomaly)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -245,7 +245,7 @@ function main2D(igg; ar=8, ny=16, nx=ny*8, figdir="figs2D", do_vtk =false)
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (T_buffer,), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

@show it += 1
t += dt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function sinking_block2D(igg; ar=8, ny=16, nx=ny*8, figdir="figs2D", thermal_per
r_anomaly = 50e3 # radius of perturbation
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles, xc_anomaly, abs(yc_anomaly), r_anomaly)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

# STOKES ---------------------------------------------
# Allocate arrays needed for every Stokes problem
Expand Down
4 changes: 2 additions & 2 deletions miniapps/benchmarks/stokes3D/shear_heating/Shearheating3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function main3D(igg; ar=8, ny=16, nx=ny*8, nz=ny*8, figdir="figs3D", do_vtk =fal
r_anomaly = 3e3 # radius of perturbation
init_phases!(backend_JR, pPhases, particles, xc_anomaly, yc_anomaly, zc_anomaly, r_anomaly)
phase_ratios = PhaseRatio(ni, length(rheology))
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -227,7 +227,7 @@ function main3D(igg; ar=8, ny=16, nx=ny*8, nz=ny*8, figdir="figs3D", do_vtk =fal
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (thermal.T,), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

@show it += 1
t += dt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function diffusion_2D(; nx=32, ny=32, lx=100e3, ly=100e3, Cp0=1.2e3, K0=3.0)
pPhases, = init_cell_arrays(particles, Val(1))
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles, center_perturbation..., r)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

@parallel (@idx ni) compute_temperature_source_terms!(thermal.H, rheology, phase_ratios.center, args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function diffusion_3D(;
pPhases, = init_cell_arrays(particles, Val(1))
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles, center_perturbation..., r)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# PT coefficients for thermal diffusion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function main2D(igg; figdir=figdir, nx=nx, ny=ny, do_vtk=false)
anomaly = nondimensionalize((750 + 273)K, CharDim) # thermal perturbation (in K)
init_phases!(pPhases, particles, x_anomaly, y_anomaly, r_anomaly, sticky_air, nondimensionalize(0.0km,CharDim), nondimensionalize(20km,CharDim))
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

# Initialisation of thermal profile
thermal = ThermalArrays(backend_JR, ni) # initialise thermal arrays and boundary conditions
Expand Down Expand Up @@ -438,7 +438,7 @@ function main2D(igg; figdir=figdir, nx=nx, ny=ny, do_vtk=false)
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (T_buffer,), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

particle2grid!(T_buffer, pT, xvi, particles)
@views T_buffer[:, end] .= Tsurf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function main3D(igg; figdir = "output", nx = 64, ny = 64, nz = 64, do_vtk = fals
anomaly = nondimensionalize((750 + 273)K, CharDim) # thermal perturbation (in K)
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles, x_anomaly, y_anomaly, z_anomaly, r_anomaly, sticky_air, nondimensionalize(0.0km,CharDim), nondimensionalize(20km,CharDim))
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

# Initialisation of thermal profile
thermal = ThermalArrays(backend_JR, ni) # initialise thermal arrays and boundary conditions
Expand Down Expand Up @@ -420,7 +420,7 @@ function main3D(igg; figdir = "output", nx = 64, ny = 64, nz = 64, do_vtk = fals
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (thermal.T,), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

particle2grid!(thermal.T, pT, xvi, particles)
@views thermal.T[:, :, end] .= Tsurf
Expand Down
4 changes: 2 additions & 2 deletions miniapps/convection/Particles2D/Layered_convection2D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function main2D(igg; ar=8, ny=16, nx=ny*8, figdir="figs2D", do_vtk =false)
r_anomaly = 25e3 # radius of perturbation
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles, lx, yc_anomaly, r_anomaly, thick_air)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -292,7 +292,7 @@ function main2D(igg; ar=8, ny=16, nx=ny*8, figdir="figs2D", do_vtk =false)
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (T_buffer,), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

@show it += 1
t += dt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function main2D(igg; ar=8, ny=16, nx=ny*8, figdir="figs2D", do_vtk =false)
r_anomaly = nondimensionalize(25km, CharDim) # radius of perturbation
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
init_phases!(pPhases, particles, lx, yc_anomaly, r_anomaly, thick_air, CharDim)
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -298,7 +298,7 @@ function main2D(igg; ar=8, ny=16, nx=ny*8, figdir="figs2D", do_vtk =false)
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (T_buffer,), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

@show it += 1
t += dt
Expand Down
4 changes: 2 additions & 2 deletions miniapps/convection/Particles3D/Layered_convection3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function main3D(igg; ar=1, nx=16, ny=16, nz=16, figdir="figs3D", do_vtk =false)
r_anomaly = 50e3 # radius of perturbation
init_phases!(pPhases, particles, lx, ly; d=abs(zc_anomaly), r=r_anomaly)
phase_ratios = PhaseRatio(backend_JR, ni, length(rheology))
@parallel (@idx ni) phase_ratios_center(phase_ratios.center, particles.coords, xci, di, pPhases)
@parallel (@idx ni) phase_ratios_center!(phase_ratios.center, particles.coords, xci, di, pPhases)
# ----------------------------------------------------

# STOKES ---------------------------------------------
Expand Down Expand Up @@ -264,7 +264,7 @@ function main3D(igg; ar=1, nx=16, ny=16, nz=16, figdir="figs3D", do_vtk =false)
# check if we need to inject particles
inject_particles_phase!(particles, pPhases, (pT, ), (T_buffer,), xvi)
# update phase ratios
phase_ratios_center(phase_ratios, particles, grid, pPhases)
phase_ratios_center!(phase_ratios, particles, grid, pPhases)

@show it += 1
t += dt
Expand Down
Loading

0 comments on commit 7547dd2

Please sign in to comment.