Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add numerical support of other real types (laplace) #2025

Merged
merged 7 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions test/test_type.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,69 @@ isdir(outdir) && rm(outdir, recursive = true)
end
end

@timed_testset "Laplace Diffusion 1D" begin
for RealT in (Float32, Float64)
equations = @inferred LinearScalarAdvectionEquation1D(RealT(1))
equations_parabolic = @inferred LaplaceDiffusion1D(RealT(0.1), equations)

x = SVector(zero(RealT))
t = zero(RealT)
u = gradients = SVector(one(RealT))
orientation = 1

@test eltype(@inferred flux(u, gradients, orientation, equations_parabolic)) ==
RealT

# TODO: BC tests for BoundaryConditionDirichlet
# TODO: BC tests for BoundaryConditionNeumann
end
end

@timed_testset "Laplace Diffusion 2D" begin
for RealT in (Float32, Float64)
equations = LinearScalarAdvectionEquation2D(RealT(1), RealT(1))
equations_parabolic = LaplaceDiffusion2D(RealT(0.1), equations)

x = SVector(zero(RealT), zero(RealT))
t = zero(RealT)
u = u_inner = u_outer = inv_h = gradients = SVector(one(RealT), one(RealT))
orientations = [1, 2]

for orientation in orientations
@test eltype(@inferred flux(u, gradients, orientation, equations_parabolic)) ==
RealT
end

parabolic_solver = ViscousFormulationLocalDG(RealT(0.1))
@test eltype(@inferred Trixi.penalty(u_outer, u_inner, inv_h,
equations_parabolic, parabolic_solver)) ==
RealT
end
end

@timed_testset "Laplace Diffusion 3D" begin
for RealT in (Float32, Float64)
equations = LinearScalarAdvectionEquation3D(RealT(1), RealT(1), RealT(1))
equations_parabolic = LaplaceDiffusion3D(RealT(0.1), equations)

x = SVector(zero(RealT), zero(RealT), zero(RealT))
t = zero(RealT)
u = u_inner = u_outer = inv_h = gradients = SVector(one(RealT), one(RealT),
one(RealT))
orientations = [1, 2, 3]

for orientation in orientations
@test eltype(@inferred flux(u, gradients, orientation, equations_parabolic)) ==
RealT
end

parabolic_solver = ViscousFormulationLocalDG(RealT(0.1))
@test eltype(@inferred Trixi.penalty(u_outer, u_inner, inv_h,
equations_parabolic, parabolic_solver)) ==
RealT
end
end

@timed_testset "Lattice Boltzmann 2D" begin
for RealT in (Float32, Float64)
equations = @inferred LatticeBoltzmannEquations2D(Ma = RealT(0.1), Re = 1000)
Expand Down
Loading