Skip to content

Commit

Permalink
introduce muladd, update AMR tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Sep 20, 2023
1 parent 73384ac commit d9e6af9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/equations/compressible_navier_stokes_1d.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# By default, Julia/LLVM does not use fused multiply-add operations (FMAs).
# Since these FMAs can increase the performance of many numerical algorithms,
# we need to opt-in explicitly.
# See https://ranocha.de/blog/Optimizing_EC_Trixi for further details.
@muladd begin
#! format: noindent

@doc raw"""
CompressibleNavierStokesDiffusion1D(equations; mu, Pr,
gradient_variables=GradientVariablesPrimitive())
Expand Down Expand Up @@ -401,3 +408,4 @@ end
})
return SVector(flux_inner[1], flux_inner[2], flux_inner[3])
end
end # @muladd
8 changes: 8 additions & 0 deletions src/equations/compressible_navier_stokes_2d.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# By default, Julia/LLVM does not use fused multiply-add operations (FMAs).
# Since these FMAs can increase the performance of many numerical algorithms,
# we need to opt-in explicitly.
# See https://ranocha.de/blog/Optimizing_EC_Trixi for further details.
@muladd begin
#! format: noindent

@doc raw"""
CompressibleNavierStokesDiffusion2D(equations; mu, Pr,
gradient_variables=GradientVariablesPrimitive())
Expand Down Expand Up @@ -433,3 +440,4 @@ end
})
return SVector(flux_inner[1], flux_inner[2], flux_inner[3], flux_inner[4])
end
end # @muladd
8 changes: 8 additions & 0 deletions src/equations/compressible_navier_stokes_3d.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# By default, Julia/LLVM does not use fused multiply-add operations (FMAs).
# Since these FMAs can increase the performance of many numerical algorithms,
# we need to opt-in explicitly.
# See https://ranocha.de/blog/Optimizing_EC_Trixi for further details.
@muladd begin
#! format: noindent

@doc raw"""
CompressibleNavierStokesDiffusion3D(equations; mu, Pr,
gradient_variables=GradientVariablesPrimitive())
Expand Down Expand Up @@ -471,3 +478,4 @@ end
return SVector(flux_inner[1], flux_inner[2], flux_inner[3], flux_inner[4],
flux_inner[5])
end
end # @muladd
8 changes: 4 additions & 4 deletions test/test_parabolic_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ isdir(outdir) && rm(outdir, recursive=true)
@test_trixi_include(joinpath(examples_dir(), "tree_1d_dgsem", "elixir_navierstokes_convergence_walls_amr.jl"),
equations_parabolic = CompressibleNavierStokesDiffusion1D(equations, mu=mu(),
Prandtl=prandtl_number()),
l2 = [2.527877257772131e-5, 2.5539911566937718e-5, 0.0001211860451244785],
linf = [0.00014663867588948776, 0.00019422448348348196, 0.0009556439394007299]
l2 = [2.5278824700860636e-5, 2.5540078777006958e-5, 0.00012118655083858043],
linf = [0.0001466387075579334, 0.00019422427462629705, 0.0009556446847707178]
)
end

Expand All @@ -90,8 +90,8 @@ isdir(outdir) && rm(outdir, recursive=true)
equations_parabolic = CompressibleNavierStokesDiffusion1D(equations, mu=mu(),
Prandtl=prandtl_number(),
gradient_variables = GradientVariablesEntropy()),
l2 = [2.4593699163175966e-5, 2.392863645712634e-5, 0.00011252526651714956],
linf = [0.00011850555445525046, 0.0001898777490968537, 0.0009597561467877824]
l2 = [2.459359632523962e-5, 2.3928390718460263e-5, 0.00011252414117082376],
linf = [0.0001185052018830568, 0.00018987717854305393, 0.0009597503607920999]
)
end
end
Expand Down

0 comments on commit d9e6af9

Please sign in to comment.