SpECTRE
v2024.12.16
|
Various useful data structures used in SpECTRE. More...
Namespaces | |
namespace | variants |
TaggedVariant and related functionality. | |
namespace | MakeWithValueImpls |
Implementations of make_with_value. | |
Classes | |
class | CachedTempBuffer< Tags > |
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 | ObservationBox< tmpl::list< ComputeTags... >, DataBoxType > |
Used for adding compute items to a DataBox without copying or moving any data from the original DataBox More... | |
class | DataVector |
Stores a collection of function values. More... | |
class | DiagonalModalOperator |
A class for an element-wise multiplier of modal coefficients. More... | |
class | DynamicBuffer< T > |
A dynamically sized vector of DataVector s. 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... | |
struct | LinkedMessageId< Id > |
An identifier for an element in a sequence. More... | |
class | LinkedMessageQueue< Id, tmpl::list< QueueTags... > > |
A collection of queues of asynchronously received data. More... | |
class | MathWrapper< T > |
Type-erased data for performing math on. 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... | |
class | variants::TaggedVariant< Tags > |
A class similar to std::variant , but indexed by tag structs. 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 | Tags::NormalizedCompute< Tag > |
Normalizes the (co)vector represented by Tag. More... | |
struct | Tags::PointwiseL2Norm< Tag > |
struct | Tags::PointwiseL2NormCompute< Tag > |
struct | Tags::L2Norm< Tag > |
struct | Tags::L2NormCompute< Tag > |
class | Variables< tmpl::list< Tags... > > |
A Variables holds a contiguous memory block with Tensors pointing into it. More... | |
class | VectorImpl< T, VectorType, StaticSize > |
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... | |
struct | TensorComponent |
An untyped tensor component with a name for observation. More... | |
struct | ElementVolumeData |
Holds tensor components on a grid, to be written into an H5 file. More... | |
class | Mesh< Dim > |
Holds the number of grid points, basis, and quadrature in each direction of the computational grid. More... | |
Macros | |
#define | MATH_WRAPPER_TYPES double, std::complex<double>, DataVector, ComplexDataVector |
A comma-separated list of valid template arguments to MathWrapper. Useful for explicit instantiations. More... | |
#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, RESULT_TYPE) |
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_WITH_VALUE_IMPL_DEFINITION_FOR(VECTOR_TYPE) |
Defines the MakeWithValueImpl apply specialization. More... | |
Typedefs | |
template<typename T > | |
using | math_wrapper_type = typename decltype(make_math_wrapper(std::declval< tmpl::conditional_t< std::is_const_v< T >, const T &, gsl::not_null< T * > > >()))::value_type |
The value_type for a MathWrapper wrapping T . | |
Enumerations | |
enum class | FloatingPointType { Float , Double } |
Which floating point type to use. More... | |
Functions | |
template<typename Tag , typename DataBoxType , typename... ComputeTags> | |
const auto & | get (const ObservationBox< tmpl::list< ComputeTags... >, DataBoxType > &box) |
Retrieve a Tag from the ObservationBox . | |
template<typename DataBoxType , typename ComputeTagsList , typename... Args, typename F > | |
auto | apply (F &&f, const ObservationBox< ComputeTagsList, DataBoxType > &observation_box, Args &&... args) |
Apply the function object f using its nested argument_tags list of tags. | |
template<size_t N> | |
size_t | collapsed_index (const Index< N > &index, const Index< N > &extents) |
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) -> std::pair< std::unique_ptr< std::pair< size_t, size_t >[]>, 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<std::size_t VolumeDim, typename... VolumeTags, typename... SliceTags> | |
void | add_slice_to_data (const gsl::not_null< Variables< tmpl::list< VolumeTags... > > * > volume_vars, const Variables< tmpl::list< SliceTags... > > &vars_on_slice, const Index< VolumeDim > &extents, const size_t sliced_dim, const size_t fixed_index) |
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 SpinWeightedType , Requires< is_any_spin_weighted_v< SpinWeightedType > and is_derived_of_vector_impl_v< typename SpinWeightedType::value_type > > = nullptr> | |
void | make_const_view (const gsl::not_null< const SpinWeightedType * > view, const SpinWeightedType &spin_weighted, const size_t offset, const size_t extent) |
Make the input view a const view of the const data spin_weighted , at offset offset and length extent . More... | |
template<typename... Tags> | |
Variables< tmpl::list< Tags... > > | variables_from_tagged_tuple (const tuples::TaggedTuple< Tags... > &tuple) |
Construct a variables from the Tensor s in a TaggedTuple . | |
template<typename VectorType , Requires< is_derived_of_vector_impl_v< VectorType > > = nullptr> | |
void | make_const_view (const gsl::not_null< const VectorType * > view, const VectorType &vector, const size_t offset, const size_t extent) |
Make the input view a const view of the const data vector , at offset offset and length extent . More... | |
template<size_t Dim> | |
bool | is_isotropic (const Mesh< Dim > &mesh) |
Returns true if the mesh is isotropic, false otherwise. More... | |
template<typename R , typename T , typename ValueType > | |
std::remove_const_t< R > | make_with_value (const T &input, const ValueType &value) |
Given an object of type T , create an object of type R whose elements are initialized to value . More... | |
template<typename T , typename U > | |
void | set_number_of_grid_points (const gsl::not_null< T * > result, const U &pattern) |
Change the number of grid points in an object. More... | |
Variables | |
constexpr size_t | default_vector_impl_static_size = 0 |
Default static size for vector impl. | |
template<typename DataBoxType , typename ComputeTagsList , typename... Args, typename F > | |
auto | mutate_apply (F &&f, const gsl::not_null< ObservationBox< ComputeTagsList, DataBoxType > * > observation_box, Args &&... args) |
Apply the function object f using its nested return_tags and argument_tags list of tags. Modifications are made to the underlying DataBox. | |
template<typename ReturnTags , typename ArgumentTags , typename DataBoxType , typename ComputeTagsList , typename... Args, typename F > | |
auto | mutate_apply (F &&f, const gsl::not_null< ObservationBox< ComputeTagsList, DataBoxType > * > observation_box, Args &&... args) |
Apply the function object f using its nested return_tags and argument_tags list of tags. Modifications are made to the underlying DataBox. | |
template<typename VectorType , typename... Structure> | |
void | extract_point (const gsl::not_null< Tensor< typename VectorType::value_type, Structure... > * > destination, const Tensor< VectorType, Structure... > &source, const size_t index) |
Copy a given index of each component of a Tensor<DataVector> or Variables<DataVector> into a Tensor<double> , single point Tensor<DataVector> , or single-point Variables<DataVector> . Also works with ComplexDataVector . More... | |
template<typename VectorType , typename... Structure> | |
Tensor< typename VectorType::value_type, Structure... > | extract_point (const Tensor< VectorType, Structure... > &tensor, const size_t index) |
Copy a given index of each component of a Tensor<DataVector> or Variables<DataVector> into a Tensor<double> , single point Tensor<DataVector> , or single-point Variables<DataVector> . Also works with ComplexDataVector . More... | |
template<typename VectorType , typename... Structure> | |
void | extract_point (const gsl::not_null< Tensor< VectorType, Structure... > * > destination, const Tensor< VectorType, Structure... > &source, const size_t index) |
Copy a given index of each component of a Tensor<DataVector> or Variables<DataVector> into a Tensor<double> , single point Tensor<DataVector> , or single-point Variables<DataVector> . Also works with ComplexDataVector . More... | |
template<typename... Tags> | |
void | extract_point (const gsl::not_null< Variables< tmpl::list< Tags... > > * > result, const Variables< tmpl::list< Tags... > > &variables, const size_t index) |
Copy a given index of each component of a Tensor<DataVector> or Variables<DataVector> into a Tensor<double> , single point Tensor<DataVector> , or single-point Variables<DataVector> . Also works with ComplexDataVector . More... | |
template<typename... Tags> | |
Variables< tmpl::list< Tags... > > | extract_point (const Variables< tmpl::list< Tags... > > &variables, const size_t index) |
Copy a given index of each component of a Tensor<DataVector> or Variables<DataVector> into a Tensor<double> , single point Tensor<DataVector> , or single-point Variables<DataVector> . Also works with ComplexDataVector . More... | |
template<typename VectorType , typename... Structure> | |
void | overwrite_point (const gsl::not_null< Tensor< VectorType, Structure... > * > destination, const Tensor< typename VectorType::value_type, Structure... > &source, const size_t index) |
Copy a Tensor<double> , single point Tensor<DataVector> , or single-point Variables<DataVector> into the given index of each component of a Tensor<DataVector> or Variables<DataVector> . More... | |
template<typename VectorType , typename... Structure> | |
void | overwrite_point (const gsl::not_null< Tensor< VectorType, Structure... > * > destination, const Tensor< VectorType, Structure... > &source, const size_t index) |
Copy a Tensor<double> , single point Tensor<DataVector> , or single-point Variables<DataVector> into the given index of each component of a Tensor<DataVector> or Variables<DataVector> . More... | |
template<typename... Tags> | |
void | overwrite_point (const gsl::not_null< Variables< tmpl::list< Tags... > > * > destination, const Variables< tmpl::list< Tags... > > &source, const size_t index) |
Copy a Tensor<double> , single point Tensor<DataVector> , or single-point Variables<DataVector> into the given index of each component of a Tensor<DataVector> or Variables<DataVector> . More... | |
MathWrapper< double > | make_math_wrapper (const gsl::not_null< double * > data) |
A fundamental overload of the MathWrapper construction functions. More... | |
MathWrapper< const double > | make_math_wrapper (const double &data) |
A fundamental overload of the MathWrapper construction functions. More... | |
MathWrapper< std::complex< double > > | make_math_wrapper (const gsl::not_null< std::complex< double > * > data) |
A fundamental overload of the MathWrapper construction functions. More... | |
MathWrapper< const std::complex< double > > | make_math_wrapper (const std::complex< double > &data) |
A fundamental overload of the MathWrapper construction functions. More... | |
MathWrapper< DataVector > | make_math_wrapper (const gsl::not_null< DataVector * > data) |
A fundamental overload of the MathWrapper construction functions. More... | |
MathWrapper< const DataVector > | make_math_wrapper (const DataVector &data) |
A fundamental overload of the MathWrapper construction functions. More... | |
MathWrapper< ComplexDataVector > | make_math_wrapper (const gsl::not_null< ComplexDataVector * > data) |
A fundamental overload of the MathWrapper construction functions. More... | |
MathWrapper< const ComplexDataVector > | make_math_wrapper (const ComplexDataVector &data) |
A fundamental overload of the MathWrapper construction functions. 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) |
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) |
Slices volume Tensor s into a Variables 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) |
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) |
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 Tag , typename... TagsOrTagsList, typename... Ts, template< class... > class U, Requires<(not tt::is_a_v< gsl::not_null, U< TagsOrTagsList... > >) and not(... and tt::is_a_v< gsl::not_null, std::decay_t< Ts > >)> = nullptr> | |
const Tag::type & | get (const U< TagsOrTagsList... > &first_vars, const Ts &... vars) |
Retrieves a desired tag from data structures containing tags. More... | |
template<typename Tag , typename... TagsOrTagsList, typename... Ts, template< class... > class U> | |
gsl::not_null< typename Tag::type * > | get (const gsl::not_null< U< TagsOrTagsList... > * > first_vars, const gsl::not_null< Ts >... vars) |
Retrieves a desired tag from data structures containing tags. More... | |
template<std::size_t VolumeDim, typename VectorType , typename... Structure> | |
void | data_on_slice (const gsl::not_null< Tensor< VectorType, Structure... > * > interface_tensor, const Tensor< VectorType, Structure... > &volume_tensor, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index) |
Slices the data within volume_tensor 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 VectorType , typename... Structure> | |
Tensor< VectorType, Structure... > | data_on_slice (const Tensor< VectorType, Structure... > &volume_tensor, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index) |
Slices the data within volume_tensor 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 VectorType , typename... Structure> | |
void | data_on_slice (const gsl::not_null< std::optional< Tensor< VectorType, Structure... > > * > interface_tensor, const std::optional< Tensor< VectorType, Structure... > > &volume_tensor, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index) |
Slices the data within volume_tensor 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 VectorType , typename... Structure> | |
std::optional< Tensor< VectorType, Structure... > > | data_on_slice (const std::optional< Tensor< VectorType, Structure... > > &volume_tensor, const Index< VolumeDim > &element_extents, const size_t sliced_dim, const size_t fixed_index) |
Slices the data within volume_tensor 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 Tag , typename TagList > | |
constexpr Tag::type & | get (Variables< TagList > &v) |
Return Tag::type pointing into the contiguous array. More... | |
template<typename Tag , typename TagList > | |
constexpr const Tag::type & | get (const Variables< TagList > &v) |
Return Tag::type pointing into the contiguous array. More... | |
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, | |||
RESULT_TYPE | |||
) |
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 ) |
RESULT_TYPE | The type which should be used as the 'return' type for the binary operation |
#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 MATH_WRAPPER_TYPES double, std::complex<double>, DataVector, ComplexDataVector |
A comma-separated list of valid template arguments to MathWrapper. Useful for explicit instantiations.
#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 ) |
|
strong |
Which floating point type to use.
An example use-case is for specifying in an input file to what precision data is written to disk, since most simulations will not have full double precision accuracy on volume data and we don't need all digits to visualize the data.
void add_slice_to_data | ( | const gsl::not_null< Variables< tmpl::list< VolumeTags... > > * > | volume_vars, |
const Variables< tmpl::list< SliceTags... > > & | vars_on_slice, | ||
const Index< VolumeDim > & | extents, | ||
const size_t | sliced_dim, | ||
const size_t | fixed_index | ||
) |
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
.
void data_on_slice | ( | const gsl::not_null< std::optional< Tensor< VectorType, Structure... > > * > | interface_tensor, |
const std::optional< Tensor< VectorType, Structure... > > & | volume_tensor, | ||
const Index< VolumeDim > & | element_extents, | ||
const size_t | sliced_dim, | ||
const size_t | fixed_index | ||
) |
Slices the data within volume_tensor
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 Tensor class sliced to a hypersurface.
void data_on_slice | ( | const gsl::not_null< Tensor< VectorType, Structure... > * > | interface_tensor, |
const Tensor< VectorType, Structure... > & | volume_tensor, | ||
const Index< VolumeDim > & | element_extents, | ||
const size_t | sliced_dim, | ||
const size_t | fixed_index | ||
) |
Slices the data within volume_tensor
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 Tensor class sliced to a hypersurface.
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 | ||
) |
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.
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 | ||
) |
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
.
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 | ||
) |
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
.
std::optional< Tensor< VectorType, Structure... > > data_on_slice | ( | const std::optional< Tensor< VectorType, Structure... > > & | volume_tensor, |
const Index< VolumeDim > & | element_extents, | ||
const size_t | sliced_dim, | ||
const size_t | fixed_index | ||
) |
Slices the data within volume_tensor
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 Tensor class sliced to a hypersurface.
Tensor< VectorType, Structure... > data_on_slice | ( | const Tensor< VectorType, Structure... > & | volume_tensor, |
const Index< VolumeDim > & | element_extents, | ||
const size_t | sliced_dim, | ||
const size_t | fixed_index | ||
) |
Slices the data within volume_tensor
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 Tensor class sliced to a hypersurface.
Variables< TagsList > data_on_slice | ( | const Variables< TagsList > & | vars, |
const Index< VolumeDim > & | element_extents, | ||
const size_t | sliced_dim, | ||
const size_t | fixed_index | ||
) |
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.
void extract_point | ( | const gsl::not_null< Tensor< typename VectorType::value_type, Structure... > * > | destination, |
const Tensor< VectorType, Structure... > & | source, | ||
const size_t | index | ||
) |
Copy a given index of each component of a Tensor<DataVector>
or Variables<DataVector>
into a Tensor<double>
, single point Tensor<DataVector>
, or single-point Variables<DataVector>
. Also works with ComplexDataVector
.
Tensor<DataVector>
. This is both for the practical reason that it would be ambiguous with the Tensor<double>
overload and because allocating multiple DataVector
s for the return type would usually be very inefficient.void extract_point | ( | const gsl::not_null< Tensor< VectorType, Structure... > * > | destination, |
const Tensor< VectorType, Structure... > & | source, | ||
const size_t | index | ||
) |
Copy a given index of each component of a Tensor<DataVector>
or Variables<DataVector>
into a Tensor<double>
, single point Tensor<DataVector>
, or single-point Variables<DataVector>
. Also works with ComplexDataVector
.
Tensor<DataVector>
. This is both for the practical reason that it would be ambiguous with the Tensor<double>
overload and because allocating multiple DataVector
s for the return type would usually be very inefficient.void extract_point | ( | const gsl::not_null< Variables< tmpl::list< Tags... > > * > | result, |
const Variables< tmpl::list< Tags... > > & | variables, | ||
const size_t | index | ||
) |
Copy a given index of each component of a Tensor<DataVector>
or Variables<DataVector>
into a Tensor<double>
, single point Tensor<DataVector>
, or single-point Variables<DataVector>
. Also works with ComplexDataVector
.
Tensor<DataVector>
. This is both for the practical reason that it would be ambiguous with the Tensor<double>
overload and because allocating multiple DataVector
s for the return type would usually be very inefficient.Tensor< typename VectorType::value_type, Structure... > extract_point | ( | const Tensor< VectorType, Structure... > & | tensor, |
const size_t | index | ||
) |
Copy a given index of each component of a Tensor<DataVector>
or Variables<DataVector>
into a Tensor<double>
, single point Tensor<DataVector>
, or single-point Variables<DataVector>
. Also works with ComplexDataVector
.
Tensor<DataVector>
. This is both for the practical reason that it would be ambiguous with the Tensor<double>
overload and because allocating multiple DataVector
s for the return type would usually be very inefficient.Variables< tmpl::list< Tags... > > extract_point | ( | const Variables< tmpl::list< Tags... > > & | variables, |
const size_t | index | ||
) |
Copy a given index of each component of a Tensor<DataVector>
or Variables<DataVector>
into a Tensor<double>
, single point Tensor<DataVector>
, or single-point Variables<DataVector>
. Also works with ComplexDataVector
.
Tensor<DataVector>
. This is both for the practical reason that it would be ambiguous with the Tensor<double>
overload and because allocating multiple DataVector
s for the return type would usually be very inefficient.gsl::not_null< typename Tag::type * > get | ( | const gsl::not_null< U< TagsOrTagsList... > * > | first_vars, |
const gsl::not_null< Ts >... | vars | ||
) |
Retrieves a desired tag from data structures containing tags.
Given multiple containers retrieve a desired tag from the first container in which it is found. The containers are searched in the order in which they are supplied (i.e. first_vars
is checked before vars
). An error will be emitted if the tag cannot be found in any container.
const Tag::type & get | ( | const U< TagsOrTagsList... > & | first_vars, |
const Ts &... | vars | ||
) |
Retrieves a desired tag from data structures containing tags.
Given multiple containers retrieve a desired tag from the first container in which it is found. The containers are searched in the order in which they are supplied (i.e. first_vars
is checked before vars
). An error will be emitted if the tag cannot be found in any container.
|
constexpr |
Return Tag::type pointing into the contiguous array.
Tag | the variable to return |
|
constexpr |
Return Tag::type pointing into the contiguous array.
Tag | the variable to return |
bool is_isotropic | ( | const Mesh< Dim > & | mesh | ) |
Returns true
if the mesh is isotropic, false
otherwise.
If Dim
is zero, then true
is always returned.
void make_const_view | ( | const gsl::not_null< const SpinWeightedType * > | view, |
const SpinWeightedType & | spin_weighted, | ||
const size_t | offset, | ||
const size_t | extent | ||
) |
Make the input view
a const
view of the const data spin_weighted
, at offset offset
and length extent
.
view
. The reason view
is taken by const pointer is to try to insist that the object to be a const
view is actually const. Of course, there are ways of subverting this intended functionality and editing the data pointed into by view
after this function is called; doing so is highly discouraged and results in undefined behavior. void make_const_view | ( | const gsl::not_null< const VectorType * > | view, |
const VectorType & | vector, | ||
const size_t | offset, | ||
const size_t | extent | ||
) |
Make the input view
a const
view of the const data vector
, at offset offset
and length extent
.
view
. The reason view
is taken by const pointer is to try to insist that the object to be a const
view is actually const. Of course, there are ways of subverting this intended functionality and editing the data pointed into by view
after this function is called; doing so is highly discouraged and results in undefined behavior.
|
inline |
A fundamental overload of the MathWrapper construction functions.
Additional overloads can be implemented in terms of the fundamental overloads.
|
inline |
A fundamental overload of the MathWrapper construction functions.
Additional overloads can be implemented in terms of the fundamental overloads.
|
inline |
A fundamental overload of the MathWrapper construction functions.
Additional overloads can be implemented in terms of the fundamental overloads.
|
inline |
A fundamental overload of the MathWrapper construction functions.
Additional overloads can be implemented in terms of the fundamental overloads.
|
inline |
A fundamental overload of the MathWrapper construction functions.
Additional overloads can be implemented in terms of the fundamental overloads.
|
inline |
A fundamental overload of the MathWrapper construction functions.
Additional overloads can be implemented in terms of the fundamental overloads.
|
inline |
A fundamental overload of the MathWrapper construction functions.
Additional overloads can be implemented in terms of the fundamental overloads.
|
inline |
A fundamental overload of the MathWrapper construction functions.
Additional overloads can be implemented in terms of the fundamental overloads.
std::remove_const_t< R > make_with_value | ( | const T & | input, |
const ValueType & | value | ||
) |
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 most containers, this will be double . |
void overwrite_point | ( | const gsl::not_null< Tensor< VectorType, Structure... > * > | destination, |
const Tensor< typename VectorType::value_type, Structure... > & | source, | ||
const size_t | index | ||
) |
Copy a Tensor<double>
, single point Tensor<DataVector>
, or single-point Variables<DataVector>
into the given index of each component of a Tensor<DataVector>
or Variables<DataVector>
.
void overwrite_point | ( | const gsl::not_null< Tensor< VectorType, Structure... > * > | destination, |
const Tensor< VectorType, Structure... > & | source, | ||
const size_t | index | ||
) |
Copy a Tensor<double>
, single point Tensor<DataVector>
, or single-point Variables<DataVector>
into the given index of each component of a Tensor<DataVector>
or Variables<DataVector>
.
void overwrite_point | ( | const gsl::not_null< Variables< tmpl::list< Tags... > > * > | destination, |
const Variables< tmpl::list< Tags... > > & | source, | ||
const size_t | index | ||
) |
Copy a Tensor<double>
, single point Tensor<DataVector>
, or single-point Variables<DataVector>
into the given index of each component of a Tensor<DataVector>
or Variables<DataVector>
.
void set_number_of_grid_points | ( | const gsl::not_null< T * > | result, |
const U & | pattern | ||
) |
Change the number of grid points in an object.
Change the number of points stored in result
to a given value or to match another object. If pattern
is a size_t
it will be used as the number of points, otherwise it will be interpreted as data on a collection of grid points.
auto volume_and_slice_indices | ( | const Index< VolumeDim > & | extents | ) | -> std::pair< std::unique_ptr< std::pair< size_t, size_t >[]>, 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.
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.