DataVector.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <functional> // for std::reference_wrapper
8 
9 #include "DataStructures/VectorImpl.hpp"
13 #include "Utilities/Requires.hpp"
14 
15 // IWYU pragma: no_include <blaze/math/expressions/DVecMapExpr.h>
16 // IWYU pragma: no_include <blaze/math/typetraits/IsVector.h>
17 // IWYU pragma: no_forward_declare ConstantExpressions_detail::pow
18 
19 /*!
20  * \ingroup DataStructuresGroup
21  * \brief Stores a collection of function values.
22  *
23  * \details Use DataVector to represent function values on the computational
24  * domain. Note that interpreting the data also requires knowledge of the points
25  * that these function values correspond to.
26  *
27  * A DataVector holds an array of contiguous data. The DataVector can be owning,
28  * meaning the array is deleted when the DataVector goes out of scope, or
29  * non-owning, meaning it just has a pointer to an array.
30  *
31  * Refer to the \ref DataStructuresGroup documentation for a list of other
32  * available types. In particular, to represent a generic vector that supports
33  * common vector and matrix operations and whose meaning may not be of function
34  * values at points, use DenseVector instead.
35  *
36  * DataVectors support a variety of mathematical operations that are applicable
37  * to nodal coefficients. In addition to common arithmetic operations such as
38  * elementwise addition, subtraction, multiplication and division, the
39  * elementwise operations on blaze vectors of doubles are supported. See
40  * [blaze-wiki/Vector_Operations]
41  * (https://bitbucket.org/blaze-lib/blaze/wiki/Vector%20Operations).
42  *
43  * In addition, the Heaviside step function `step_function` is supported for
44  * DataVectors.
45  */
46 class DataVector : public VectorImpl<double, DataVector> {
47  public:
50 
52 };
53 
54 // Specialize the Blaze type traits to correctly handle DataVector
55 namespace blaze {
58 } // namespace blaze
59 
60 SPECTRE_ALWAYS_INLINE decltype(auto) fabs(const DataVector& t) noexcept {
61  return abs(~t);
62 }
63 
65 
Base class template for various DataVector and related types.
Definition: VectorImpl.hpp:109
Defines class PointerVector.
Defines the type alias Requires.
Definition: ComplexDataVector.hpp:56
#define SPECTRE_ALWAYS_INLINE
Always inline a function. Only use this if you benchmarked the code.
Definition: ForceInline.hpp:20
#define MAKE_WITH_VALUE_IMPL_DEFINITION_FOR(VECTOR_TYPE)
Defines the MakeWithValueImpl apply specialization.
Definition: VectorImpl.hpp:552
#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) ac...
Definition: VectorImpl.hpp:486
Define simple functions for constant expressions.
Defines macro to always inline a function.
Stores a collection of function values.
Definition: DataVector.hpp:46
#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.
Definition: VectorImpl.hpp:504
#define VECTOR_BLAZE_TRAIT_SPECIALIZE_ARITHMETIC_TRAITS(VECTOR_TYPE)
Instructs Blaze to provide the appropriate vector result type of arithmetic operations for VECTOR_TYP...
Definition: VectorImpl.hpp:450
#define MAKE_MATH_ASSIGN_EXPRESSION_ARITHMETIC(VECTOR_TYPE)
Defines MAKE_MATH_ASSIGN_EXPRESSION_POINTERVECTOR with all assignment arithmetic operations.
Definition: VectorImpl.hpp:535