From 91796ac47e849d10e8149ada51ca0bab516f969a Mon Sep 17 00:00:00 2001 From: huiyuxie Date: Sun, 28 Jul 2024 15:44:43 -1000 Subject: [PATCH 1/5] start --- test/test_type.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_type.jl b/test/test_type.jl index 6c51460e6d9..dcc1c263971 100644 --- a/test/test_type.jl +++ b/test/test_type.jl @@ -1517,6 +1517,12 @@ isdir(outdir) && rm(outdir, recursive = true) end end + @timed_testset "Laplace Diffusion 1D" begin end + + @timed_testset "Laplace Diffusion 2D" begin end + + @timed_testset "Laplace Diffusion 3D" begin end + @timed_testset "Lattice Boltzmann 2D" begin for RealT in (Float32, Float64) equations = @inferred LatticeBoltzmannEquations2D(Ma = RealT(0.1), Re = 1000) From b6ff33e740c6c8bbb717a72d0eb2ccee9f05338c Mon Sep 17 00:00:00 2001 From: huiyuxie Date: Sun, 18 Aug 2024 14:17:58 -1000 Subject: [PATCH 2/5] reformat --- test/test_type.jl | 66 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/test/test_type.jl b/test/test_type.jl index 8c10360acf8..5a90518e3ce 100644 --- a/test/test_type.jl +++ b/test/test_type.jl @@ -1459,11 +1459,71 @@ isdir(outdir) && rm(outdir, recursive = true) end end - @timed_testset "Laplace Diffusion 1D" begin end + @timed_testset "Laplace Diffusion 1D" begin + for RealT in (Float32, Float64) + equations = @inferred LinearScalarAdvectionEquation1D(RealT(1)) + diffusivity() = RealT(0.1) + equations_parabolic = @inferred LaplaceDiffusion1D(diffusivity(), 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)) + diffusivity() = RealT(0.1) + equations_parabolic = LaplaceDiffusion2D(diffusivity(), equations) - @timed_testset "Laplace Diffusion 2D" begin end + 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] - @timed_testset "Laplace Diffusion 3D" begin end + 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)) + diffusivity() = RealT(0.1) + equations_parabolic = LaplaceDiffusion3D(diffusivity(), 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) From 315414e03c0f957d5f82a70999b0ea5179e38248 Mon Sep 17 00:00:00 2001 From: Huiyu Xie Date: Mon, 19 Aug 2024 10:35:19 -1000 Subject: [PATCH 3/5] Update test/test_type.jl Co-authored-by: Hendrik Ranocha --- test/test_type.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_type.jl b/test/test_type.jl index 43915ccd00d..eadbf60e1c4 100644 --- a/test/test_type.jl +++ b/test/test_type.jl @@ -1462,8 +1462,7 @@ isdir(outdir) && rm(outdir, recursive = true) @timed_testset "Laplace Diffusion 1D" begin for RealT in (Float32, Float64) equations = @inferred LinearScalarAdvectionEquation1D(RealT(1)) - diffusivity() = RealT(0.1) - equations_parabolic = @inferred LaplaceDiffusion1D(diffusivity(), equations) + equations_parabolic = @inferred LaplaceDiffusion1D(RealT(0.1), equations) x = SVector(zero(RealT)) t = zero(RealT) From df5fee44c528062814460195c82a8a7a2b17ac19 Mon Sep 17 00:00:00 2001 From: Huiyu Xie Date: Mon, 19 Aug 2024 10:35:30 -1000 Subject: [PATCH 4/5] Update test/test_type.jl Co-authored-by: Hendrik Ranocha --- test/test_type.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_type.jl b/test/test_type.jl index eadbf60e1c4..b84bf919a79 100644 --- a/test/test_type.jl +++ b/test/test_type.jl @@ -1480,8 +1480,7 @@ isdir(outdir) && rm(outdir, recursive = true) @timed_testset "Laplace Diffusion 2D" begin for RealT in (Float32, Float64) equations = LinearScalarAdvectionEquation2D(RealT(1), RealT(1)) - diffusivity() = RealT(0.1) - equations_parabolic = LaplaceDiffusion2D(diffusivity(), equations) + equations_parabolic = LaplaceDiffusion2D(RealT(0.1), equations) x = SVector(zero(RealT), zero(RealT)) t = zero(RealT) From b7493dbe02ef96c112c2b57adda8d329bca77bfd Mon Sep 17 00:00:00 2001 From: Huiyu Xie Date: Mon, 19 Aug 2024 10:35:37 -1000 Subject: [PATCH 5/5] Update test/test_type.jl Co-authored-by: Hendrik Ranocha --- test/test_type.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/test_type.jl b/test/test_type.jl index b84bf919a79..d13b626b060 100644 --- a/test/test_type.jl +++ b/test/test_type.jl @@ -1502,8 +1502,7 @@ isdir(outdir) && rm(outdir, recursive = true) @timed_testset "Laplace Diffusion 3D" begin for RealT in (Float32, Float64) equations = LinearScalarAdvectionEquation3D(RealT(1), RealT(1), RealT(1)) - diffusivity() = RealT(0.1) - equations_parabolic = LaplaceDiffusion3D(diffusivity(), equations) + equations_parabolic = LaplaceDiffusion3D(RealT(0.1), equations) x = SVector(zero(RealT), zero(RealT), zero(RealT)) t = zero(RealT)