Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/src/solvers/dgsem_tree/dg.jl
5591 views
1
# By default, Julia/LLVM does not use fused multiply-add operations (FMAs).
2
# Since these FMAs can increase the performance of many numerical algorithms,
3
# we need to opt-in explicitly.
4
# See https://ranocha.de/blog/Optimizing_EC_Trixi for further details.
5
@muladd begin
6
#! format: noindent
7
8
function volume_jacobian(element, mesh::TreeMesh, cache)
9
return inv(cache.elements.inverse_jacobian[element])^ndims(mesh)
10
end
11
12
@inline function get_inverse_jacobian(inverse_jacobian, mesh::TreeMesh,
13
indices...)
14
element = last(indices)
15
return inverse_jacobian[element]
16
end
17
18
# Dimension agnostic, i.e., valid for all 1D, 2D, and 3D `TreeMesh`es.
19
function calc_boundary_flux!(cache, t, boundary_condition::BoundaryConditionPeriodic,
20
mesh::TreeMesh, equations, surface_integral, dg::DG)
21
@assert isempty(eachboundary(dg, cache))
22
23
return nothing
24
end
25
26
# Indicators used for shock-capturing and AMR
27
include("indicators_1d.jl")
28
include("indicators_2d.jl")
29
include("indicators_3d.jl")
30
31
# Container data structures
32
include("containers.jl")
33
34
# Dimension-agnostic parallel setup
35
include("dg_parallel.jl")
36
37
# Helper structs for parabolic AMR
38
include("containers_parabolic.jl")
39
40
# Some functions for a second-order Finite-Volume (MUSCL) alike
41
# scheme on DG-subcells.
42
include("subcell_finite_volume_O2.jl")
43
44
# 1D DG implementation
45
include("dg_1d.jl")
46
include("dg_1d_parabolic.jl")
47
48
# 2D DG implementation
49
include("dg_2d.jl")
50
include("dg_2d_parallel.jl")
51
include("dg_2d_parabolic.jl")
52
53
# 3D DG implementation
54
include("dg_3d.jl")
55
include("dg_3d_parabolic.jl")
56
57
# Auxiliary functions that are specialized on this solver
58
# as well as specialized implementations used to improve performance
59
include("dg_2d_compressible_euler.jl")
60
include("dg_3d_compressible_euler.jl")
61
62
# Subcell limiters
63
include("subcell_limiters.jl")
64
include("subcell_limiters_2d.jl")
65
include("subcell_limiters_3d.jl")
66
include("dg_2d_subcell_limiters.jl")
67
include("dg_3d_subcell_limiters.jl")
68
end # @muladd
69
70