SpECTRE  v2021.10.04
db Namespace Reference

Namespace for DataBox related things. More...

Classes

struct  BaseTag
 Mark a (usually) empty struct as a base tag by inheriting from this. More...
 
struct  ComputeTag
 Mark a struct as a compute tag by inheriting from this. More...
 
class  DataBox< tmpl::list< Tags... > >
 A DataBox stores objects that can be retrieved by using Tags. More...
 
struct  is_base_tag
 Check if Tag is a base DataBox tag. More...
 
struct  is_compute_tag
 Check if Tag derives off of db::ComputeTag. More...
 
struct  is_immutable_item_tag
 Check if Tag is a DataBox tag for an immutable item, i.e. a ComputeTag or ReferenceTag. More...
 
struct  is_mutable_item_tag
 Check if Tag is a DataBox tag for a mutable item, i.e. a SimpleTag. More...
 
struct  is_non_base_tag
 Check if Tag is not a base tag. More...
 
struct  is_reference_tag
 Check if Tag derives off of db::ReferenceTag. More...
 
struct  is_simple_tag
 Check if Tag is a simple tag. More...
 
struct  is_tag
 Check if Tag is a DataBox tag, i.e. a BaseTag, SimpleTag, ComputeTag, or ReferenceTag. More...
 
struct  PrefixTag
 Mark a struct as a prefix tag by inheriting from this. More...
 
struct  ReferenceTag
 Mark a struct as a reference tag by inheriting from this. More...
 
struct  SimpleTag
 Mark a struct as a simple tag by inheriting from this. More...
 
struct  Subitems
 Struct that can be specialized to allow DataBox items to have subitems. Specializations must define: More...
 
struct  Subitems< domain::Tags::Interface< DirectionsTag, VariablesTag >, Requires< tt::is_a_v< Variables, typename VariablesTag::type > > >
 
struct  Subitems< domain::Tags::InterfaceCompute< DirectionsTag, VariablesTag >, Requires< tt::is_a_v< Variables, typename VariablesTag::type > > >
 
struct  Subitems< domain::Tags::Slice< DirectionsTag, VariablesTag >, Requires< tt::is_a_v< Variables, typename VariablesTag::type > > >
 
struct  Subitems< FacesTag, Requires< std::is_base_of_v< domain::Tags::Faces< FacesTag::volume_dim, typename FacesTag::tag >, FacesTag > and tt::is_a_v< Variables, typename FacesTag::tag::type > > >
 
struct  Subitems< LinearSolver::Schwarz::Tags::Overlaps< VariablesTag, Dim, OptionsGroup >, Requires< tt::is_a_v< Variables, typename VariablesTag::type > > >
 
struct  Subitems< Tag, Requires< Variables_detail::is_a_variables_tag_v< Tag > > >
 

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 AddComputeTags = tmpl::flatten< tmpl::list< Tags... > >
 List of Compute Item Tags to add to the DataBox.
 
template<typename TagList >
using compute_databox_type = typename detail::compute_dbox_type< TagList >::type
 Returns the type of the DataBox that would be constructed from the TagList of tags.
 
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 tmpl::list of tags by wrapping each tag in TagList in Wrapper<_, Args...>.
 
template<template< typename... > class Prefix, typename Tag , typename... Args>
using add_tag_prefix = typename detail::add_tag_prefix_impl< Prefix, Tag, Args... >::type
 Wrap Tag in Prefix<_, Args...>, unless Tag is a Tags::Variables, in which case this creates a new Tags::Variables, wrapping each tag in Tag::tags_list with Prefix<_, Args...>.
 
template<typename Tag >
using remove_tag_prefix = typename detail::remove_tag_prefix_impl< Tag >::type
 Remove the outer prefix from a prefixed tag Tag, or remove the outer prefix of each tag in Tag::tags_list if Tag is a Tags::Variables.
 
template<typename Tag >
using remove_all_prefixes = typename detail::remove_all_prefixes_impl< Tag >::type
 Completely remove all prefix tags from a Tag, or all prefixes from the tags in Tag::tags_list if Tag is a Tags::Variables.
 

Functions

template<typename... MutateTags, typename TagList , typename Invokable , typename... Args>
decltype(auto) mutate (const gsl::not_null< DataBox< TagList > * > box, Invokable &&invokable, Args &&... args)
 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)
 Retrieve the item with tag Tag from the DataBox. More...
 
