SpECTRE  v2024.04.12
LinearSolver::multigrid::ElementsAllocator< Dim, OptionsGroup > Struct Template Reference

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< Parallel::Tags::Section< ElementArray, Tags::MultigridLevel >, Parallel::Tags::Section< ElementArray, Tags::IsFinestGrid > >
 

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={})
 

Detailed Description

template<size_t Dim, typename OptionsGroup>
struct LinearSolver::multigrid::ElementsAllocator< Dim, OptionsGroup >

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):

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.


The documentation for this struct was generated from the following file: