|
SpECTRE
v2025.08.19
|
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 = tmpl::list<> |
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::InitialCoarseLevels coarser 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::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).
Once the multigrid hierarchy is created, the AMR infrastructure registers the grids and creates the following sections (see Parallel::Section).
Parallel::Tags::Section<ElementArray, amr::Tags::GridIndex>: One section per grid. All elements are part of a section with this tag.Parallel::Tags::Section<ElementArray, amr::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_ts can be passed to the apply function which represents physical processors to avoid placing elements on.