• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

trixi-framework / Trixi.jl / 29288680065

13 Jul 2026 10:05PM UTC coverage: 90.518% (-6.3%) from 96.84%
29288680065

push

github

web-flow
Liu-Zhang positivity preserving limiting: `P4estMesh`  and a Compressible Navier-Stokes example (#3100)

* add CNS sedov

* fix tests with missing testitem setups

* update news

* add more numerically stable evaluation of a-sqrt(b)

* update tests

* loosen test

* clarify comments

* Apply suggestions from code review

Co-authored-by: Hendrik Ranocha <ranocha@users.noreply.github.com>

* Update NEWS.md

* throw error for MPI meshes

* format

---------

Co-authored-by: Hendrik Ranocha <ranocha@users.noreply.github.com>

35 of 68 new or added lines in 5 files covered. (51.47%)

3211 existing lines in 115 files now uncovered.

46413 of 51275 relevant lines covered (90.52%)

33879759.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.0
/src/basic_types.jl
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
# abstract supertype of specific semidiscretizations such as
9
# - SemidiscretizationHyperbolic for hyperbolic conservation laws
10
# - SemidiscretizationEulerGravity for Euler with self-gravity
11
abstract type AbstractSemidiscretization end
12

13
"""
14
    AbstractEquations{NDIMS, NVARS}
15

16
An abstract supertype of specific equations such as the compressible Euler equations.
17
The type parameters encode the number of spatial dimensions (`NDIMS`) and the
18
number of primary variables (`NVARS`) of the physics model.
19
"""
20
abstract type AbstractEquations{NDIMS, NVARS} end
21

22
"""
23
    AbstractMesh{NDIMS}
24

25
An abstract supertype of specific mesh types such as `TreeMesh` or `StructuredMesh`.
26
The type parameters encode the number of spatial dimensions (`NDIMS`).
27
"""
28
abstract type AbstractMesh{NDIMS} end
29

30
# abstract supertype of specific SBP bases such as a Lobatto-Legendre nodal basis
31
abstract type AbstractBasisSBP{RealT <: Real} end
32

33
# abstract supertype of mortar methods, e.g. using L² projections
34
abstract type AbstractMortar{RealT <: Real} end
35

36
# abstract supertype of mortar methods using L² projection
37
# which will be specialized for different SBP bases
38
abstract type AbstractMortarL2{RealT <: Real} <: AbstractMortar{RealT} end
39

40
# abstract supertype of functionality related to the analysis of
41
# numerical solutions, e.g. the calculation of errors
42
abstract type SolutionAnalyzer{RealT <: Real} end
43

44
# Abstract supertype of indicators used for AMR, shock capturing, and
45
# adaptive volume-integral selection
46
abstract type AbstractIndicator end
47

48
# abstract supertype of grid-transfer methods used for AMR,
49
# e.g. refinement and coarsening based on L² projections
50
abstract type AdaptorAMR{RealT <: Real} end
51

52
# abstract supertype of AMR grid-transfer operations using L² projections
53
# which will be specialized for different SBP bases
54
abstract type AdaptorL2{RealT <: Real} <: AdaptorAMR{RealT} end
55

56
# TODO: Taal decide, which abstract types shall be defined here?
57

58
struct BoundaryConditionPeriodic end
48✔
59

60
"""
61
    boundary_condition_periodic = Trixi.BoundaryConditionPeriodic()
62

63
A singleton struct indicating periodic boundary conditions.
64
"""
65
const boundary_condition_periodic = BoundaryConditionPeriodic()
66

67
function Base.show(io::IO, ::BoundaryConditionPeriodic)
59✔
68
    print(io, "boundary_condition_periodic")
59✔
69
    return nothing
59✔
70
end
71

72
struct BoundaryConditionDoNothing end
48✔
73

74
# This version can be called by hyperbolic solvers on logically Cartesian meshes
75
@inline function (::BoundaryConditionDoNothing)(u_inner,
35,206✔
76
                                                orientation_or_normal_direction,
77
                                                direction::Integer, x, t, surface_flux,
78
                                                equations)
79
    return flux(u_inner, orientation_or_normal_direction, equations)
36,998✔
80
end
81

82
# This version can be called by hyperbolic solvers on logically Cartesian meshes
83
@inline function (::BoundaryConditionDoNothing)(u_inner,
1✔
84
                                                orientation_or_normal_direction,
85
                                                direction::Integer, x, t,
86
                                                surface_flux_functions::Tuple,
87
                                                equations)
88
    surface_flux_function, nonconservative_flux_function = surface_flux_functions
1✔
89
    return surface_flux_function(u_inner, u_inner,
1✔
90
                                 orientation_or_normal_direction, equations),
91
           nonconservative_flux_function(u_inner, u_inner,
92
                                         orientation_or_normal_direction, equations)
93
end
94

95
# This version can be called by hyperbolic solvers on unstructured, curved meshes
96
@inline function (::BoundaryConditionDoNothing)(u_inner,
344,172✔
97
                                                outward_direction::AbstractVector,
98
                                                x, t, surface_flux, equations)
99
    return flux(u_inner, outward_direction, equations)
344,172✔
100
end
101

102
# Version for equations involving nonconservative fluxes
103
@inline function (::BoundaryConditionDoNothing)(u_inner,
2,305✔
104
                                                outward_direction::AbstractVector,
105
                                                x, t, surface_flux_functions::Tuple,
106
                                                equations)
107
    surface_flux_function, nonconservative_flux_function = surface_flux_functions
2,305✔
108

109
    return surface_flux_function(u_inner, u_inner, outward_direction, equations),
2,305✔
110
           nonconservative_flux_function(u_inner, u_inner, outward_direction,
111
                                         equations)
112
end
113

114
# This version can be called by parabolic solvers
UNCOV
115
@inline function (::BoundaryConditionDoNothing)(inner_flux_or_state, other_args...)
×
UNCOV
116
    return inner_flux_or_state
×
117
end
118

119
"""
120
    boundary_condition_do_nothing = Trixi.BoundaryConditionDoNothing()
121

122
Imposing no boundary condition just evaluates the flux at the inner state.
123
This has the effect of extending the domain beyond the boundary with the same solution state as
124
in the interior.
125
Also applicable to parabolic equations.
126
"""
127
const boundary_condition_do_nothing = BoundaryConditionDoNothing()
128

129
function Base.show(io::IO, ::BoundaryConditionDoNothing)
7✔
130
    print(io, "boundary_condition_do_nothing")
7✔
131
    return nothing
7✔
132
end
133
end # @muladd
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc