Various useful data structures used in SpECTRE. More...
Namespaces | |
MakeWithValueImpls | |
Implementations of make_with_value. | |
Classes | |
class | ComplexDataVector |
Stores a collection of complex function values. More... | |
class | ComplexDiagonalModalOperator |
A class for an element-wise complex multiplier of modal coefficients. More... | |
class | ComplexModalVector |
A class for storing complex spectral coefficients on a spectral grid. More... | |
class | DataVector |
Stores a collection of function values. More... | |
class | DenseMatrix< T, SO > |
A dynamically sized matrix of arbitrary type. More... | |
class | DenseVector< T, TF > |
A dynamically sized vector of arbitrary type. More... | |
class | DiagonalModalOperator |
A class for an element-wise multiplier of modal coefficients. More... | |
class | FixedHashMap< MaxSize, Key, ValueType, Hash, KeyEqual > |
A hash table with a compile-time specified maximum size and ability to efficiently handle perfect hashes. More... | |
struct | IdPair< IdType, DataType > |
A data structure that contains an ID and data associated with that ID. More... | |
class | Index< Dim > |
An integer multi-index. More... | |
class | IndexIterator< Dim > |
IndexIterator iterates over a unique set of Index. More... | |
class | LeviCivitaIterator< Dim > |
Iterate over all nonzero index permutations for a Levi-Civita symbol. More... | |
class | Matrix |
A dynamically sized matrix of double s with column-major storage. More... | |
class | ModalVector |
A class for storing spectral coefficients on a spectral grid. More... | |
class | SliceIterator |
Iterate over a (dim-1)-dimensional slice. More... | |
struct | SpinWeighted< T, Spin, is_vector > |
Make a spin-weighted type T with spin-weight Spin . Mathematical operators are restricted to addition, subtraction, multiplication and division, with spin-weights checked for validity. More... | |
struct | is_any_spin_weighted< T > |
This is a std::true_type if the provided type is a SpinWeighted of any type and spin, otherwise is a std::false_type . More... | |
struct | is_spin_weighted_of< InternalType, T > |
This is a std::true_type if the provided type T is a SpinWeighted of InternalType and any spin, otherwise is a std::false_type . More... | |
struct | is_spin_weighted_of_same_type< T1, T2 > |
This is a std::true_type if the provided type T1 is a SpinWeighted and T2 is a SpinWeighted , and both have the same internal type, but any combination of spin weights. More... | |
class | StripeIterator |
Iterates over the 1-dimensional stripes with info on how to iterate over the current stripe. More... | |
struct | TempBuffer< TagList, is_fundamental > |
A TempBuffer holds a set of Tensor<DataType> s, where DataType is either a DataVector (or similar type) or a fundamental type, in a way that minimizes allocations. More... | |
struct | Tags::Magnitude< Tag > |
The magnitude of a (co)vector. More... | |
struct | Tags::EuclideanMagnitude< Tag > |
The Euclidean magnitude of a (co)vector. More... | |
struct | Tags::NonEuclideanMagnitude< Tag, MetricTag > |
The magnitude of a (co)vector with respect to a specific metric. More... | |
struct | Tags::Normalized< Tag > |
The normalized (co)vector represented by Tag. More... | |
struct | TensorComponent |
An untyped tensor component with a name for observation. More... | |
struct | ExtentsAndTensorVolumeData |
Holds the extents of the mesh and the tensor components on the mesh. More... | |
class | Variables< tmpl::list< Tags... > > |
A Variables holds a contiguous memory block with Tensors pointing into it. More... | |
class | VectorImpl< T, VectorType > |
Base class template for various DataVector and related types. More... | |
struct | get_vector_element_type< T, bool > |
Helper struct to determine the element type of a VectorImpl or container of VectorImpl. More... | |
class | DirectionMap< Dim, T > |
An optimized map with Direction keys. More... | |
class | Mesh< Dim > |
Holds the number of grid points, basis, and quadrature in each direction of the computational grid. More... | |
Macros | |
#define | BLAZE_TRAIT_SPECIALIZE_BINARY_TRAIT(VECTOR_TYPE, BLAZE_MATH_TRAIT) |
Instructs Blaze to provide the appropriate vector result type after math operations. This is accomplished by specializing Blaze's type traits that are used for handling return type deduction and specifying the using Type = nested type alias in the traits. More... | |
#define | BLAZE_TRAIT_SPECIALIZE_COMPATIBLE_BINARY_TRAIT(VECTOR_TYPE, COMPATIBLE, BLAZE_MATH_TRAIT) |
Instructs Blaze to provide the appropriate vector result type of an operator between VECTOR_TYPE and COMPATIBLE , where the operation is represented by BLAZE_MATH_TRAIT More... | |
#define | VECTOR_BLAZE_TRAIT_SPECIALIZE_ARITHMETIC_TRAITS(VECTOR_TYPE) |
Instructs Blaze to provide the appropriate vector result type of arithmetic operations for VECTOR_TYPE . This is accomplished by specializing Blaze's type traits that are used for handling return type deduction. More... | |
#define | VECTOR_BLAZE_TRAIT_SPECIALIZE_ALL_MAP_TRAITS(VECTOR_TYPE) |
Instructs Blaze to provide the appropriate vector result type of Map operations (unary and binary) acting on VECTOR_TYPE . This is accomplished by specializing Blaze's type traits that are used for handling return type deduction. More... | |
#define | MAKE_STD_ARRAY_VECTOR_BINOPS(VECTOR_TYPE) |
Defines the set of binary operations often supported for std::array<VECTOR_TYPE, size> , for arbitrary size . More... | |
#define | MAKE_MATH_ASSIGN_EXPRESSION_ARITHMETIC(VECTOR_TYPE) |
Defines MAKE_MATH_ASSIGN_EXPRESSION_POINTERVECTOR with all assignment arithmetic operations. More... | |
#define | MAKE_WITH_VALUE_IMPL_DEFINITION_FOR(VECTOR_TYPE) |
Defines the MakeWithValueImpl apply specialization. More... | |
Functions | |
template<size_t N> | |
size_t | collapsed_index (const Index< N > &index, const Index< N > &extents) noexcept |
Get the collapsed index into a 1D array of the data corresponding to this Index. Note that the first dimension of the Index varies fastest when computing the collapsed index. | |
template<size_t VolumeDim> | |
auto | volume_and_slice_indices (const Index< VolumeDim > &extents) noexcept -> std::pair< std::unique_ptr< std::pair< size_t, size_t >[], decltype(&free)>, std::array< std::pair< gsl::span< std::pair< size_t, size_t >>, gsl::span< std::pair< size_t, size_t >>>, VolumeDim >> |
Get the mapping between volume and boundary slice indices. More... | |
template<typename Tag , typename TagList > | |
constexpr Tag::type & | get (Variables< TagList > &v) noexcept |
Return Tag::type pointing into the contiguous array. More... | |
template<std::size_t VolumeDim, typename TagsList > | |
void | add_slice_to_data (const gsl::not_null< Variables< TagsList > *> volume_vars, const Variables< TagsList > &vars_on_slice, const Index< VolumeDim > &extents, const size_t sliced_dim, const size_t fixed_index) noexcept |
Adds data on a codimension 1 slice to a volume quantity. The slice has a constant logical coordinate in direction sliced_dim , slicing the volume at fixed_index in that dimension. For example, to add to the lower boundary of sliced_dim , pass 0 for fixed_index ; to add to the upper boundary, pass extents[sliced_dim] - 1 . More... | |
template<typename R , typename T , typename ValueType > | |
std::remove_const_t< R > | make_with_value (const T &input, const ValueType &value) noexcept |
Given an object of type T , create an object of type R whose elements are initialized to value . More... | |
template<std::size_t VolumeDim, typename TagsList > | |
void | data_on_slice (const gsl::not_null< Variables< TagsList > *> interface_vars, const Variables< TagsList > &vars, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index) noexcept |
Slices the data within vars to a codimension 1 slice. The slice has a constant logical coordinate in direction sliced_dim , slicing the volume at fixed_index in that dimension. For example, to get the lower boundary of sliced_dim , pass 0 for fixed_index ; to get the upper boundary, pass extents[sliced_dim] - 1 . More... | |
template<std::size_t VolumeDim, typename TagsList > | |
Variables< TagsList > | data_on_slice (const Variables< TagsList > &vars, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index) noexcept |
Slices the data within vars to a codimension 1 slice. The slice has a constant logical coordinate in direction sliced_dim , slicing the volume at fixed_index in that dimension. For example, to get the lower boundary of sliced_dim , pass 0 for fixed_index ; to get the upper boundary, pass extents[sliced_dim] - 1 . More... | |
template<typename... TagsToSlice, size_t VolumeDim> | |
void | data_on_slice (const gsl::not_null< Variables< tmpl::list< TagsToSlice... >> *> interface_vars, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index, const typename TagsToSlice::type &... tensors) noexcept |
Slices volume Tensor s into a Variables More... | |
template<typename... TagsToSlice, size_t VolumeDim> | |
Variables< tmpl::list< TagsToSlice... > > | data_on_slice (const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index, const typename TagsToSlice::type &... tensors) noexcept |
Slices volume Tensor s into a Variables More... | |
template<size_t VolumeDim, typename TagsList > | |
Variables< TagsList > | orient_variables (const Variables< TagsList > &variables, const Index< VolumeDim > &extents, const OrientationMap< VolumeDim > &orientation_of_neighbor) noexcept |
Orient variables to the data-storage order of a neighbor element with the given orientation. | |
template<size_t VolumeDim, typename TagsList > | |
Variables< TagsList > | orient_variables_on_slice (const Variables< TagsList > &variables_on_slice, const Index< VolumeDim - 1 > &slice_extents, const size_t sliced_dim, const OrientationMap< VolumeDim > &orientation_of_neighbor) noexcept |
Orient variables to the data-storage order of a neighbor element with the given orientation. | |
Various useful data structures used in SpECTRE.
#define BLAZE_TRAIT_SPECIALIZE_BINARY_TRAIT | ( | VECTOR_TYPE, | |
BLAZE_MATH_TRAIT | |||
) |
Instructs Blaze to provide the appropriate vector result type after math operations. This is accomplished by specializing Blaze's type traits that are used for handling return type deduction and specifying the using Type =
nested type alias in the traits.
VECTOR_TYPE | The vector type, which matches the type of the operation result (e.g. DataVector ) |
BLAZE_MATH_TRAIT | The blaze trait/expression for which you want to specify the return type (e.g. AddTrait ). |
#define BLAZE_TRAIT_SPECIALIZE_COMPATIBLE_BINARY_TRAIT | ( | VECTOR_TYPE, | |
COMPATIBLE, | |||
BLAZE_MATH_TRAIT | |||
) |
Instructs Blaze to provide the appropriate vector result type of an operator between VECTOR_TYPE
and COMPATIBLE
, where the operation is represented by BLAZE_MATH_TRAIT
VECTOR_TYPE | The vector type, which matches the type of the operation result (e.g. ComplexDataVector ) |
COMPATIBLE | the type for which you want math operations to work with VECTOR_TYPE smoothly (e.g. DataVector ) |
BLAZE_MATH_TRAIT | The blaze trait for which you want declare the Type field (e.g. AddTrait ) |
#define MAKE_MATH_ASSIGN_EXPRESSION_ARITHMETIC | ( | VECTOR_TYPE | ) |
Defines MAKE_MATH_ASSIGN_EXPRESSION_POINTERVECTOR
with all assignment arithmetic operations.
VECTOR_TYPE | The vector type (e.g. DataVector ) |
#define MAKE_STD_ARRAY_VECTOR_BINOPS | ( | VECTOR_TYPE | ) |
Defines the set of binary operations often supported for std::array<VECTOR_TYPE, size>
, for arbitrary size
.
VECTOR_TYPE | The vector type (e.g. DataVector ) |
#define MAKE_WITH_VALUE_IMPL_DEFINITION_FOR | ( | VECTOR_TYPE | ) |
Defines the MakeWithValueImpl
apply
specialization.
The MakeWithValueImpl<VECTOR_TYPE, VECTOR_TYPE>
member apply(VECTOR_TYPE, VECTOR_TYPE::value_type)
specialization defined by this macro produces an object with the same size as the input
argument, initialized with the value
argument in every entry.
VECTOR_TYPE | The vector type (e.g. DataVector ) |
#define VECTOR_BLAZE_TRAIT_SPECIALIZE_ALL_MAP_TRAITS | ( | VECTOR_TYPE | ) |
Instructs Blaze to provide the appropriate vector result type of Map
operations (unary and binary) acting on VECTOR_TYPE
. This is accomplished by specializing Blaze's type traits that are used for handling return type deduction.
Type declarations here are suitable for contiguous data (e.g. DataVector
), but this macro might need to be tweaked for other types of data, for instance Fourier coefficients.
VECTOR_TYPE | The vector type, which for the Map operations is the type of the operation result (e.g. DataVector ) |
#define VECTOR_BLAZE_TRAIT_SPECIALIZE_ARITHMETIC_TRAITS | ( | VECTOR_TYPE | ) |
Instructs Blaze to provide the appropriate vector result type of arithmetic operations for VECTOR_TYPE
. This is accomplished by specializing Blaze's type traits that are used for handling return type deduction.
Type definitions here are suitable for contiguous data (e.g. DataVector
), but this macro might need to be tweaked for other types of data, for instance Fourier coefficients.
VECTOR_TYPE | The vector type, which for the arithmetic operations is the type of the operation result (e.g. DataVector ) |
|
noexcept |
Adds data on a codimension 1 slice to a volume quantity. The slice has a constant logical coordinate in direction sliced_dim
, slicing the volume at fixed_index
in that dimension. For example, to add to the lower boundary of sliced_dim
, pass 0
for fixed_index
; to add to the upper boundary, pass extents[sliced_dim] - 1
.
|
noexcept |
Slices the data within vars
to a codimension 1 slice. The slice has a constant logical coordinate in direction sliced_dim
, slicing the volume at fixed_index
in that dimension. For example, to get the lower boundary of sliced_dim
, pass 0
for fixed_index
; to get the upper boundary, pass extents[sliced_dim] - 1
.
returns Variables class sliced to a hypersurface.
|
noexcept |
Slices the data within vars
to a codimension 1 slice. The slice has a constant logical coordinate in direction sliced_dim
, slicing the volume at fixed_index
in that dimension. For example, to get the lower boundary of sliced_dim
, pass 0
for fixed_index
; to get the upper boundary, pass extents[sliced_dim] - 1
.
returns Variables class sliced to a hypersurface.
|
noexcept |
Slices volume Tensor
s into a Variables
The slice has a constant logical coordinate in direction sliced_dim
, slicing the volume at fixed_index
in that dimension. For example, to get the lower boundary of sliced_dim
, pass 0
for fixed_index
; to get the upper boundary, pass extents[sliced_dim] - 1
.
|
noexcept |
Slices volume Tensor
s into a Variables
The slice has a constant logical coordinate in direction sliced_dim
, slicing the volume at fixed_index
in that dimension. For example, to get the lower boundary of sliced_dim
, pass 0
for fixed_index
; to get the upper boundary, pass extents[sliced_dim] - 1
.
|
noexcept |
Return Tag::type pointing into the contiguous array.
Tag | the variable to return |
|
noexcept |
Given an object of type T
, create an object of type R
whose elements are initialized to value
.
This function is useful in function templates in order to initialize the return type of a function template with value
for functions that can be called either at a single grid-point or to fill a data structure at the same set of grid-points as the input
ValueType | The type of value . For many containers, this will be double , but when making a ComplexDataVector with value, std::complex<double> is appropriate. |
|
noexcept |
Get the mapping between volume and boundary slice indices.
SliceIterator is used to map between the index of a point on a slice in the volume data and the index in the corresponding sliced data. Repeatedly applying the SliceIterator on various components of a tensor becomes very expensive and so precomputing the index map is sometimes advantageous. This function computes the index map onto all boundary slices of volume mesh with extents extents
.
The unique_ptr
is where the volume and slice indices are stored in memory, the array holds views into the memory buffer. The index of the array is the fixed dimension, the outer pair
holds the indices for the lower and upper side, respectively, while the pair
s in the span
s hold the volume and slice indices, respectively.