Path: blob/main/src/solvers/dgsem_t8code/containers_parallel.jl
5590 views
function reinitialize_containers!(mesh::T8codeMeshParallel, equations, dg::DGSEM, cache)1@unpack elements, interfaces, boundaries, mortars, mpi_interfaces, mpi_mortars,2mpi_cache = cache34n_cells = ncells(mesh)56resize!(elements, n_cells)7init_elements!(elements, mesh, dg.basis)89# Resize volume integral and related datastructures10@unpack volume_integral = dg11resize_volume_integral_cache!(cache, mesh, volume_integral, n_cells)12reinit_volume_integral_cache!(cache, mesh, dg, volume_integral, n_cells)1314count_required_surfaces!(mesh)15required = count_required_surfaces(mesh)1617resize!(interfaces, required.interfaces)1819resize!(boundaries, required.boundaries)2021resize!(mortars, required.mortars)2223resize!(mpi_interfaces, required.mpi_interfaces)2425resize!(mpi_mortars, required.mpi_mortars)2627mpi_mesh_info = (mpi_mortars = mpi_mortars,28mpi_interfaces = mpi_interfaces,2930# Temporary arrays for updating `mpi_cache`.31global_mortar_ids = fill(UInt128(0), nmpimortars(mpi_mortars)),32global_interface_ids = fill(UInt128(0),33nmpiinterfaces(mpi_interfaces)),34neighbor_ranks_mortar = Vector{Vector{Int}}(undef,35nmpimortars(mpi_mortars)),36neighbor_ranks_interface = fill(-1, nmpiinterfaces(mpi_interfaces)))3738fill_mesh_info!(mesh, interfaces, mortars, boundaries,39mesh.boundary_names; mpi_mesh_info = mpi_mesh_info)4041init_mpi_cache!(mpi_cache, mesh, mpi_mesh_info, nvariables(equations), nnodes(dg),42eltype(elements))4344empty!(mpi_mesh_info.global_mortar_ids)45empty!(mpi_mesh_info.global_interface_ids)46empty!(mpi_mesh_info.neighbor_ranks_mortar)47empty!(mpi_mesh_info.neighbor_ranks_interface)4849# Re-initialize and distribute normal directions of MPI mortars; requires50# MPI communication, so the MPI cache must be re-initialized beforehand.51init_normal_directions!(mpi_mortars, dg.basis, elements)52exchange_normal_directions!(mpi_mortars, mpi_cache, mesh, nnodes(dg))5354return nothing55end5657# Compatibility to `dgsem_p4est/containers.jl`.58function init_mpi_interfaces!(interfaces, mesh::T8codeMeshParallel)59# Do nothing.60return nothing61end6263# Compatibility to `dgsem_p4est/containers.jl`.64function init_mpi_mortars!(mortars, mesh::T8codeMeshParallel)65# Do nothing.66return nothing67end6869# Compatibility to `dgsem_p4est/containers_parallel.jl`.70function init_mpi_mortars!(mpi_mortars, mesh::T8codeMeshParallel, basis, elements)71# Do nothing.72return nothing73end747576