HM3
Hierarchical Multi-physics Multi-scale Methods
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
hm3::grid::adaptor::multi< TreeGrid > Struct Template Reference

Description

template<typename TreeGrid>
struct hm3::grid::adaptor::multi< TreeGrid >

Stores multiple grids inside a tree-like grid.

Inherits TreeGrid.

Tree-Node-to-Grid-Node map: (tree_node_idx, grid_idx) ->

grid_node_idx transform

grid_node_idx node (tree_node_idx n, grid_idx g) const noexcept
 Index of node n within grid g.
 
grid_node_idx & node (tree_node_idx n, grid_idx g) noexcept
 Index of node n within grid g.
 
bool in_grid (tree_node_idx n, grid_idx g) const noexcept
 Is the node n part of grid g ?
 
auto in_grid (grid_idx g) const noexcept
 Filters nodes that belong to the grid g.
 
auto to_grid_nodes (tree_node_idx n) const noexcept
 Maps grid ids to grid node ids at a given tree node n.
 
auto to_grid_nodes (grid_idx g) const noexcept
 Maps tree node ids to grid node ids of grid g.
 
auto nodes (grid_idx g) const noexcept
 All nodes in grid g.
 
auto grid_nodes (grid_idx g) const noexcept
 All grid nodes in grid g.
 
auto grid_nodes (tree_node_idx n) const noexcept
 All grid nodes in node n (including invalid grid nodes)
 
auto children (tree_node_idx n, grid_idx g) const noexcept
 Children of node n in grid g.
 
auto siblings (tree_node_idx n, grid_idx g) const noexcept
 Siblings of node n in grid g.
 
auto neighbors (tree_node_idx n, grid_idx g) const noexcept
 All neighbors (across all manifolds) of node n in grid g.
 
template<typename Manifold >
auto neighbors (tree_node_idx n, grid_idx g, Manifold manifold) const noexcept
 All neighbors across manifold of node n in grid g.
 

Public Types

using data_t = dense::matrix< grid_node_idx, dense::dynamic, dense::dynamic, tree_node_idx, grid_idx, dense::col_major_t >
 Multi grid indices.
 

Public Member Functions

grid_idx no_grids () const noexcept
 Number of grids.
 
auto grids () const noexcept
 Range of all grid ids.
 
auto data_swap () noexcept
 How to swap the connectivity between two nodes i and j.
 
void sort () noexcept
 Sorts the grid using dfs.
 
auto refine (tree_node_idx n) noexcept
 Refines node n and return the tree_node_idx of its children. More...
 
auto remove (tree_node_idx n, grid_idx g) noexcept
 Remove grid node of grid g at node n. More...
 

Member Function Documentation

template<typename TreeGrid>
auto hm3::grid::adaptor::multi< TreeGrid >::refine ( tree_node_idx  n)
noexcept

Refines node n and return the tree_node_idx of its children.

If p has children, this just return the children. Otherwise, it refines the node within the tree.

Referenced by hm3::solver::state::grid< dimension()>::refine().

template<typename TreeGrid>
auto hm3::grid::adaptor::multi< TreeGrid >::remove ( tree_node_idx  n,
grid_idx  g 
)
noexcept

Remove grid node of grid g at node n.

If the siblings of node n are leafs and contain no grid nodes from any grid they will be removed from the tree (their parent will be coarsen).

Referenced by hm3::solver::state::grid< dimension()>::pop().