Trixi.jl icon indicating copy to clipboard operation
Trixi.jl copied to clipboard

WIP: Add local and global limiting for StructuredMesh

Open bennibolm opened this issue 7 months ago • 2 comments

Adding the subcell local and global (for conservative variable each) limiting support for StructuredMesh.

Getting the inverse Jacobian makes this PR a bit longer. That's because for TreeMesh, inverse_jacobian is fixed for one element, while it is different for each node for StructuredMesh. To avoid something like

if mesh isa TreeMesh
    inverse_jacobian = cache.elements.inverse_jacobian[element]
end
for j in eachnode(dg), i in eachnode(dg)
    if mesh isa StructuredMesh
        inverse_jacobian = cache.elements.inverse_jacobian[i, j, element]
    end
    [...]
end

and also avoid unnecessary calls of inverse jacobian in TreeMesh simulations, I dispatched for the mesh type and extracted the code [...] to an inner function. After this PR, it will be straight forward to add support for P4estMesh.

For now, there is no support for non-conservative systems.

Since I haven't implemented an interesting elixir that only requires the limiters available in main, I only added a free stream test including local and global limiting for now. I think it doesn't make sense to merge another free stream elixir to main. I will wait until the PR for positivity limiting of nonlinear variables is merged and add a more interesting exilir.

bennibolm avatar Nov 15 '23 15:11 bennibolm