SpECTRE  v2022.05.05
Actions::SetupDataBox Struct Reference

Add into the DataBox default constructed items for the collection of tags requested by any of the actions in the phase-dependent action list. More...

#include <SetupDataBox.hpp>

Public Types

template<typename ParallelComponent >
using action_list_simple_tags = tmpl::remove_duplicates< SetupDataBox_detail::get_pdal_simple_tags< typename ParallelComponent::phase_dependent_action_list > >
template<typename ParallelComponent >
using action_list_compute_tags = tmpl::remove_duplicates< SetupDataBox_detail::get_pdal_compute_tags< typename ParallelComponent::phase_dependent_action_list > >

Static Public Member Functions

template<typename DbTags , typename... InboxTags, typename Metavariables , typename ArrayIndex , typename ActionList , typename ParallelComponent >
static auto apply (db::DataBox< DbTags > &box, const tuples::TaggedTuple< InboxTags... > &, const Parallel::GlobalCache< Metavariables > &, const ArrayIndex &, const ActionList, const ParallelComponent *const)

Detailed Description

Add into the DataBox default constructed items for the collection of tags requested by any of the actions in the phase-dependent action list.


This action adds all of the simple tags given in the simple_tags type lists in each of the other actions in the current component's full phase-dependent action list, and all of the compute tags given in the compute_tags type lists. If an action does not give either of the type lists, it is treated as an empty type list.

To prevent the proliferation of many DataBox types, which can drastically slow compile times, it is preferable to use only this action to add tags to the DataBox, and place this action at the start of the Initialization phase action list. The rest of the initialization actions should specify simple_tags and compute_tags, and assign initial values to those tags, but not add those tags into the DataBox.

An example initialization action:

struct InitializationAction {
using simple_tags = tmpl::list<CounterTag, VectorTag>;
using compute_tags = tmpl::list<SquareVectorCompute>;
template <typename DbTagsList, typename... InboxTags, typename Metavariables,
typename ArrayIndex, typename ActionList,
typename ParallelComponent>
db::DataBox<DbTagsList>& box,
const ArrayIndex& /*array_index*/, const ActionList /*meta*/,
const ParallelComponent* const /*meta*/) {
DataVector{1.2, 3.0});
return {std::move(box)};
T apply(T... args)
Stores a collection of function values.
Definition: DataVector.hpp:48
A Charm++ chare that caches constant data once per Charm++ node or non-constant data once per Charm++...
Definition: GlobalCache.hpp:298
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:259
This action operates on the assumption that the phase dependent action list of the ParallelComponent and the ActionList do not depend on the DataBox type in the Algorithm. This assumption holds for all current utilities, but if it must be relaxed, revisions to SetupDataBox may be required to avoid a cyclic dependency of the DataBox types.

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