Skip to content

Commit

Permalink
more exports and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aelligp committed Aug 8, 2024
1 parent 62f208d commit 91aa299
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export AbstractBoundaryConditions,
include("MiniKernels.jl")

include("phases/phases.jl")
export fn_ratio, phase_ratios_center!
export fn_ratio, phase_ratios_center!, numphases, nphases

include("rheology/BuoyancyForces.jl")
export compute_ρg!
Expand Down
5 changes: 3 additions & 2 deletions test/test_diffusion2D_multiphase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,20 @@ function diffusion_2D(; nx=32, ny=32, lx=100e3, ly=100e3, Cp0=1.2e3, K0=3.0)
t += dt
end

return thermal
return thermal, phase_ratios
end

@testset "Diffusion_2D_Multiphase" begin
@suppress begin
nx=32;
ny=32;
thermal = diffusion_2D(; nx = nx, ny = ny)
thermal, phase_ratios = diffusion_2D(; nx = nx, ny = ny)

nx_T, ny_T = size(thermal.T)
if backend_JR === CPUBackend
@test thermal.T[nx_T >>> 1 + 1, ny_T >>> 1 + 1] 1819.2297931741878 atol=1e-1
@test thermal.Tc[ nx >>> 1 , nx >>> 1 ] 1824.3532934301472 atol=1e-1
@test nphases(phase_ratios)=== Val{2}()
else
@test true == true
end
Expand Down
1 change: 1 addition & 0 deletions test/test_traits.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ end

# test PTArray
@test PTArray(backend) === A
@test PTArray() === A
@test_throws ArgumentError PTArray(bk(rand()))
@test_throws ArgumentError PTArray(bk("potato"))

Expand Down

0 comments on commit 91aa299

Please sign in to comment.