SpECTRE
v2024.05.11
|
Items related to the multigrid linear solver. More...
Namespaces | |
namespace | Actions |
Actions related to the Multigrid linear solver. | |
namespace | Tags |
DataBox tags for the LinearSolver::multigrid::Multigrid linear solver. | |
Classes | |
struct | DataFromChildrenInboxTag |
struct | ElementsAllocator |
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... | |
struct | Multigrid |
A V-cycle geometric multgrid solver for linear equations \(Ax = b\). More... | |
struct | VcycleDownLabel |
A label indicating the pre-smoothing step in a V-cycle multigrid algorithm, i.e. the smoothing step before sending the residual to the coarser (parent) grid. More... | |
struct | VcycleUpLabel |
A label indicating the post-smoothing step in a V-cycle multigrid algorithm, i.e. the smoothing step before sending the correction to the finer (child) grid. More... | |
Functions | |
template<size_t Dim> | |
std::vector< std::array< size_t, Dim > > | coarsen (std::vector< std::array< size_t, Dim > > initial_refinement_levels) |
Coarsen the initial refinement levels of all blocks in the domain. More... | |
template<size_t Dim> | |
ElementId< Dim > | parent_id (const ElementId< Dim > &child_id) |
The element covering the child_id on the coarser grid. More... | |
template<size_t Dim> | |
std::unordered_set< ElementId< Dim > > | child_ids (const ElementId< Dim > &parent_id, const std::array< size_t, Dim > &children_refinement_levels) |
The elements covering the parent_id on the finer grid. More... | |
Items related to the multigrid linear solver.
std::unordered_set< ElementId< Dim > > LinearSolver::multigrid::child_ids | ( | const ElementId< Dim > & | parent_id, |
const std::array< size_t, Dim > & | children_refinement_levels | ||
) |
The elements covering the parent_id
on the finer grid.
Dim | The spatial dimension of the domain |
parent_id | The ID of an element on the coarser grid |
children_refinement_levels | The refinement level of the finer grid in this block |
Returns: std::unordered_set<ElementId<Dim>> The IDs of the elements on the finer grid that cover the parent_id
. Returns an empty set if the parent_id
is already on the finest grid. Else, returns at least one child (if the grids have the same refinement levels) and at most \(2^\mathrm{Dim}\) children (if the grid is finer in every dimension).
std::vector< std::array< size_t, Dim > > LinearSolver::multigrid::coarsen | ( | std::vector< std::array< size_t, Dim > > | initial_refinement_levels | ) |
Coarsen the initial refinement levels of all blocks in the domain.
Simply decrement the refinement level uniformly over the entire domain. Doesn't do anything for blocks that are already fully coarsened, so if the return value equals the input argument the entire domain is fully coarsened. Decrementing the refinement level means combining two elements into one, thereby halving the number of elements per dimension.
Dim | The spatial dimension of the domain |
initial_refinement_levels | The refinement level in each block of the domain and in every dimension. |
Returns: std::vector<std::array<size_t, Dim>> The coarsened refinement levels by decrementing every entry in initial_refinement_levels
unless it is already zero.
ElementId< Dim > LinearSolver::multigrid::parent_id | ( | const ElementId< Dim > & | child_id | ) |
The element covering the child_id
on the coarser grid.
Dim | The spatial dimension of the domain |
child_id | The ID of an element on the finer grid |
Returns: ElementId<Dim> The ID of the element on the coarser grid that covers the child_id
. This parent element covers at most two child elements per dimension.