Skip to content

Commit

Permalink
Fixup Vavilov reading
Browse files Browse the repository at this point in the history
  • Loading branch information
luraess committed Apr 3, 2024
1 parent d885f47 commit 39b2b46
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions scripts_future_API/test_levelsets_volumefractions_mpi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ MPI.Init()

conv(nx, tx) = tx * ((nx + tx ÷ 2 -1 ) ÷ tx)

load_data(data_path) = (first(keys(dat = load(data_path))), dat)

function make_synthetic(backend=CPU(); nx, ny, lx, ly, lz, amp, ω, tanβ, el, gl)
arch = Arch(backend)
grid = UniformGrid(arch; origin=(-lx/2, -ly/2), extent=(lx, ly), dims=(nx, ny))
Expand All @@ -42,12 +40,13 @@ function make_synthetic(backend=CPU(); nx, ny, lx, ly, lz, amp, ω, tanβ, el, g
end

function extract_dem(backend=CPU(); data_path::String)
dtype, data = load_data(data_path)
z_surf = data[dtype].z_surf
z_bed = data[dtype].z_bed
dm = data[dtype].domain
lx, ly, lz = extents(dm)
nx, ny = size(z_surf) .- 1
data = load(data_path)
dtype = first(keys(data))
z_surf = data[dtype].z_surf
z_bed = data[dtype].z_bed
dm = data[dtype].domain
lx, ly, lz = extents(dm)
nx, ny = size(z_surf) .- 1

arch = Arch(backend)
grid = UniformGrid(arch; origin=(-lx/2, -ly/2), extent=(lx, ly), dims=(nx, ny))
Expand Down Expand Up @@ -81,7 +80,7 @@ end

function main_vavilov(backend=CPU())
# load dem data
data_path = "./vavilov_dem.jld2"
data_path = "./vavilov_dem2.jld2"

data_elevation = extract_dem(backend; data_path)

Expand Down

0 comments on commit 39b2b46

Please sign in to comment.