template<typename Tag , typename TagList >
auto & get_mutable_reference (const gsl::not_null< DataBox< TagList > * > box)
 Retrieve a mutable reference to the item with tag Tag from the DataBox. More...
 
template<typename AddMutableItemTags , typename AddImmutableItemTags = tmpl::list<>, typename... Args>
constexpr auto create (Args &&... args)
 Create a new DataBox. More...
 
template<typename RemoveTags , typename AddMutableItemTags = tmpl::list<>, typename AddImmutableItemTags = tmpl::list<>, typename TagsList , typename... Args>
constexpr auto create_from (db::DataBox< TagsList > &&box, Args &&... args)
 Create a new DataBox from an existing one adding or removing items. 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... >)
 Slices volume Tensors from a DataBox into a Variables More...
 
template<typename Tag >
std::string tag_name ()
 Get the name of a DataBox tag, including prefixes. More...
 
template<typename ArgumentTags , typename F , typename BoxTags , typename... Args>
constexpr auto apply (F &&f, const DataBox< BoxTags > &box, Args &&... args)
 Apply the invokable f with argument Tags TagsList from DataBox box More...
 
template<typename F , typename BoxTags , typename... Args>
constexpr auto apply (F &&f, const DataBox< BoxTags > &box, Args &&... args)
 Apply the invokable f with argument Tags TagsList from DataBox box More...
 
template<typename F , typename BoxTags , typename... Args>
constexpr auto apply (const DataBox< BoxTags > &box, Args &&... args)
 Apply the invokable f with argument Tags TagsList from DataBox box More...
 
template<typename MutateTags , typename ArgumentTags , typename F , typename BoxTags , typename... Args>
constexpr decltype(auto) mutate_apply (F &&f, const gsl::not_null< DataBox< BoxTags > * > box, Args &&... args)
 Apply the invokable f mutating items MutateTags and taking as additional arguments ArgumentTags and args. More...
 
template<typename F , typename BoxTags , typename... Args>
constexpr decltype(auto) mutate_apply (F &&f, const gsl::not_null< DataBox< BoxTags > * > box, Args &&... args)
 Apply the invokable f mutating items MutateTags and taking as additional arguments ArgumentTags and args. More...
 
template<typename F , typename BoxTags , typename... Args>
constexpr decltype(auto) mutate_apply (const gsl::not_null< DataBox< BoxTags > * > box, Args &&... args)
 Apply the invokable f mutating items MutateTags and taking as additional arguments ArgumentTags and args. More...
 

Variables

template<typename Tag >
constexpr bool is_compute_tag_v = is_compute_tag<Tag>::value
 True if Tag derives from db::ComputeTag.
 
template<typename Tag >
constexpr bool is_reference_tag_v = is_reference_tag<Tag>::value
 True if Tag derives from db::ReferenceTag.
 
template<typename Tag >
constexpr bool is_immutable_item_tag_v = is_immutable_item_tag<Tag>::value
 True if Tag is a DataBox tag for an immutable item, i.e. a ComputeTag or ReferenceTag.
 
template<typename Tag >
constexpr bool is_mutable_item_tag_v = is_mutable_item_tag<Tag>::value
 True if Tag is a DataBox tag for a mutable item, i.e. a SimpleTag.
 
template<typename Tag >
constexpr bool is_simple_tag_v = is_simple_tag<Tag>::value
 True if Tag is a simple tag.
 
template<typename Tag >
constexpr bool is_non_base_tag_v = is_non_base_tag<Tag>::value
 True if Tag is not a base tag.
 
template<typename Tag >
constexpr bool is_tag_v = is_tag<Tag>::value
 True if Tag is a DataBox tag.
 
template<typename Tag >
constexpr bool is_base_tag_v = is_base_tag<Tag>::value
 True if Tag is a base tag.
 
template<typename Tag , typename DataBoxType >
using tag_is_retrievable = tmpl::any< typename DataBoxType::tags_list, std::is_base_of< tmpl::pin< Tag >, tmpl::_1 > >
 Equal to true if Tag can be retrieved from a DataBox of type DataBoxType.
 
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...
 

Detailed Description

Namespace for DataBox related things.