|
SpECTRE
2021.08.02
|
Namespaces | |
| namespace | Frame |
| Indicates the Frame that a TensorIndexType is in. | |
| namespace | TensorMetafunctions |
| Contains all metafunctions related to Tensor manipulations. | |
| namespace | tnsr |
| Type aliases to construct common Tensors. | |
Classes | |
| struct | Frame::FrameIsPhysical |
| Marks a Frame as being "physical" in the sense that it is meaningful to evaluate an analytic solution in that frame. More... | |
| struct | tt::is_tensor_index_type< T > |
| Inherits from std::true_type if T is a TensorIndexType. More... | |
| class | Tensor< X, Symm, IndexList< Indices... > > |
| Represents an object with multiple components. More... | |
Typedefs | |
| template<typename CheckFrame > | |
| using | Frame::is_frame_physical = std::integral_constant< bool, std::is_base_of< FrameIsPhysical, CheckFrame >::value > |
| Returns std::true_type if the frame is "physical" in the sense that it is meaningful to evaluate an analytic solution in that frame. More... | |
| template<size_t SpatialDim, UpLo Ul, typename Fr > | |
| using | SpatialIndex = Tensor_detail::TensorIndexType< SpatialDim, Ul, Fr, IndexType::Spatial > |
| A SpatialIndex holds information about the number of spatial dimensions, whether the index is covariant or contravariant (UpLo), and the Frame the index is in. More... | |
| template<size_t SpatialDim, UpLo Ul, typename Fr > | |
| using | SpacetimeIndex = Tensor_detail::TensorIndexType< SpatialDim, Ul, Fr, IndexType::Spacetime > |
| A SpacetimeIndex holds information about the number of spatial dimensions, whether the index is covariant or contravariant (UpLo), and the Frame the index is in. More... | |
| template<typename Index > | |
| using | change_index_up_lo = 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 the TensorIndexType to be covariant if it's contravariant and vice-versa. More... | |
| template<typename Index > | |
| using | change_index_type = Tensor_detail::TensorIndexType< Index::index_type==IndexType::Spatial ? Index::dim :Index::dim - 1, Index::ul, typename Index::Frame, Index::index_type==IndexType::Spatial ? IndexType::Spacetime :IndexType::Spatial > |
| Change the TensorIndexType to be spacetime if it's spatial and vice versa. More... | |
| template<typename Symm , typename... IndexPack> | |
| using | TensorMetafunctions::check_index_symmetry = typename detail::check_index_symmetry_impl< tmpl::size< Symm >::value==0 or tmpl::size< Symm >::value==1 ? 0 :2 >::template f< Symm, tmpl::map<>, IndexPack... > |
| Check that each of symmetric indices is in the same frame and have the same dimensionality. | |
| template<typename Tensor , std::size_t VolumeDim, UpLo Ul, typename Fr = Frame::Grid> | |
| using | TensorMetafunctions::prepend_spatial_index = ::Tensor< typename Tensor::type, tmpl::push_front< typename Tensor::symmetry, tmpl::int32_t< 1+tmpl::fold< typename Tensor::symmetry, tmpl::int32_t< 0 >, tmpl::max< tmpl::_state, tmpl::_element > >::value > >, tmpl::push_front< typename Tensor::index_list, SpatialIndex< VolumeDim, Ul, Fr > > > |
| Add a spatial index to the front of a Tensor. More... | |
| template<typename Tensor , std::size_t VolumeDim, UpLo Ul, typename Fr = Frame::Grid> | |
| using | TensorMetafunctions::prepend_spacetime_index = ::Tensor< typename Tensor::type, tmpl::push_front< typename Tensor::symmetry, tmpl::int32_t< 1+tmpl::fold< typename Tensor::symmetry, tmpl::int32_t< 0 >, tmpl::max< tmpl::_state, tmpl::_element > >::value > >, tmpl::push_front< typename Tensor::index_list, SpacetimeIndex< VolumeDim, Ul, Fr > > > |
| Add a spacetime index to the front of a Tensor. More... | |
| template<typename Tensor > | |
| using | TensorMetafunctions::remove_first_index = ::Tensor< typename Tensor::type, tmpl::pop_front< typename Tensor::symmetry >, tmpl::pop_front< typename Tensor::index_list > > |
| remove the first index of a tensor More... | |
| template<typename NewType , typename Tensor > | |
| using | TensorMetafunctions::swap_type = ::Tensor< NewType, typename Tensor::symmetry, typename Tensor::index_list > |
| Swap the data type of a tensor for a new type. More... | |
| template<typename Tensor , typename Frame > | |
| using | TensorMetafunctions::any_index_in_frame = tmpl::any< typename Tensor::index_list, tmpl::bind< detail::frame_is_the_same, tmpl::_1, Frame > > |
| Return tmpl::true_type if any indices of the Tensor are in the frame Frame. | |
| template<std::int32_t... T> | |
| using | Symmetry = typename detail::SymmetryImpl< std::make_index_sequence< sizeof...(T)>, tmpl::integral_list< std::int32_t, T... > >::type |
Computes the canonical symmetry from the integers T More... | |
| template<typename T > | |
| using | Scalar = Tensor< T, Symmetry<>, index_list<> > |
| Scalar type. | |
Enumerations | |
| enum class | UpLo { UpLo::Up , UpLo::Lo } |
| Whether a TensorIndexType is covariant or contravariant. More... | |
| enum class | IndexType : char { IndexType::Spatial , IndexType::Spacetime } |
| Indicates whether the TensorIndexType is Spatial or Spacetime. More... | |
Functions | |
| template<typename DataType , typename Index > | |
| Tensor< DataType, Symmetry< 1 >, index_list< Index > > | cross_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 cross product of two vectors or one forms. More... | |
| template<typename DataType , typename Index > | |
| Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index > > > | cross_product (const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector_a, const Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index > > > &vector_b) noexcept |
| Compute the Euclidean cross product of a vector and a one form. More... | |
| template<typename DataType , typename Index > | |
| Tensor< DataType, Symmetry< 1 >, index_list< Index > > | cross_product (const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector_a, const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector_b, const Tensor< DataType, Symmetry< 1, 1 >, index_list< Index, Index > > &metric_or_inverse_metric, const Scalar< DataType > &metric_determinant) noexcept |
| Compute the cross product of two vectors or one forms. More... | |
| template<typename DataType , typename Index > | |
| Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index > > > | cross_product (const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector_a, const Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index > > > &vector_b, const Tensor< DataType, Symmetry< 1, 1 >, index_list< Index, Index > > &metric_or_inverse_metric, const Scalar< DataType > &metric_determinant) noexcept |
| Compute the cross product of a vector and a one form. More... | |
| template<typename DataType , typename Symm , typename IndexList > | |
| double | l2_norm (const Tensor< DataType, Symm, IndexList > &tensor) noexcept |
| Compute Euclidean \(L^2\)-norm of arbitrary Tensors reduced over an element. More... | |
| template<size_t Dim, typename DataType > | |
| tnsr::Ij< DataType, Dim, Frame::NoFrame > | identity (const DataType &used_for_type) noexcept |
| returns the Identity matrix | |
| template<typename Fr > | |
| std::string | Frame::prefix () noexcept |
| The frame-dependent prefix used when constructing the string returned by the name function of a tag. More... | |
| template<int I, class... Ts> | |
| constexpr size_t | index_dim (const Tensor< Ts... > &) noexcept |
| Get dimensionality of i'th tensor index. More... | |
Variables | |
| template<typename CheckFrame > | |
| constexpr bool | Frame::is_frame_physical_v = is_frame_physical<CheckFrame>::value |
| Returns true if the frame is "physical" in the sense that it is meaningful to evaluate an analytic solution in that frame. More... | |
| template<typename Tensor , typename Frame > | |
| constexpr bool | TensorMetafunctions::any_index_in_frame_v = any_index_in_frame<Tensor, Frame>::value |
| Return true if any indices of the Tensor are in the frame Frame. | |
| template<typename T , typename Symm , typename Index0 , typename Index1 > | |
| void | determinant (const gsl::not_null< Scalar< T > * > det_tensor, const Tensor< T, Symm, index_list< Index0, Index1 > > &tensor) noexcept |
Computes the determinant of a rank-2 Tensor tensor. More... | |
| template<typename T , typename Symm , typename Index0 , typename Index1 > | |
| Scalar< T > | determinant (const Tensor< T, Symm, index_list< Index0, Index1 > > &tensor) noexcept |
Computes the determinant of a rank-2 Tensor tensor. More... | |
| template<typename T , typename Symm , typename Index0 , typename Index1 > | |
| void | determinant_and_inverse (const gsl::not_null< Scalar< T > * > det, const gsl::not_null< Tensor< T, Symm, tmpl::list< change_index_up_lo< Index1 >, change_index_up_lo< Index0 > > > * > inv, const Tensor< T, Symm, tmpl::list< Index0, Index1 > > &tensor) noexcept |
| Computes the determinant and inverse of a rank-2 Tensor. More... | |
| template<typename T , typename Symm , typename Index0 , typename Index1 > | |
| auto | determinant_and_inverse (const Tensor< T, Symm, tmpl::list< Index0, Index1 > > &tensor) noexcept -> std::pair< Scalar< T >, Tensor< T, Symm, tmpl::list< change_index_up_lo< Index1 >, change_index_up_lo< Index0 > > > > |
| Computes the determinant and inverse of a rank-2 Tensor. More... | |
| template<typename DetTag , typename InvTag , typename T , typename Symm , typename Index0 , typename Index1 > | |
| void | determinant_and_inverse (const gsl::not_null< Variables< tmpl::list< DetTag, InvTag > > * > det_and_inv, const Tensor< T, Symm, tmpl::list< Index0, Index1 > > &tensor) noexcept |
| Computes the determinant and inverse of a rank-2 Tensor. More... | |
| template<typename DetTag , typename InvTag , typename T , typename Symm , typename Index0 , typename Index1 > | |
| auto | determinant_and_inverse (const Tensor< T, Symm, tmpl::list< Index0, Index1 > > &tensor) noexcept -> Variables< tmpl::list< DetTag, InvTag > > |
| Computes the determinant and inverse of a rank-2 Tensor. More... | |
| template<typename DataType , typename Index > | |
| 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. More... | |
| template<typename DataType , typename Index > | |
| 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. More... | |
| template<typename DataType , typename Index > | |
| 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< change_index_up_lo< Index > > > &vector_b) noexcept |
| Compute the dot product of a vector and a one form. More... | |
| template<typename DataType , typename Index > | |
| Scalar< DataType > | dot_product (const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector_a, const Tensor< DataType, Symmetry< 1 >, index_list< change_index_up_lo< Index > > > &vector_b) noexcept |
| Compute the dot product of a vector and a one form. More... | |
| template<typename DataType , typename Index > | |
| 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, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index >, change_index_up_lo< Index > > > &metric) noexcept |
| Compute the dot_product of two vectors or one forms. More... | |
| template<typename DataType , typename Index > | |
| Scalar< DataType > | dot_product (const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector_a, const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector_b, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index >, change_index_up_lo< Index > > > &metric) noexcept |
| Compute the dot_product of two vectors or one forms. More... | |
| template<typename DataType , typename Index > | |
| Scalar< DataType > | magnitude (const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector) noexcept |
| Compute the Euclidean magnitude of a rank-1 tensor. More... | |
| template<typename DataType , typename Index > | |
| void | magnitude (const gsl::not_null< Scalar< DataType > * > magnitude, const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector) noexcept |
| Compute the Euclidean magnitude of a rank-1 tensor. More... | |
| template<typename DataType , typename Index > | |
| Scalar< DataType > | magnitude (const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index >, change_index_up_lo< Index > > > &metric) noexcept |
| Compute the magnitude of a rank-1 tensor. More... | |
| template<typename DataType , typename Index > | |
| void | magnitude (const gsl::not_null< Scalar< DataType > * > magnitude, const Tensor< DataType, Symmetry< 1 >, index_list< Index > > &vector, const Tensor< DataType, Symmetry< 1, 1 >, index_list< change_index_up_lo< Index >, change_index_up_lo< Index > > > &metric) noexcept |
| Compute the magnitude of a rank-1 tensor. More... | |
| template<typename DataType > | |
| Scalar< DataType > | sqrt_magnitude (const Scalar< DataType > &input) noexcept |
| Compute square root of the Euclidean magnitude of a rank-0 tensor. More... | |
| template<typename DataType > | |
| void | sqrt_magnitude (const gsl::not_null< Scalar< DataType > * > sqrt_magnitude, const Scalar< DataType > &input) noexcept |
| Compute square root of the Euclidean magnitude of a rank-0 tensor. More... | |
| template<typename DataType , typename Symm , typename IndexList > | |
| Scalar< DataType > | pointwise_l2_norm (const Tensor< DataType, Symm, IndexList > &tensor) noexcept |
| Compute point-wise Euclidean \(L^2\)-norm of arbitrary Tensors. More... | |
| template<typename DataType , typename Symm , typename IndexList > | |
| void | pointwise_l2_norm (const gsl::not_null< Scalar< DataType > * > norm, const Tensor< DataType, Symm, IndexList > &tensor) noexcept |
| Compute point-wise Euclidean \(L^2\)-norm of arbitrary Tensors. More... | |
| template<typename DataType , size_t VolumeDim, typename Frame > | |
| void | orthonormal_oneform (gsl::not_null< tnsr::i< DataType, VolumeDim, Frame > * > orthonormal_form, const tnsr::i< DataType, VolumeDim, Frame > &unit_form, const tnsr::II< DataType, VolumeDim, Frame > &inv_spatial_metric) noexcept |
| Compute a spatial one-form orthonormal to the given unit form. More... | |
| template<typename DataType , size_t VolumeDim, typename Frame > | |
| tnsr::i< DataType, VolumeDim, Frame > | orthonormal_oneform (const tnsr::i< DataType, VolumeDim, Frame > &unit_form, const tnsr::II< DataType, VolumeDim, Frame > &inv_spatial_metric) noexcept |
| Compute a spatial one-form orthonormal to the given unit form. More... | |
| template<typename DataType , typename Frame > | |
| void | orthonormal_oneform (gsl::not_null< tnsr::i< DataType, 3, Frame > * > orthonormal_form, const tnsr::i< DataType, 3, Frame > &first_unit_form, const tnsr::i< DataType, 3, Frame > &second_unit_form, const tnsr::ii< DataType, 3, Frame > &spatial_metric, const Scalar< DataType > &det_spatial_metric) noexcept |
| Compute a spatial one-form orthonormal to two given unit forms. More... | |
| template<typename DataType , typename Frame > | |
| tnsr::i< DataType, 3, Frame > | orthonormal_oneform (const tnsr::i< DataType, 3, Frame > &first_unit_form, const tnsr::i< DataType, 3, Frame > &second_unit_form, const tnsr::ii< DataType, 3, Frame > &spatial_metric, const Scalar< DataType > &det_spatial_metric) noexcept |
| Compute a spatial one-form orthonormal to two given unit forms. More... | |
Tensor use documentation.
| using change_index_type = Tensor_detail::TensorIndexType< Index::index_type == IndexType::Spatial ? Index::dim : Index::dim - 1, Index::ul, typename Index::Frame, Index::index_type == IndexType::Spatial ? IndexType::Spacetime : IndexType::Spatial> |
Change the TensorIndexType to be spacetime if it's spatial and vice versa.
| Index | the TensorIndexType to change |
| using change_index_up_lo = 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 the TensorIndexType to be covariant if it's contravariant and vice-versa.
Here is an example of how to use change_index_up_lo
| Index | the TensorIndexType to change |
| using Frame::is_frame_physical = typedef std::integral_constant<bool, std::is_base_of<FrameIsPhysical, CheckFrame>::value> |
Returns std::true_type if the frame is "physical" in the sense that it is meaningful to evaluate an analytic solution in that frame.
| using TensorMetafunctions::prepend_spacetime_index = typedef ::Tensor< typename Tensor::type, tmpl::push_front< typename Tensor::symmetry, tmpl::int32_t< 1 + tmpl::fold<typename Tensor::symmetry, tmpl::int32_t<0>, tmpl::max<tmpl::_state, tmpl::_element> >::value> >, tmpl::push_front<typename Tensor::index_list, SpacetimeIndex<VolumeDim, Ul, Fr> >> |
Add a spacetime index to the front of a Tensor.
| Tensor | the tensor type to which the new index is prepended |
| VolumeDim | the volume dimension of the tensor index to prepend |
| Fr | the Frame of the tensor index to prepend |
| using TensorMetafunctions::prepend_spatial_index = typedef ::Tensor< typename Tensor::type, tmpl::push_front< typename Tensor::symmetry, tmpl::int32_t< 1 + tmpl::fold<typename Tensor::symmetry, tmpl::int32_t<0>, tmpl::max<tmpl::_state, tmpl::_element> >::value> >, tmpl::push_front<typename Tensor::index_list, SpatialIndex<VolumeDim, Ul, Fr> >> |
Add a spatial index to the front of a Tensor.
| Tensor | the tensor type to which the new index is prepended |
| VolumeDim | the volume dimension of the tensor index to prepend |
| Fr | the Frame of the tensor index to prepend |
| using TensorMetafunctions::remove_first_index = typedef ::Tensor<typename Tensor::type, tmpl::pop_front<typename Tensor::symmetry>, tmpl::pop_front<typename Tensor::index_list> > |
remove the first index of a tensor
| Tensor | the tensor type whose first index is removed |
| using SpacetimeIndex = Tensor_detail::TensorIndexType<SpatialDim, Ul, Fr, IndexType::Spacetime> |
A SpacetimeIndex holds information about the number of spatial dimensions, whether the index is covariant or contravariant (UpLo), and the Frame the index is in.
| SpatialDim | the spatial dimensionality of the TensorIndexType |
| Ul | either UpLo::Up or UpLo::Lo for contra or covariant |
| Fr | the Frame the TensorIndexType is in |
| using SpatialIndex = Tensor_detail::TensorIndexType<SpatialDim, Ul, Fr, IndexType::Spatial> |
A SpatialIndex holds information about the number of spatial dimensions, whether the index is covariant or contravariant (UpLo), and the Frame the index is in.
| SpatialDim | the spatial dimensionality of the TensorIndexType |
| Ul | either UpLo::Up or UpLo::Lo for contra or covariant |
| Fr | the Frame the TensorIndexType is in |
| using TensorMetafunctions::swap_type = typedef ::Tensor<NewType, typename Tensor::symmetry, typename Tensor::index_list> |
Swap the data type of a tensor for a new type.
| NewType | the new data type |
| Tensor | the tensor from which to keep symmetry and index information |
| using Symmetry = typename detail::SymmetryImpl< std::make_index_sequence<sizeof...(T)>, tmpl::integral_list<std::int32_t, T...> >::type |
Computes the canonical symmetry from the integers T
Compute the canonical symmetry typelist given a set of integers, T. The resulting typelist is in ascending order of the integers, from right to left. For example, the result of Symmetry<1, 2, 1, 3> is integral_list<int32_t, 2, 3, 2, 1>. Anti-symmetries are not currently supported.
| T | the integers denoting the symmetry of the Tensor |
|
strong |
Indicates whether the TensorIndexType is Spatial or Spacetime.
| Enumerator | |
|---|---|
| Spatial | The TensorIndexType is purely spatial. |
| Spacetime | The TensorIndexType is a spacetime index. |
|
strong |
Whether a TensorIndexType is covariant or contravariant.
| Enumerator | |
|---|---|
| Up | Contravariant, or Upper index. |
| Lo | Covariant, or Lower index. |
|
noexcept |
Compute the Euclidean cross product of a vector and a one form.
Returns \(A^j B_l \delta^{lk} \epsilon_{ijk}\) for input vector \(A^j\) and input one form \(B_l\) or \(A_j B^l \delta_{lk} \epsilon^{ijk}\) for input one form \(A_j\) and input vector \(B^l\). Note that this function returns a vector if vector_b is a vector and a one form if vector_b is a one form.
|
noexcept |
Compute the cross product of a vector and a one form.
Returns \(\sqrt{g} A^j B_l g^{lk} \epsilon_{ijk}\) for input vector \(A^j\) and input one form \(B_l\). In this case, the argument vector_a should be a vector, vector_b should be a one form, metric_or_inverse_metric should be the inverse spatial metric \(g^{ij}\), and metric_determinant should be the determinant of the spatial metric \(\det(g_{ij})\). Or, returns \(\sqrt{g}^{-1} A_j B^l g_{lk} \epsilon^{ijk}\) for input one form \(A_j\) and input vector \(B^l\). In this case, the argument vector_a should be a one form, vector_b should be a vector, metric_or_inverse_metric should be the spatial metric \(g_{ij}\), and metric_determinant should be the determinant of the spatial metric \(\det(g_{ij})\). Note that this function returns a vector if vector_b is a vector and a one form if vector_b is a one form.
|
noexcept |
Compute the Euclidean cross product of two vectors or one forms.
Returns \(A^j B^k \epsilon_{ljk} \delta^{il}\) for input vectors \(A^j\) and \(B^k\) or \(A_j B_k \epsilon^{ljk} \delta_{il}\) for input one forms \(A_j\) and \(B_k\).
|
noexcept |
Compute the cross product of two vectors or one forms.
Returns \(\sqrt{g} g^{li} A^j B^k \epsilon_{ljk}\), where \(A^j\) and \(B^k\) are vectors and \(g^{li}\) and \(g\) are the inverse and determinant, respectively, of the spatial metric (computed via determinant_and_inverse). In this case, the arguments vector_a and vector_b should be vectors, the argument metric_or_inverse_metric should be the inverse spatial metric \(g^{ij}\), and the argument metric_determinant should be the determinant of the spatial metric \(\det(g_{ij})\). Or, returns \(\sqrt{g}^{-1} g_{li} A_j B_k \epsilon^{ljk}\), where \(A_j\) and \(B_k\) are one forms and \(g_{li}\) and \(g\) are the spatial metric and its determinant. In this case, the arguments vector_a and vector_b should be one forms, the argument metric_or_inverse_metric should be the spatial metric \(g_{ij}\), and the argument metric_determinant should be the determinant of the spatial metric \(\det(g_{ij})\).
|
noexcept |
Computes the determinant of a rank-2 Tensor tensor.
Requires: That tensor be a rank-2 Tensor, with both indices sharing the same dimension and type.
|
noexcept |
Computes the determinant of a rank-2 Tensor tensor.
Requires: That tensor be a rank-2 Tensor, with both indices sharing the same dimension and type.
|
noexcept |
Computes the determinant and inverse of a rank-2 Tensor.
Computes the determinant and inverse together, because this leads to fewer operations compared to computing the determinant independently.
Treats the input rank-2 tensor as a matrix. The first (second) index of the tensor corresponds to the rows (columns) of the matrix. The determinant is a scalar tensor. The inverse is a rank-2 tensor whose indices are reversed and of opposite valence relative to the input tensor, i.e. given \(T_a^b\) returns \((Tinv)_b^a\).
|
noexcept |
Computes the determinant and inverse of a rank-2 Tensor.
Computes the determinant and inverse together, because this leads to fewer operations compared to computing the determinant independently.
| DetTag | the Tag for the determinant of input Tensor. |
| InvTag | the Tag for the inverse of input Tensor. |
|
noexcept |
Computes the determinant and inverse of a rank-2 Tensor.
Computes the determinant and inverse together, because this leads to fewer operations compared to computing the determinant independently.
Treats the input rank-2 tensor as a matrix. The first (second) index of the tensor corresponds to the rows (columns) of the matrix. The determinant is a scalar tensor. The inverse is a rank-2 tensor whose indices are reversed and of opposite valence relative to the input tensor, i.e. given \(T_a^b\) returns \((Tinv)_b^a\).
|
noexcept |
Computes the determinant and inverse of a rank-2 Tensor.
Computes the determinant and inverse together, because this leads to fewer operations compared to computing the determinant independently.
| DetTag | the Tag for the determinant of input Tensor. |
| InvTag | the Tag for the inverse of input Tensor. |
|
noexcept |
Compute the dot product of a vector and a one form.
Returns \(A^a B_b \delta_{a}^b\) for input vector \(A^a\) and input one form \(B_b\) or \(A_a B^b \delta^a_b\) for input one form \(A_a\) and input vector \(B^b\).
|
noexcept |
Compute the Euclidean dot product of two vectors or one forms.
Returns \(A^a B^b \delta_{ab}\) for input vectors \(A^a\) and \(B^b\) or \(A_a B_b \delta^{ab}\) for input one forms \(A_a\) and \(B_b\).
|
noexcept |
Compute the dot_product of two vectors or one forms.
Returns \(g_{ab} A^a B^b\), where \(g_{ab}\) is the metric, \(A^a\) is vector_a, and \(B^b\) is vector_b. Or, returns \(g^{ab} A_a B_b\) when given one forms \(A_a\) and \(B_b\) with an inverse metric \(g^{ab}\).
|
noexcept |
Compute the dot product of a vector and a one form.
Returns \(A^a B_b \delta_{a}^b\) for input vector \(A^a\) and input one form \(B_b\) or \(A_a B^b \delta^a_b\) for input one form \(A_a\) and input vector \(B^b\).
|
noexcept |
Compute the Euclidean dot product of two vectors or one forms.
Returns \(A^a B^b \delta_{ab}\) for input vectors \(A^a\) and \(B^b\) or \(A_a B_b \delta^{ab}\) for input one forms \(A_a\) and \(B_b\).
|
noexcept |
Compute the dot_product of two vectors or one forms.
Returns \(g_{ab} A^a B^b\), where \(g_{ab}\) is the metric, \(A^a\) is vector_a, and \(B^b\) is vector_b. Or, returns \(g^{ab} A_a B_b\) when given one forms \(A_a\) and \(B_b\) with an inverse metric \(g^{ab}\).
|
constexprnoexcept |
Get dimensionality of i'th tensor index.
|
noexcept |
Compute Euclidean \(L^2\)-norm of arbitrary Tensors reduced over an element.
Computes the RMS value of the point-wise Frobenius norm of a given Tensor with arbitrary rank over all grid points in an element. If the Tensor \(A\) has rank \(n\) and dimensionality \(D\), and the element (of order \(N\)) has \(N+1\) points, then its element-reduced Frobenius norm is computed as:
\begin{equation} ||A||_2 = \left(\frac{1}{N+1}\sum^{N}_{p=0} \left(\sum^{D-1}_{i_1=0}\sum^{D-1}_{i_2=0}\cdots \sum^{D-1}_{i_n=0} |A^p_{i_1 i_2 \cdots i_n}|^2 \right) \right)^{1/2}, \end{equation}
where both contra-variant and co-variant indices are shown as lower indices, and \(p\) indexes grid points in the element.
|
noexcept |
Compute the Euclidean magnitude of a rank-1 tensor.
Computes the square root of the sum of the squares of the components of the rank-1 tensor.
|
noexcept |
Compute the magnitude of a rank-1 tensor.
Returns the square root of the input tensor contracted twice with the given metric.
|
noexcept |
Compute the Euclidean magnitude of a rank-1 tensor.
Computes the square root of the sum of the squares of the components of the rank-1 tensor.
|
noexcept |
Compute the magnitude of a rank-1 tensor.
Returns the square root of the input tensor contracted twice with the given metric.
|
noexcept |
Compute a spatial one-form orthonormal to two given unit forms.
Given a unit spatial one-form \(s_i\) and another form \(t_i\) that is orthonormal to \(s_i\), compute a new form \(u_i\) which is orthonormal to both \(s_i\) and \(t_i\), in the sense that \(\gamma^{ij}s_i u_j = \gamma^{ij}t_i u_j = 0\), for the given inverse spatial metric \(\gamma^{ij}\). The normalization of \(u_i\) is such that \(\gamma^{ij}u_iu_j = 1\).
The new form is obtained by taking the covariant cross product of \(s_i\) and \( t_i\), for which the spatial metric as well as its determinant must be provided.
|
noexcept |
Compute a spatial one-form orthonormal to the given unit form.
Given a unit spatial one-form \(s_i\), compute a new form \(t_i\) which is orthonormal to \(s_i\), in the sense that \(\gamma^{ij}s_i t_j = 0\), for the given inverse spatial metric \(\gamma^{ij}\). The normalization of \(t_i\) is such that \(\gamma^{ij}t_it_j = 1\).
The new form is obtained via Gram-Schmidt process, starting from a form whose components are \(t_i = \delta_i^I\), where \(I\) is the index of the component of \(s_i\) with the smallest absolute value.
|
noexcept |
Compute a spatial one-form orthonormal to two given unit forms.
Given a unit spatial one-form \(s_i\) and another form \(t_i\) that is orthonormal to \(s_i\), compute a new form \(u_i\) which is orthonormal to both \(s_i\) and \(t_i\), in the sense that \(\gamma^{ij}s_i u_j = \gamma^{ij}t_i u_j = 0\), for the given inverse spatial metric \(\gamma^{ij}\). The normalization of \(u_i\) is such that \(\gamma^{ij}u_iu_j = 1\).
The new form is obtained by taking the covariant cross product of \(s_i\) and \( t_i\), for which the spatial metric as well as its determinant must be provided.
|
noexcept |
Compute a spatial one-form orthonormal to the given unit form.
Given a unit spatial one-form \(s_i\), compute a new form \(t_i\) which is orthonormal to \(s_i\), in the sense that \(\gamma^{ij}s_i t_j = 0\), for the given inverse spatial metric \(\gamma^{ij}\). The normalization of \(t_i\) is such that \(\gamma^{ij}t_it_j = 1\).
The new form is obtained via Gram-Schmidt process, starting from a form whose components are \(t_i = \delta_i^I\), where \(I\) is the index of the component of \(s_i\) with the smallest absolute value.
|
noexcept |
Compute point-wise Euclidean \(L^2\)-norm of arbitrary Tensors.
At each grid point \(p\) in the element, this function computes the point-wise Frobenius norm of a given Tensor with arbitrary rank. If the Tensor \(A\) has rank \(n\) and dimensionality \(D\), then its Frobenius norm at point \(p\) is computed as:
\begin{equation} ||A||_2(p) = \left(\sum^{D-1}_{i_1=0}\sum^{D-1}_{i_2=0}\cdots \sum^{D-1}_{i_n=0} |A_{i_1 i_2 \cdots i_n}(p)|^2 \right)^{1/2}, \end{equation}
where both contra-variant and co-variant indices are shown as lower indices.
|
noexcept |
Compute point-wise Euclidean \(L^2\)-norm of arbitrary Tensors.
At each grid point \(p\) in the element, this function computes the point-wise Frobenius norm of a given Tensor with arbitrary rank. If the Tensor \(A\) has rank \(n\) and dimensionality \(D\), then its Frobenius norm at point \(p\) is computed as:
\begin{equation} ||A||_2(p) = \left(\sum^{D-1}_{i_1=0}\sum^{D-1}_{i_2=0}\cdots \sum^{D-1}_{i_n=0} |A_{i_1 i_2 \cdots i_n}(p)|^2 \right)^{1/2}, \end{equation}
where both contra-variant and co-variant indices are shown as lower indices.
|
inlinenoexcept |
The frame-dependent prefix used when constructing the string returned by the name function of a tag.
For Frame::Inertial it is the empty string, otherwise, it is the name of the Frame followed by an underscore (as the name will be used in I/O).
|
noexcept |
Compute square root of the Euclidean magnitude of a rank-0 tensor.
Computes the square root of the absolute value of the scalar.
|
noexcept |
Compute square root of the Euclidean magnitude of a rank-0 tensor.
Computes the square root of the absolute value of the scalar.
|
constexpr |
Returns true if the frame is "physical" in the sense that it is meaningful to evaluate an analytic solution in that frame.