Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node-level visualization support for coefficients of Subcell limiting #1611

Merged
merged 14 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/solvers/dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ end

function get_node_variables!(node_variables, mesh, equations,
volume_integral::VolumeIntegralSubcellLimiting, dg, cache)
# While for the element-wise limiting with `VolumeIntegralShockCapturingHG` the indicator is
# called here to get up-to-date values for IO, this is not easily possible in this case
# because the calculation is very integrated into the method.
# See also https://github.com/trixi-framework/Trixi.jl/pull/1611#discussion_r1334553206.
# Therefore, the coefficients at `t=t^{n-1}` are saved. Thus, the coefficients of the first
# stored solution (initial condition) are not yet defined and were manually set to `-1`.
bennibolm marked this conversation as resolved.
Show resolved Hide resolved
get_node_variables!(node_variables, volume_integral.limiter, volume_integral,
bennibolm marked this conversation as resolved.
Show resolved Hide resolved
equations)
end
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/dgsem_tree/containers_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ function Base.resize!(container::ContainerSubcellLimiterIDP2D, capacity)
@unpack _alpha, _alpha1, _alpha2 = container
resize!(_alpha, n_nodes * n_nodes * capacity)
container.alpha = unsafe_wrap(Array, pointer(_alpha), (n_nodes, n_nodes, capacity))
container.alpha .= zero(eltype(container.alpha))
container.alpha .= -1 * one(eltype(container.alpha))
bennibolm marked this conversation as resolved.
Show resolved Hide resolved
resize!(_alpha1, (n_nodes + 1) * n_nodes * capacity)
container.alpha1 = unsafe_wrap(Array, pointer(_alpha1),
(n_nodes + 1, n_nodes, capacity))
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/dgsem_tree/subcell_limiters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ end

function get_node_variables!(node_variables, limiter::SubcellLimiterIDP,
::VolumeIntegralSubcellLimiting, equations)
node_variables[:alpha_limiter] = limiter.cache.subcell_limiter_coefficients.alpha
node_variables[:limiting_coefficient] = limiter.cache.subcell_limiter_coefficients.alpha

return nothing
end
Expand Down
5 changes: 5 additions & 0 deletions src/time_integration/methods_SSP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ struct SimpleSSPRK33{StageCallbacks} <: SimpleAlgorithmSSP
stage_callbacks::StageCallbacks

function SimpleSSPRK33(; stage_callbacks = ())
# Mathematically speaking, it is not necessary for the algorithm to split the factors
# into numerator and denominator. Otherwise, however, rounding errors of the order of
# the machine accuracy will occur, which will add up over time and thus endanger the
# conservation of the simulation.
# See also https://github.com/trixi-framework/Trixi.jl/pull/1640.
numerator_a = SVector(0.0, 3.0, 1.0) # a = numerator_a / denominator
numerator_b = SVector(1.0, 1.0, 2.0) # b = numerator_b / denominator
denominator = SVector(1.0, 4.0, 3.0)
Expand Down