SpECTRE  v2024.04.12
db::SimpleTag Struct Reference

Mark a struct as a simple tag by inheriting from this. More...

#include <Tag.hpp>

Detailed Description

Mark a struct as a simple tag by inheriting from this.

Details

A simple tag is used to uniquely identify an item in a tagged container such as a DataBox, Variables, or tuples::TaggedTuple.

A simple tag may be the base class of a compute tag. In such a case, the simple tag can be used to fetch the item corresponding to the compute tag from a DataBox.

A simple tag may be derived from a base tag. In such a case, the base tag can be used to fetch the item corresponding to the simple tag from a DataBox. Also the simple tags should have a type alias base that is the base tag.

Derived Class Requires:

  • type alias type of the type of the item corresponding to the simple tag

A simple tag may optionally specify a static std::string name() method to override the default name produced by db::tag_name.

Warning
Do not derive a simple tag from another simple tag.

Example

struct Tag0 : db::SimpleTag {
using type = double;
};
Mark a struct as a simple tag by inheriting from this.
Definition: Tag.hpp:36
See also
DataBox BaseTag ComputeTag PrefixTag

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