Classes | Typedefs | Functions | Variables
db Namespace Reference

Namespace for DataBox related things. More...

Classes

struct  BaseTag
 Tags that are base tags, i.e. a simple or compute tag must derive off them for them to be useful. More...
 
struct  ComputeTag
 Marks a DataBoxTag as being a compute item that executes a function. More...
 
class  DataBox
 
class  DataBox< tmpl::list< Tags... > >
 A DataBox stores objects that can be retrieved by using Tags. More...
 
struct  has_return_type_member
 
struct  has_return_type_member< T, cpp17::void_t< typename T::return_type > >
 
struct  is_base_tag
 Check if Tag is a base DataBox tag. More...
 
struct  is_compute_item
 Check if Tag derives off of db::ComputeTag. More...
 
struct  is_databox
 Determines if a type T is as db::DataBox. More...
 
struct  is_non_base_tag
 Check if Tag is a non-base DataBox tag. I.e. a SimpleTag or a ComputeTag. More...
 
struct  is_tag
 Check if Tag is a BaseTag, SimpleTag, or ComputeTag. More...
 
struct  item_type_if_contained
 Returns the type of Tag (including const and reference-ness as would be returned by db::get<Tag>) if the tag is in the DataBox of type DataBoxType, otherwise returns NoSuchType. More...
 
struct  prefix_tag_wraps_specified_tag
 true_type if the prefix tag wraps the specified tag, false_type otherwise. Can be used with tmpl::filter to extract a subset of a tmpl::list of prefix tags which wrap a specified tag. More...
 
struct  PrefixTag
 Marks an item as being a prefix to another tag. More...
 
struct  SimpleTag
 Tags for the DataBox inherit from this type. More...
 
struct  Subitems
 Struct that can be specialized to allow DataBox items to have subitems. Specializations must define: More...
 
struct  Subitems< TagList, Tag, Requires< tt::is_a_v< Variables, item_type< Tag, TagList > > > >
 
struct  Subitems< TagList, Tags::Interface< DirectionsTag, VariablesTag >, Requires< tt::is_a_v< Variables, item_type< VariablesTag, TagList > > > >
 
struct  Subitems< TagList, Tags::InterfaceComputeItem< DirectionsTag, VariablesTag >, Requires< tt::is_a_v< Variables, item_type< VariablesTag, TagList > > > >
 
struct  Subitems< TagList, Tags::Slice< DirectionsTag, VariablesTag >, Requires< tt::is_a_v< Variables, item_type< VariablesTag, TagList > > > >
 

Typedefs

template<typename... Tags>
using RemoveTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Tags to remove from the DataBox.
 
template<typename... Tags>
using AddSimpleTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Tags to add to the DataBox.
 
template<typename... Tags>
using MutateTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Tags to mutate in the DataBox.
 
template<typename... Tags>
using ArgumentTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Tags to get from the DataBox to be used as arguments.
 
template<typename... Tags>
using AddComputeTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Compute Item Tags to add to the DataBox.
 
template<class TagList >
using get_compute_items = tmpl::filter< TagList, db::is_compute_item< tmpl::_1 > >
 Get all the Tags that are compute items from the TagList
 
template<class TagList >
using get_items = tmpl::filter< TagList, tmpl::not_< tmpl::bind< db::is_compute_item, tmpl::_1 > >>
 Get all the Tags that are items from the TagList
 
template<class TagList >
using compute_databox_type = typename DataBox_detail::compute_dbox_type< get_items< TagList >, get_compute_items< TagList > >::type
 Returns the type of the DataBox that would be constructed from the TagList of tags.
 
template<typename Tag , typename TagList = NoSuchType>
using item_type = typename DataBox_detail::item_type_impl< TagList, Tag >::type
 Get the type that is returned by the Tag. If it is a base tag then a TagList must be passed as a second argument.
 
template<template< typename... > class Wrapper, typename TagList , typename... Args>
using wrap_tags_in = tmpl::transform< TagList, tmpl::bind< Wrapper, tmpl::_1, tmpl::pin< Args >... > >
 Create a new list of Tags by wrapping each tag in TagList using the Wrapper.
 
template<template< typename... > class Prefix, typename Tag , typename... Args>
using add_tag_prefix = Prefix< DataBox_detail::dispatch_add_tag_prefix_impl< Prefix, Tag, Args... >, Args... >
 Wrap Tag in Prefix<_, Args...>, also wrapping variables tags if Tag is a Tags::Variables.
 
template<typename Tag >
using remove_tag_prefix = typename DataBox_detail::remove_tag_prefix_impl< Tag >::type
 Remove a prefix from Tag, also removing it from the variables tags if the unwrapped tag is a Tags::Variables.
 
template<typename Tag >
using remove_all_prefixes = typename DataBox_detail::remove_all_prefixes_impl< Tag, cpp17::is_base_of_v< db::PrefixTag, Tag > >::type
 Completely remove all prefix tags from a Tag.
 
