SpECTRE  v2024.04.12
amr::Actions::CollectDataFromChildren Struct Reference

Collects data from child elements to send to their parent element during adaptive mesh refinement. More...

#include <CollectDataFromChildren.hpp>

Static Public Member Functions

template<typename ParallelComponent , typename DbTagList , typename Metavariables >
static void apply (db::DataBox< DbTagList > &box, Parallel::GlobalCache< Metavariables > &cache, const ElementId< Metavariables::volume_dim > &child_id, const ElementId< Metavariables::volume_dim > &parent_id, std::deque< ElementId< Metavariables::volume_dim > > sibling_ids_to_collect)
 This function should be called after the parent element has been created by amr::Actions::CreateParent. More...
 
template<typename ParallelComponent , typename DbTagList , typename Metavariables >
static void apply (db::DataBox< DbTagList > &box, Parallel::GlobalCache< Metavariables > &cache, const ElementId< Metavariables::volume_dim > &child_id, const ElementId< Metavariables::volume_dim > &parent_id, std::deque< ElementId< Metavariables::volume_dim > > sibling_ids_to_collect, std::unordered_map< ElementId< Metavariables::volume_dim >, tuples::tagged_tuple_from_typelist< typename db::DataBox< DbTagList >::mutable_item_creation_tags > > children_data)
 This function should be called after a child element has added its data to children_data by a previous invocation of this action. More...
 

Detailed Description

Collects data from child elements to send to their parent element during adaptive mesh refinement.

Member Function Documentation

◆ apply() [1/2]

template<typename ParallelComponent , typename DbTagList , typename Metavariables >
static void amr::Actions::CollectDataFromChildren::apply ( db::DataBox< DbTagList > &  box,
Parallel::GlobalCache< Metavariables > &  cache,
const ElementId< Metavariables::volume_dim > &  child_id,
const ElementId< Metavariables::volume_dim > &  parent_id,
std::deque< ElementId< Metavariables::volume_dim > >  sibling_ids_to_collect 
)
inlinestatic

This function should be called after the parent element has been created by amr::Actions::CreateParent.

Details

This function sends a copy of all items corresponding to the mutable_item_creation_tags of box of child_id to the first sibling in sibling_ids_to_collect by invoking this action. Finally, the child element destroys itself.

◆ apply() [2/2]

template<typename ParallelComponent , typename DbTagList , typename Metavariables >
static void amr::Actions::CollectDataFromChildren::apply ( db::DataBox< DbTagList > &  box,
Parallel::GlobalCache< Metavariables > &  cache,
const ElementId< Metavariables::volume_dim > &  child_id,
const ElementId< Metavariables::volume_dim > &  parent_id,
std::deque< ElementId< Metavariables::volume_dim > >  sibling_ids_to_collect,
std::unordered_map< ElementId< Metavariables::volume_dim >, tuples::tagged_tuple_from_typelist< typename db::DataBox< DbTagList >::mutable_item_creation_tags > >  children_data 
)
inlinestatic

This function should be called after a child element has added its data to children_data by a previous invocation of this action.

Details

This function adds a copy of all items corresponding to the mutable_item_creation_tags of box of child_id to children_data. In addition, it checks if there are additional siblings that need to be added to sibiling_ids_to_collect. (This is necessary as not all siblings share a face.) If sibling_ids_to_collect is not empty, this action is invoked again on the first sibling in sibling_ids_to_collect. If it is empty, the data is sent to the parent element by calling amr::Actions::InitializeParent. Finally, the child element destroys itself.


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