SpECTRE
v2025.03.17
|
A Parallel::protocols::ArrayElementsAllocator
that creates array elements to cover the initial computational domain multiple times at different refinement levels, suitable for the LinearSolver::multigrid::Multigrid
algorithm.
More...
#include <ElementsAllocator.hpp>
Public Types | |
template<typename ElementArray > | |
using | array_allocation_tags = implementation defined |
Static Public Member Functions | |
template<typename ElementArray , typename Metavariables , typename... InitializationTags> | |
static void | apply (Parallel::CProxy_GlobalCache< Metavariables > &global_cache, const tuples::TaggedTuple< InitializationTags... > &original_initialization_items, const tuples::tagged_tuple_from_typelist< typename ElementArray::array_allocation_tags > &={}, const std::unordered_set< size_t > &procs_to_ignore={}) |
A Parallel::protocols::ArrayElementsAllocator
that creates array elements to cover the initial computational domain multiple times at different refinement levels, suitable for the LinearSolver::multigrid::Multigrid
algorithm.
The initial_element_ids
function and the option-created domain::Tags::Domain
and domain::Tags::InitialRefinementLevels
determine the initial set of element IDs in the domain. This is taken as the finest grid in the multigrid hierarchy. Coarser grids are determined by successively applying LinearSolver::multigrid::coarsen
, up to LinearSolver::multigrid::Tags::MaxLevels
grids.
Array elements are created for all element IDs on all grids, meaning they all share the same parallel component, action list etc. Elements are connected to their neighbors on the same grid by the domain::Initialization::create_initial_element
function (this is independent of the multigrid code, the function is typically called in an initialization action). Elements are connected to their parent and children across grids by the multigrid-tags set here and in the multigrid initialization actions (see LinearSolver::multigrid::parent_id
and LinearSolver::multigrid::child_ids
).
This allocator also creates two sets of sections (see Parallel::Section
):
Parallel::Tags::Section<ElementArray, LinearSolver::multigrid::Tags::MultigridLevel>
: One section per grid. All elements are part of a section with this tag.Parallel::Tags::Section<ElementArray, LinearSolver::multigrid::Tags::IsFinestGrid>
: A single section that holds only the elements on the finest grid. Holds std::nullopt
on all other elements.The elements are distributed on processors using the domain::BlockZCurveProcDistribution
for every grid independently. An unordered set of size_t
s can be passed to the apply
function which represents physical processors to avoid placing elements on.