template<typename Tag , typename NewTagsList >
using variables_tag_with_tags_list = typename DataBox_detail::variables_tag_with_tags_list_impl< DataBox_detail::tag_type< Tag > >::template f< Tag, NewTagsList >
 Change the tags contained in a possibly prefixed Variables tag. More...
 
template<typename Tag >
using get_variables_tags_list = typename DataBox_detail::get_variables_tags_list_impl< DataBox_detail::tag_type< Tag > >::template f< Tag >
 
template<typename Tag , typename TagList = NoSuchType>
using split_tag = tmpl::conditional_t< tmpl::size< typename Subitems< TagList, Tag >::type >::value==0, tmpl::list< Tag >, typename Subitems< TagList, Tag >::type >
 Split a tag into its subitems. Tag cannot be a base tag.
 
template<typename Tag , typename DataBoxType >
using item_type_if_contained_t = typename item_type_if_contained< Tag, DataBoxType >::type
 

Functions

template<typename... MutateTags, typename TagList , typename Invokable , typename... Args>
void mutate (const gsl::not_null< DataBox< TagList > *> box, Invokable &&invokable, Args &&... args) noexcept
 Allows changing the state of one or more non-computed elements in the DataBox. More...
 
template<typename Tag , typename TagList >
const auto & get (const DataBox< TagList > &box) noexcept
 Retrieve the item with tag Tag from the DataBox. More...
 
template<typename AddSimpleTags , typename AddComputeTags = tmpl::list<>, typename... Args>
constexpr auto create (Args &&... args)
 Create a new DataBox. More...
 
template<typename TagsList >
constexpr DataBox< TagsList > create_copy (const DataBox< TagsList > &box) noexcept
 Create a non-aliasing copy of the DataBox. That is, the new DataBox will not share items with the old one. More...
 
template<typename Type , typename TagList >
constexpr const Type & get_item_from_box (const DataBox< TagList > &box, const std::string &tag_name) noexcept
 Retrieve an item from the DataBox that has a tag with label tag_name and type Type More...
 
template<typename TagsList , typename F , typename BoxTags , typename... Args>
constexpr auto apply (F &&f, const DataBox< BoxTags > &box, Args &&... args)
 Apply the function f with argument Tags TagsList from DataBox box More...
 
template<typename F , typename BoxTags , typename... Args>
constexpr auto mutate_apply (const gsl::not_null< DataBox< BoxTags > *> box, Args &&... args) noexcept
 Apply the stateless function F::apply mutating the F::return_tags and taking as additional arguments the F::argument_tags and args. More...
 
template<typename Tag >
std::string tag_name () noexcept
 Get the name of a DataBoxTag, including prefixes. More...
 
template<size_t VolumeDim, typename TagsList , typename... TagsToSlice>
Variables< tmpl::list< TagsToSlice... > > data_on_slice (const db::DataBox< TagsList > &box, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index, tmpl::list< TagsToSlice... >) noexcept
 Slices volume Tensors from a DataBox into a Variables More...
 
template<typename RemoveTags , typename AddTags = tmpl::list<>, typename AddComputeTags = tmpl::list<>, typename TagsList , typename... Args>
constexpr auto create_from (db::DataBox< TagsList > &&box, Args &&... args) noexcept
 Create a new DataBox from an existing one adding or removing items and compute items. More...
 
template<typename MutateTags , typename ArgumentTags , typename F , typename BoxTags , typename... Args, Requires< not DataBox_detail::has_return_tags_and_argument_tags_v< std::decay_t< F >>> = nullptr>
constexpr auto mutate_apply (F &&f, const gsl::not_null< DataBox< BoxTags > *> box, Args &&... args) noexcept(DataBox_detail::check_mutate_apply_mutate_tags(BoxTags{}, MutateTags{}) and DataBox_detail::check_mutate_apply_argument_tags(BoxTags{}, ArgumentTags{}) and noexcept(DataBox_detail::mutate_apply(f, box, MutateTags{}, ArgumentTags{}, std::forward< Args >(args)...)))
 Apply the invokable f mutating items MutateTags and taking as additional arguments ArgumentTags and args. More...
 

Variables

template<typename Tag , typename DataBoxType >
constexpr bool tag_is_retrievable_v
 Equal to true if Tag can be retrieved from a DataBox of type DataBoxType. More...
 
template<class T >
constexpr bool has_return_type_member_v = has_return_type_member<T>::value
 true if T has nested type alias named return_type
 
template<typename Tag >
constexpr bool is_compute_item_v = is_compute_item<Tag>::value
 
template<typename Tag >
constexpr bool is_non_base_tag_v = is_non_base_tag<Tag>::value
 
template<typename Tag >
constexpr bool is_tag_v = is_tag<Tag>::value
 
template<typename Tag >
constexpr bool is_base_tag_v = is_base_tag<Tag>::value
 

Detailed Description

Namespace for DataBox related things.