9 #include "DataStructures/DataVector.hpp" 22 template <
typename DataType,
typename Index>
24 const Tensor<DataType,
Symmetry<1>, index_list<Index>>& vector) noexcept {
36 template <
typename DataType,
typename Index>
38 const Tensor<DataType,
Symmetry<1>, index_list<Index>>& vector,
52 template <
typename Tag>
55 return "Magnitude(" + Tag::name() +
")";
66 template <
typename Tag>
71 using argument_tags = tmpl::list<Tag>;
79 template <
typename Tag,
typename MetricTag>
84 using argument_tags = tmpl::list<Tag, MetricTag>;
92 template <
typename Tag>
95 return "Normalized(" + Tag::name() +
")";
97 static constexpr
auto function(
101 auto vector = vector_in;
102 for (
size_t d = 0; d < vector.index_dim(0); ++d) {
107 using argument_tags = tmpl::list<Tag, Magnitude<Tag>>;
Marks a DataBoxTag as being a compute item that executes a function.
Definition: DataBoxTag.hpp:155
Defines functions euclidean dot_product and dot_product with a metric.
Tags for the DataBox inherit from this type.
Definition: DataBoxTag.hpp:65
Scalar< DataType > magnitude(const Tensor< DataType, Symmetry< 1 >, index_list< Index >> &vector) noexcept
Compute the Euclidean magnitude of a rank-1 tensor.
Definition: Magnitude.hpp:23
typename detail::SymmetryImpl< std::make_index_sequence< sizeof...(T)>, tmpl::integral_list< std::int32_t, T... > >::type Symmetry
Computes the canonical symmetry from the integers T
Definition: Symmetry.hpp:81
Defines classes for Tensor.
Tensor_detail::TensorIndexType< Index::index_type==IndexType::Spatial ? Index::value :Index::value - 1, Index::ul==UpLo::Up ? UpLo::Lo :UpLo::Up, typename Index::Frame, Index::index_type > change_index_up_lo
Change the TensorIndexType to be covariant if it's contravariant and vice-versa.
Definition: IndexType.hpp:233
Wraps the template metaprogramming library used (brigand)
typename DataBox_detail::item_type_impl< TagList, Tag >::type item_type
Get the type that is returned by the Tag. If it is a base tag then a TagList must be passed as a seco...
Definition: DataBoxTag.hpp:410
Marks an item as being a prefix to another tag.
Definition: DataBoxTag.hpp:112
void dot_product(const gsl::not_null< Scalar< DataType > *> dot_product, const Tensor< DataType, Symmetry< 1 >, index_list< Index >> &vector_a, const Tensor< DataType, Symmetry< 1 >, index_list< Index >> &vector_b) noexcept
Compute the Euclidean dot product of two vectors or one forms.
Definition: DotProduct.hpp:24
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21