-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP: Well-balanced mortars #45
base: main
Are you sure you want to change the base?
WIP: Well-balanced mortars #45
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
===========================================
- Coverage 99.27% 87.62% -11.66%
===========================================
Files 61 67 +6
Lines 2638 2989 +351
===========================================
Hits 2619 2619
- Misses 19 370 +351 ☔ View full report in Codecov by Sentry. |
The current version provides a well-balanced approximation for a fully wet configuration. The
The modification below in Trixi's # Create mortar container and initialize mortar data.
function init_mortars(mesh::Union{P4estMesh, T8codeMesh}, equations, basis, elements)
NDIMS = ndims(elements)
uEltype = eltype(elements)
# Initialize container
n_mortars = count_required_surfaces(mesh).mortars
_u = Vector{uEltype}(undef,
3 * nvariables(equations) * 2^(NDIMS - 1) *
nnodes(basis)^(NDIMS - 1) * n_mortars)
u = unsafe_wrap(Array, pointer(_u),
(3, nvariables(equations), 2^(NDIMS - 1),
ntuple(_ -> nnodes(basis), NDIMS - 1)..., n_mortars))
_neighbor_ids = Vector{Int}(undef, (2^(NDIMS - 1) + 1) * n_mortars)
neighbor_ids = unsafe_wrap(Array, pointer(_neighbor_ids),
(2^(NDIMS - 1) + 1, n_mortars))
_node_indices = Vector{NTuple{NDIMS, Symbol}}(undef, 2 * n_mortars)
node_indices = unsafe_wrap(Array, pointer(_node_indices), (2, n_mortars))
mortars = P4estMortarContainer{NDIMS, uEltype, NDIMS + 1, NDIMS + 3}(u,
neighbor_ids,
node_indices,
_u,
_neighbor_ids,
_node_indices)
if n_mortars > 0
init_mortars!(mortars, mesh)
end
return mortars
end |
This seeks to rewrite the mortar projection routines specifically for the shallow water equations to preserve well-balancedness with non-conforming approximations. That is, the shallow water solver could utilize the AMR capabilities of
TreeMesh
orP4estMesh
. The implementation might become delicate at wet/dry transition regions as one needs to take care in what solution values and/or fluxes are projected to and from the mortar while maintaining positivity.src/solvers
folderTreeMesh
in 2DP4estMesh
in 2D