Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
trixi-framework
GitHub Repository: trixi-framework/Trixi.jl
Path: blob/main/src/solvers/dgsem_p4est/subcell_limiters.jl
5616 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
###############################################################################
9
# Auxiliary routine `get_boundary_outer_state` for non-periodic domains
10
11
"""
12
get_boundary_outer_state(u_inner, t,
13
boundary_condition::BoundaryConditionDirichlet,
14
normal_direction
15
mesh, equations, dg, cache, indices...)
16
For subcell limiting, the calculation of local bounds for non-periodic domains requires the boundary
17
outer state. This function returns the boundary value for [`BoundaryConditionDirichlet`](@ref) at
18
time `t` and for node with spatial indices `indices` at the boundary with `normal_direction`.
19
20
Should be used together with [`P4estMesh`](@ref).
21
22
!!! warning "Experimental implementation"
23
This is an experimental feature and may change in future releases.
24
"""
25
@inline function get_boundary_outer_state(u_inner, t,
26
boundary_condition::BoundaryConditionDirichlet,
27
normal_direction,
28
mesh::P4estMesh,
29
equations, dg, cache, indices...)
30
(; node_coordinates) = cache.elements
31
32
x = get_node_coords(node_coordinates, equations, dg, indices...)
33
u_outer = boundary_condition.boundary_value_function(x, t, equations)
34
35
return u_outer
36
end
37
end # @muladd
38
39