diff --git a/src/DataStructures/Tensor/EagerMath/CMakeLists.txt b/src/DataStructures/Tensor/EagerMath/CMakeLists.txt index f81aed134c17..3dc2a3b78f83 100644 --- a/src/DataStructures/Tensor/EagerMath/CMakeLists.txt +++ b/src/DataStructures/Tensor/EagerMath/CMakeLists.txt @@ -5,6 +5,8 @@ spectre_target_sources( ${LIBRARY} PRIVATE OrthonormalOneform.cpp + RaiseOrLowerIndex.cpp + Trace.cpp ) spectre_target_headers( @@ -19,6 +21,8 @@ spectre_target_headers( Norms.hpp OrthonormalOneform.hpp OuterProduct.hpp + RaiseOrLowerIndex.hpp + Trace.hpp ) add_subdirectory(Python) diff --git a/src/PointwiseFunctions/GeneralRelativity/IndexManipulation.cpp b/src/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.cpp similarity index 61% rename from src/PointwiseFunctions/GeneralRelativity/IndexManipulation.cpp rename to src/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.cpp index 624ec6373bfd..fce6e1ffd59e 100644 --- a/src/PointwiseFunctions/GeneralRelativity/IndexManipulation.cpp +++ b/src/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.cpp @@ -1,7 +1,7 @@ // Distributed under the MIT License. // See LICENSE.txt for details. -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include @@ -55,49 +55,6 @@ void raise_or_lower_index( } } -template -void trace_last_indices( - const gsl::not_null, index_list>*> - trace_of_tensor, - const Tensor, - index_list>& tensor, - const Tensor, - index_list, - change_index_up_lo>>& metric) { - constexpr auto dimension_of_trace = Index0::dim; - constexpr auto dimension_of_metric = Index1::dim; - for (size_t i = 0; i < dimension_of_trace; ++i) { - trace_of_tensor->get(i) = tensor.get(i, 0, 0) * get<0, 0>(metric); - for (size_t j = 0; j < dimension_of_metric; ++j) { - if (j != 0) { - trace_of_tensor->get(i) += tensor.get(i, j, j) * metric.get(j, j); - } - for (size_t k = j + 1; k < dimension_of_metric; ++k) { - trace_of_tensor->get(i) += 2.0 * tensor.get(i, j, k) * metric.get(j, k); - } - } - } -} - -template -void trace( - const gsl::not_null*> trace, - const Tensor, index_list>& tensor, - const Tensor, - index_list, - change_index_up_lo>>& metric) { - constexpr auto dimension = Index0::dim; - get(*trace) = get<0, 0>(tensor) * get<0, 0>(metric); - for (size_t i = 0; i < dimension; ++i) { - if (i != 0) { - get(*trace) += tensor.get(i, i) * metric.get(i, i); - } - for (size_t j = i + 1; j < dimension; ++j) { // symmetry - get(*trace) += 2.0 * tensor.get(i, j) * metric.get(i, j); - } - } -} - #define DIM(data) BOOST_PP_TUPLE_ELEM(0, data) #define DTYPE(data) BOOST_PP_TUPLE_ELEM(1, data) #define FRAME(data) BOOST_PP_TUPLE_ELEM(2, data) @@ -123,17 +80,7 @@ void trace( tensor, \ const Tensor, \ index_list, \ - change_index_up_lo>>& metric); \ - template void trace_last_indices( \ - const gsl::not_null< \ - Tensor, index_list>*> \ - result, \ - const Tensor, \ - index_list>& \ - tensor, \ - const Tensor, \ - index_list, \ - change_index_up_lo>>& metric); + change_index_up_lo>>& metric); GENERATE_INSTANTIATIONS(INSTANTIATE, (1, 2, 3), (double, DataVector), (Frame::Grid, Frame::Distorted, Frame::Inertial, @@ -149,23 +96,16 @@ GENERATE_INSTANTIATIONS(INSTANTIATE, (1, 2, 3), (double, DataVector), #undef INDEX1 #undef INSTANTIATE -#define INSTANTIATE2(_, data) \ - template void raise_or_lower_index( \ - const gsl::not_null< \ - Tensor, \ - index_list>>*> \ - trace_of_tensor, \ - const Tensor, index_list>& \ - tensor, \ - const Tensor, \ - index_list, \ - change_index_up_lo>>& metric); \ - template void trace( \ - const gsl::not_null*> trace, \ - const Tensor, \ - index_list>& tensor, \ - const Tensor, \ - index_list, \ +#define INSTANTIATE2(_, data) \ + template void raise_or_lower_index( \ + const gsl::not_null< \ + Tensor, \ + index_list>>*> \ + trace_of_tensor, \ + const Tensor, index_list>& \ + tensor, \ + const Tensor, \ + index_list, \ change_index_up_lo>>& metric); GENERATE_INSTANTIATIONS(INSTANTIATE2, (1, 2, 3), (double, DataVector), diff --git a/src/PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp b/src/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp similarity index 58% rename from src/PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp rename to src/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp index 41acaec8629d..157246c69f8c 100644 --- a/src/PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp +++ b/src/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp @@ -92,67 +92,3 @@ raise_or_lower_index( return result; } /// @} - -/// @{ -/*! - * \ingroup GeneralRelativityGroup - * \brief Computes trace of a rank 3 tensor, which is symmetric in its last two - * indices, tracing the symmetric indices. - * - * \details For example, if \f$ T_{abc} \f$ is a tensor such that \f$T_{abc} = - * T_{acb} \f$ then \f$ T_a = g^{bc}T_{abc} \f$ is computed, where \f$ g^{bc} - * \f$ is the inverse metric. Note that indices \f$a,b,c,...\f$ can represent - * either spatial or spacetime indices, and can have either valence. You may - * have to add a new instantiation of this template if you need a new use case. - */ -template -void trace_last_indices( - gsl::not_null, index_list>*> - trace_of_tensor, - const Tensor, - index_list>& tensor, - const Tensor, - index_list, - change_index_up_lo>>& metric); - -template -Tensor, index_list> trace_last_indices( - const Tensor, - index_list>& tensor, - const Tensor, - index_list, - change_index_up_lo>>& metric) { - auto trace_of_tensor = - make_with_value, index_list>>(metric, - 0.); - trace_last_indices(make_not_null(&trace_of_tensor), tensor, metric); - return trace_of_tensor; -} -/// @} - -/// @{ -/*! - * \ingroup GeneralRelativityGroup - * \brief Computes trace of a rank-2 symmetric tensor. - * \details Computes \f$g^{ab}T_{ab}\f$ or \f$g_{ab}T^{ab}\f$ where \f$(a,b)\f$ - * can be spatial or spacetime indices. - */ -template -void trace( - gsl::not_null*> trace, - const Tensor, index_list>& tensor, - const Tensor, - index_list, - change_index_up_lo>>& metric); - -template -Scalar trace( - const Tensor, index_list>& tensor, - const Tensor, - index_list, - change_index_up_lo>>& metric) { - Scalar trace{}; - ::trace(make_not_null(&trace), tensor, metric); - return trace; -} -/// @} diff --git a/src/DataStructures/Tensor/EagerMath/Trace.cpp b/src/DataStructures/Tensor/EagerMath/Trace.cpp new file mode 100644 index 000000000000..506eb1d45e0a --- /dev/null +++ b/src/DataStructures/Tensor/EagerMath/Trace.cpp @@ -0,0 +1,113 @@ +// Distributed under the MIT License. +// See LICENSE.txt for details. + +#include "DataStructures/Tensor/EagerMath/Trace.hpp" + +#include + +#include "DataStructures/Tensor/Tensor.hpp" +#include "Utilities/GenerateInstantiations.hpp" + +template +void trace_last_indices( + const gsl::not_null, index_list>*> + trace_of_tensor, + const Tensor, + index_list>& tensor, + const Tensor, + index_list, + change_index_up_lo>>& metric) { + constexpr auto dimension_of_trace = Index0::dim; + constexpr auto dimension_of_metric = Index1::dim; + for (size_t i = 0; i < dimension_of_trace; ++i) { + trace_of_tensor->get(i) = tensor.get(i, 0, 0) * get<0, 0>(metric); + for (size_t j = 0; j < dimension_of_metric; ++j) { + if (j != 0) { + trace_of_tensor->get(i) += tensor.get(i, j, j) * metric.get(j, j); + } + for (size_t k = j + 1; k < dimension_of_metric; ++k) { + trace_of_tensor->get(i) += 2.0 * tensor.get(i, j, k) * metric.get(j, k); + } + } + } +} + +template +void trace( + const gsl::not_null*> trace, + const Tensor, index_list>& tensor, + const Tensor, + index_list, + change_index_up_lo>>& metric) { + constexpr auto dimension = Index0::dim; + get(*trace) = get<0, 0>(tensor) * get<0, 0>(metric); + for (size_t i = 0; i < dimension; ++i) { + if (i != 0) { + get(*trace) += tensor.get(i, i) * metric.get(i, i); + } + for (size_t j = i + 1; j < dimension; ++j) { // symmetry + get(*trace) += 2.0 * tensor.get(i, j) * metric.get(i, j); + } + } +} + +#define DIM(data) BOOST_PP_TUPLE_ELEM(0, data) +#define DTYPE(data) BOOST_PP_TUPLE_ELEM(1, data) +#define FRAME(data) BOOST_PP_TUPLE_ELEM(2, data) +#define INDEXTYPE(data) BOOST_PP_TUPLE_ELEM(3, data) +#define UPORLO0(data) BOOST_PP_TUPLE_ELEM(4, data) +#define UPORLO1(data) BOOST_PP_TUPLE_ELEM(5, data) + +// Note: currently only instantiate these functions for the cases +// where Index0 and Index1 have the same spatial dimension, Frame and +// IndexType. The functions above are generic and can handle any of +// them being different, if these cases are needed. +#define INDEX0(data) INDEXTYPE(data) +#define INDEX1(data) INDEXTYPE(data) + +#define INSTANTIATE(_, data) \ + template void trace_last_indices( \ + const gsl::not_null< \ + Tensor, index_list>*> \ + result, \ + const Tensor, \ + index_list>& \ + tensor, \ + const Tensor, \ + index_list, \ + change_index_up_lo>>& metric); + +GENERATE_INSTANTIATIONS(INSTANTIATE, (1, 2, 3), (double, DataVector), + (Frame::Grid, Frame::Distorted, Frame::Inertial, + Frame::Spherical, + Frame::Spherical, + Frame::Spherical), + (SpatialIndex, SpacetimeIndex), (UpLo::Lo, UpLo::Up), + (UpLo::Lo, UpLo::Up)) + +#undef FRAME1 +#undef UPORLO1 +#undef INDEXTYPE1 +#undef INDEX1 +#undef INSTANTIATE + +#define INSTANTIATE2(_, data) \ + template void trace( \ + const gsl::not_null*> trace, \ + const Tensor, \ + index_list>& tensor, \ + const Tensor, \ + index_list, \ + change_index_up_lo>>& metric); + +GENERATE_INSTANTIATIONS(INSTANTIATE2, (1, 2, 3), (double, DataVector), + (Frame::Grid, Frame::Distorted, Frame::Inertial), + (SpatialIndex, SpacetimeIndex), (UpLo::Lo, UpLo::Up)) + +#undef DIM +#undef DTYPE +#undef FRAME0 +#undef UPORLO0 +#undef INDEXTYPE0 +#undef INDEX0 +#undef INSTANTIATE2 diff --git a/src/DataStructures/Tensor/EagerMath/Trace.hpp b/src/DataStructures/Tensor/EagerMath/Trace.hpp new file mode 100644 index 000000000000..ba70d5e594de --- /dev/null +++ b/src/DataStructures/Tensor/EagerMath/Trace.hpp @@ -0,0 +1,72 @@ +// Distributed under the MIT License. +// See LICENSE.txt for details. + +#pragma once + +#include "DataStructures/Tensor/Tensor.hpp" +#include "Utilities/Gsl.hpp" +#include "Utilities/MakeWithValue.hpp" + +/// @{ +/*! + * \ingroup GeneralRelativityGroup + * \brief Computes trace of a rank 3 tensor, which is symmetric in its last two + * indices, tracing the symmetric indices. + * + * \details For example, if \f$ T_{abc} \f$ is a tensor such that \f$T_{abc} = + * T_{acb} \f$ then \f$ T_a = g^{bc}T_{abc} \f$ is computed, where \f$ g^{bc} + * \f$ is the inverse metric. Note that indices \f$a,b,c,...\f$ can represent + * either spatial or spacetime indices, and can have either valence. You may + * have to add a new instantiation of this template if you need a new use case. + */ +template +void trace_last_indices( + gsl::not_null, index_list>*> + trace_of_tensor, + const Tensor, + index_list>& tensor, + const Tensor, + index_list, + change_index_up_lo>>& metric); + +template +Tensor, index_list> trace_last_indices( + const Tensor, + index_list>& tensor, + const Tensor, + index_list, + change_index_up_lo>>& metric) { + auto trace_of_tensor = + make_with_value, index_list>>(metric, + 0.); + trace_last_indices(make_not_null(&trace_of_tensor), tensor, metric); + return trace_of_tensor; +} +/// @} + +/// @{ +/*! + * \ingroup GeneralRelativityGroup + * \brief Computes trace of a rank-2 symmetric tensor. + * \details Computes \f$g^{ab}T_{ab}\f$ or \f$g_{ab}T^{ab}\f$ where \f$(a,b)\f$ + * can be spatial or spacetime indices. + */ +template +void trace( + gsl::not_null*> trace, + const Tensor, index_list>& tensor, + const Tensor, + index_list, + change_index_up_lo>>& metric); + +template +Scalar trace( + const Tensor, index_list>& tensor, + const Tensor, + index_list, + change_index_up_lo>>& metric) { + Scalar trace{}; + ::trace(make_not_null(&trace), tensor, metric); + return trace; +} +/// @} diff --git a/src/Elliptic/Systems/Elasticity/CMakeLists.txt b/src/Elliptic/Systems/Elasticity/CMakeLists.txt index c2aa04645c7b..395c9fbf2ee3 100644 --- a/src/Elliptic/Systems/Elasticity/CMakeLists.txt +++ b/src/Elliptic/Systems/Elasticity/CMakeLists.txt @@ -29,8 +29,6 @@ target_link_libraries( Utilities INTERFACE LinearOperators - PRIVATE - GeneralRelativity ) add_subdirectory(BoundaryConditions) diff --git a/src/Elliptic/Systems/Elasticity/Equations.cpp b/src/Elliptic/Systems/Elasticity/Equations.cpp index 33e8ea3af1b0..2e9ed22bbe76 100644 --- a/src/Elliptic/Systems/Elasticity/Equations.cpp +++ b/src/Elliptic/Systems/Elasticity/Equations.cpp @@ -9,9 +9,9 @@ #include "DataStructures/DataBox/PrefixHelpers.hpp" #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "PointwiseFunctions/Elasticity/ConstitutiveRelations/ConstitutiveRelation.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/TMPL.hpp" diff --git a/src/Elliptic/Systems/Poisson/CMakeLists.txt b/src/Elliptic/Systems/Poisson/CMakeLists.txt index c5ac4510e0a6..ef0d2844539d 100644 --- a/src/Elliptic/Systems/Poisson/CMakeLists.txt +++ b/src/Elliptic/Systems/Poisson/CMakeLists.txt @@ -26,9 +26,9 @@ target_link_libraries( PUBLIC DataStructures ErrorHandling - GeneralRelativity Utilities INTERFACE + GeneralRelativity LinearOperators ) diff --git a/src/Elliptic/Systems/Poisson/Equations.cpp b/src/Elliptic/Systems/Poisson/Equations.cpp index 82dbaf2d6ba3..ceb63105490c 100644 --- a/src/Elliptic/Systems/Poisson/Equations.cpp +++ b/src/Elliptic/Systems/Poisson/Equations.cpp @@ -8,8 +8,8 @@ #include "DataStructures/DataBox/PrefixHelpers.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/MakeWithValue.hpp" diff --git a/src/Elliptic/Systems/Xcts/BoundaryConditions/ApparentHorizon.cpp b/src/Elliptic/Systems/Xcts/BoundaryConditions/ApparentHorizon.cpp index 42083d9e476a..f6bd69cb943d 100644 --- a/src/Elliptic/Systems/Xcts/BoundaryConditions/ApparentHorizon.cpp +++ b/src/Elliptic/Systems/Xcts/BoundaryConditions/ApparentHorizon.cpp @@ -12,13 +12,13 @@ #include "DataStructures/Tags/TempTensor.hpp" #include "DataStructures/TempBuffer.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Elliptic/BoundaryConditions/BoundaryCondition.hpp" #include "Elliptic/Systems/Xcts/Geometry.hpp" #include "NumericalAlgorithms/DiscontinuousGalerkin/NormalDotFlux.hpp" #include "PointwiseFunctions/AnalyticSolutions/Xcts/Factory.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/InitialDataUtilities/AnalyticSolution.hpp" #include "Utilities/CallWithDynamicType.hpp" #include "Utilities/ConstantExpressions.hpp" diff --git a/src/Elliptic/Systems/Xcts/Equations.cpp b/src/Elliptic/Systems/Xcts/Equations.cpp index 671b086b4ce7..8ac4c73b103e 100644 --- a/src/Elliptic/Systems/Xcts/Equations.cpp +++ b/src/Elliptic/Systems/Xcts/Equations.cpp @@ -13,9 +13,9 @@ #include "DataStructures/Tags/TempTensor.hpp" #include "DataStructures/TempBuffer.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Elliptic/Systems/Xcts/Geometry.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/ErrorHandling/Assert.hpp" #include "Utilities/GenerateInstantiations.hpp" diff --git a/src/Evolution/Executables/GeneralizedHarmonic/EvolveGhBinaryBlackHole.hpp b/src/Evolution/Executables/GeneralizedHarmonic/EvolveGhBinaryBlackHole.hpp index c126ef46d954..ce1460f183b8 100644 --- a/src/Evolution/Executables/GeneralizedHarmonic/EvolveGhBinaryBlackHole.hpp +++ b/src/Evolution/Executables/GeneralizedHarmonic/EvolveGhBinaryBlackHole.hpp @@ -19,6 +19,7 @@ #include "ControlSystem/Trigger.hpp" #include "DataStructures/DataBox/PrefixHelpers.hpp" #include "DataStructures/DataBox/Tag.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "Domain/Creators/BinaryCompactObject.hpp" #include "Domain/Creators/CylindricalBinaryCompactObject.hpp" #include "Domain/FunctionsOfTime/FunctionsOfTimeAreReady.hpp" @@ -129,7 +130,6 @@ #include "PointwiseFunctions/GeneralRelativity/DetAndInverseSpatialMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintGammas.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Psi4Real.hpp" #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp" diff --git a/src/Evolution/Executables/GeneralizedHarmonic/GeneralizedHarmonicBase.hpp b/src/Evolution/Executables/GeneralizedHarmonic/GeneralizedHarmonicBase.hpp index 7af0118e94bf..352d6ce860ea 100644 --- a/src/Evolution/Executables/GeneralizedHarmonic/GeneralizedHarmonicBase.hpp +++ b/src/Evolution/Executables/GeneralizedHarmonic/GeneralizedHarmonicBase.hpp @@ -9,6 +9,7 @@ #include "ControlSystem/Actions/LimitTimeStep.hpp" #include "DataStructures/DataBox/PrefixHelpers.hpp" #include "DataStructures/DataBox/Tag.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "Domain/Creators/Factory1D.hpp" #include "Domain/Creators/Factory2D.hpp" #include "Domain/Creators/Factory3D.hpp" @@ -97,7 +98,6 @@ #include "PointwiseFunctions/GeneralRelativity/DetAndInverseSpatialMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintGammas.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Psi4Real.hpp" #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeNormalVector.hpp" diff --git a/src/Evolution/Executables/GrMhd/GhValenciaDivClean/GhValenciaDivCleanBase.hpp b/src/Evolution/Executables/GrMhd/GhValenciaDivClean/GhValenciaDivCleanBase.hpp index 82e1b54bf50c..0dfe029b05f0 100644 --- a/src/Evolution/Executables/GrMhd/GhValenciaDivClean/GhValenciaDivCleanBase.hpp +++ b/src/Evolution/Executables/GrMhd/GhValenciaDivClean/GhValenciaDivCleanBase.hpp @@ -16,6 +16,7 @@ #include "ControlSystem/Trigger.hpp" #include "DataStructures/DataBox/PrefixHelpers.hpp" #include "DataStructures/DataBox/Tag.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/IndexType.hpp" #include "Domain/Creators/BinaryCompactObject.hpp" #include "Domain/Creators/Factory3D.hpp" @@ -197,7 +198,6 @@ #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintGammas.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SecondTimeDerivOfSpacetimeMetric.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp" #include "PointwiseFunctions/GeneralRelativity/Psi4Real.hpp" #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp" diff --git a/src/Evolution/Executables/ScalarTensor/ScalarTensorBase.hpp b/src/Evolution/Executables/ScalarTensor/ScalarTensorBase.hpp index a41efdcf35dc..e31ce9741d85 100644 --- a/src/Evolution/Executables/ScalarTensor/ScalarTensorBase.hpp +++ b/src/Evolution/Executables/ScalarTensor/ScalarTensorBase.hpp @@ -9,6 +9,7 @@ #include "ControlSystem/Actions/LimitTimeStep.hpp" #include "DataStructures/DataBox/PrefixHelpers.hpp" #include "DataStructures/DataBox/Tag.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "Domain/Creators/Factory1D.hpp" #include "Domain/Creators/Factory2D.hpp" #include "Domain/Creators/Factory3D.hpp" @@ -116,7 +117,6 @@ #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/DetAndInverseSpatialMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ConstraintGammas.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Psi4Real.hpp" #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp" diff --git a/src/Evolution/Systems/CurvedScalarWave/CMakeLists.txt b/src/Evolution/Systems/CurvedScalarWave/CMakeLists.txt index 5bc647bff1ab..f29fe6e63e37 100644 --- a/src/Evolution/Systems/CurvedScalarWave/CMakeLists.txt +++ b/src/Evolution/Systems/CurvedScalarWave/CMakeLists.txt @@ -36,9 +36,10 @@ target_link_libraries( DataStructures Domain ErrorHandling - GeneralRelativity Serialization Utilities + INTERFACE + GeneralRelativity ) add_subdirectory(BoundaryConditions) diff --git a/src/Evolution/Systems/CurvedScalarWave/Characteristics.cpp b/src/Evolution/Systems/CurvedScalarWave/Characteristics.cpp index 06d51aab4c32..978f4481c058 100644 --- a/src/Evolution/Systems/CurvedScalarWave/Characteristics.cpp +++ b/src/Evolution/Systems/CurvedScalarWave/Characteristics.cpp @@ -10,8 +10,8 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "Evolution/Systems/CurvedScalarWave/Tags.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/Gsl.hpp" #include "Utilities/MakeWithValue.hpp" diff --git a/src/Evolution/Systems/ForceFree/ElectricCurrentDensity.cpp b/src/Evolution/Systems/ForceFree/ElectricCurrentDensity.cpp index 9c325f533208..295e503ef8c4 100644 --- a/src/Evolution/Systems/ForceFree/ElectricCurrentDensity.cpp +++ b/src/Evolution/Systems/ForceFree/ElectricCurrentDensity.cpp @@ -9,9 +9,9 @@ #include "DataStructures/LeviCivitaIterator.hpp" #include "DataStructures/Tags/TempTensor.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ContainerHelpers.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/Evolution/Systems/ForceFree/Fluxes.cpp b/src/Evolution/Systems/ForceFree/Fluxes.cpp index f9e39ba4f0a7..d7776189fe17 100644 --- a/src/Evolution/Systems/ForceFree/Fluxes.cpp +++ b/src/Evolution/Systems/ForceFree/Fluxes.cpp @@ -8,9 +8,9 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/LeviCivitaIterator.hpp" #include "DataStructures/Tags/TempTensor.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/Gsl.hpp" #include "Utilities/TMPL.hpp" diff --git a/src/Evolution/Systems/ForceFree/Sources.cpp b/src/Evolution/Systems/ForceFree/Sources.cpp index 8fe56335b2c8..317f84eb4e41 100644 --- a/src/Evolution/Systems/ForceFree/Sources.cpp +++ b/src/Evolution/Systems/ForceFree/Sources.cpp @@ -7,10 +7,11 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tags/TempTensor.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Evolution/Systems/ForceFree/ElectricCurrentDensity.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/Evolution/Systems/ForceFree/TimeDerivativeTerms.cpp b/src/Evolution/Systems/ForceFree/TimeDerivativeTerms.cpp index d1d2fba1050a..7dbf11a211df 100644 --- a/src/Evolution/Systems/ForceFree/TimeDerivativeTerms.cpp +++ b/src/Evolution/Systems/ForceFree/TimeDerivativeTerms.cpp @@ -4,13 +4,14 @@ #include #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Evolution/Systems/ForceFree/ElectricCurrentDensity.hpp" #include "Evolution/Systems/ForceFree/Fluxes.hpp" #include "Evolution/Systems/ForceFree/Sources.hpp" #include "Evolution/Systems/ForceFree/TimeDerivativeTerms.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/Gsl.hpp" namespace ForceFree { diff --git a/src/Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Bjorhus.cpp b/src/Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Bjorhus.cpp index e6f3dd99bac6..38b308dfe6a1 100644 --- a/src/Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Bjorhus.cpp +++ b/src/Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/Bjorhus.cpp @@ -7,6 +7,7 @@ #include "DataStructures/TempBuffer.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Variables.hpp" #include "Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/BjorhusImpl.hpp" #include "Evolution/Systems/GeneralizedHarmonic/Characteristics.hpp" @@ -14,7 +15,6 @@ #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" #include "Options/ParseOptions.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/InterfaceNullNormal.hpp" #include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp" diff --git a/src/Evolution/Systems/GeneralizedHarmonic/Characteristics.cpp b/src/Evolution/Systems/GeneralizedHarmonic/Characteristics.cpp index 91aa9713b7b4..53518cd86010 100644 --- a/src/Evolution/Systems/GeneralizedHarmonic/Characteristics.cpp +++ b/src/Evolution/Systems/GeneralizedHarmonic/Characteristics.cpp @@ -10,10 +10,10 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" // IWYU pragma: keep +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" // IWYU pragma: keep #include "Domain/TagsTimeDependent.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/Gsl.hpp" #include "Utilities/MakeWithValue.hpp" diff --git a/src/Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/SetPiAndPhiFromConstraints.cpp b/src/Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/SetPiAndPhiFromConstraints.cpp index e759559cb41c..9abc02af2632 100644 --- a/src/Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/SetPiAndPhiFromConstraints.cpp +++ b/src/Evolution/Systems/GeneralizedHarmonic/GaugeSourceFunctions/SetPiAndPhiFromConstraints.cpp @@ -7,6 +7,7 @@ #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/IndexType.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" @@ -23,7 +24,6 @@ #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpatialDerivOfShift.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/TimeDerivOfSpatialMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/TimeDerivativeOfSpacetimeMetric.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp" #include "PointwiseFunctions/GeneralRelativity/Shift.hpp" diff --git a/src/Evolution/Systems/GeneralizedHarmonic/TimeDerivative.cpp b/src/Evolution/Systems/GeneralizedHarmonic/TimeDerivative.cpp index fd154b06579f..ae9df0768cd3 100644 --- a/src/Evolution/Systems/GeneralizedHarmonic/TimeDerivative.cpp +++ b/src/Evolution/Systems/GeneralizedHarmonic/TimeDerivative.cpp @@ -6,6 +6,8 @@ #include #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Evolution/Systems/GeneralizedHarmonic/ConstraintDamping/Tags.hpp" #include "Evolution/Systems/GeneralizedHarmonic/DuDtTempTags.hpp" @@ -16,7 +18,6 @@ #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivativeOfSpacetimeMetric.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp" #include "PointwiseFunctions/GeneralRelativity/Shift.hpp" diff --git a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/StressEnergy.cpp b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/StressEnergy.cpp index 019929cad4f3..0ec173752ad6 100644 --- a/src/Evolution/Systems/GrMhd/GhValenciaDivClean/StressEnergy.cpp +++ b/src/Evolution/Systems/GrMhd/GhValenciaDivClean/StressEnergy.cpp @@ -6,8 +6,8 @@ #include #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/Hydro/ComovingMagneticField.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Actions/NumericInitialData.hpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Actions/NumericInitialData.hpp index 88aff345a210..d12e7aa360e6 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Actions/NumericInitialData.hpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Actions/NumericInitialData.hpp @@ -9,6 +9,7 @@ #include "DataStructures/DataBox/DataBox.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Domain/Structure/ElementId.hpp" #include "Domain/Tags.hpp" @@ -19,7 +20,6 @@ #include "Parallel/AlgorithmExecution.hpp" #include "Parallel/GlobalCache.hpp" #include "Parallel/Invoke.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp" #include "PointwiseFunctions/Hydro/Tags.hpp" diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryConditions/HydroFreeOutflow.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryConditions/HydroFreeOutflow.cpp index adafd45951f2..40a8321fd362 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryConditions/HydroFreeOutflow.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/BoundaryConditions/HydroFreeOutflow.cpp @@ -14,6 +14,7 @@ #include "DataStructures/Tags/TempTensor.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Expressions/Evaluate.hpp" #include "DataStructures/Tensor/Expressions/TensorExpression.hpp" #include "DataStructures/Tensor/Tensor.hpp" @@ -24,7 +25,6 @@ #include "Evolution/Systems/GrMhd/ValenciaDivClean/FiniteDifference/Reconstructor.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Fluxes.hpp" #include "NumericalAlgorithms/Spectral/Mesh.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/Hydro/LorentzFactor.hpp" #include "PointwiseFunctions/Hydro/Tags.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Characteristics.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Characteristics.cpp index 8aafb257806c..a6a559bdca7c 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Characteristics.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Characteristics.cpp @@ -7,10 +7,10 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Evolution/Systems/RelativisticEuler/Valencia/Characteristics.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" // IWYU pragma: keep #include "PointwiseFunctions/Hydro/Tags.hpp" // IWYU pragma: keep #include "Utilities/ConstantExpressions.hpp" diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/ConservativeFromPrimitive.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/ConservativeFromPrimitive.cpp index 7432784d9e61..60af8967d700 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/ConservativeFromPrimitive.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/ConservativeFromPrimitive.cpp @@ -7,10 +7,10 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" // IWYU pragma: keep -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" // IWYU pragma: keep #include "PointwiseFunctions/Hydro/Tags.hpp" // IWYU pragma: keep #include "Utilities/ConstantExpressions.hpp" diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Fluxes.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Fluxes.cpp index 02033507fe0a..2a4262f5b706 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Fluxes.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Fluxes.cpp @@ -8,10 +8,10 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tags/TempTensor.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" // IWYU pragma: keep -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" // IWYU pragma: keep #include "PointwiseFunctions/Hydro/Tags.hpp" // IWYU pragma: keep #include "PointwiseFunctions/Hydro/TransportVelocity.hpp" diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/PrimitiveFromConservative.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/PrimitiveFromConservative.cpp index b4fd26039a83..31fd70cb0877 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/PrimitiveFromConservative.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/PrimitiveFromConservative.cpp @@ -12,6 +12,7 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tags/TempTensor.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/KastaunEtAl.hpp" @@ -20,9 +21,8 @@ #include "Evolution/Systems/GrMhd/ValenciaDivClean/PalenzuelaEtAl.hpp" // IWYU pragma: keep #include "Evolution/Systems/GrMhd/ValenciaDivClean/PrimitiveRecoveryData.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" // IWYU pragma: keep -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" // IWYU pragma: keep -#include "PointwiseFunctions/Hydro/Tags.hpp" // IWYU pragma: keep +#include "PointwiseFunctions/Hydro/Tags.hpp" // IWYU pragma: keep #include "Utilities/ConstantExpressions.hpp" #include "Utilities/ErrorHandling/Error.hpp" #include "Utilities/GenerateInstantiations.hpp" diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Sources.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Sources.cpp index 31bed370dabf..a7fda42fa0ad 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/Sources.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/Sources.cpp @@ -8,11 +8,12 @@ #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" // IWYU pragma: keep #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" // IWYU pragma: keep #include "PointwiseFunctions/Hydro/Tags.hpp" // IWYU pragma: keep #include "Utilities/ConstantExpressions.hpp" diff --git a/src/Evolution/Systems/GrMhd/ValenciaDivClean/TimeDerivativeTerms.cpp b/src/Evolution/Systems/GrMhd/ValenciaDivClean/TimeDerivativeTerms.cpp index c8763d1b8cfa..6c9ee65baae8 100644 --- a/src/Evolution/Systems/GrMhd/ValenciaDivClean/TimeDerivativeTerms.cpp +++ b/src/Evolution/Systems/GrMhd/ValenciaDivClean/TimeDerivativeTerms.cpp @@ -7,13 +7,13 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Fluxes.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Sources.hpp" #include "Evolution/Systems/GrMhd/ValenciaDivClean/Tags.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/Hydro/Tags.hpp" #include "Utilities/ConstantExpressions.hpp" diff --git a/src/Evolution/Systems/RadiationTransport/M1Grey/Fluxes.cpp b/src/Evolution/Systems/RadiationTransport/M1Grey/Fluxes.cpp index 1d51f517742d..6d3699f45c79 100644 --- a/src/Evolution/Systems/RadiationTransport/M1Grey/Fluxes.cpp +++ b/src/Evolution/Systems/RadiationTransport/M1Grey/Fluxes.cpp @@ -7,8 +7,8 @@ #include #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" // IWYU pragma: keep // IWYU pragma: no_forward_declare Tensor diff --git a/src/Evolution/Systems/RadiationTransport/M1Grey/M1Closure.cpp b/src/Evolution/Systems/RadiationTransport/M1Grey/M1Closure.cpp index 705886a8f865..d437f5d7b5b0 100644 --- a/src/Evolution/Systems/RadiationTransport/M1Grey/M1Closure.cpp +++ b/src/Evolution/Systems/RadiationTransport/M1Grey/M1Closure.cpp @@ -12,10 +12,10 @@ #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "NumericalAlgorithms/RootFinding/TOMS748.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/Hydro/Tags.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/Evolution/Systems/RadiationTransport/M1Grey/M1HydroCoupling.cpp b/src/Evolution/Systems/RadiationTransport/M1Grey/M1HydroCoupling.cpp index 4a79103f495d..064a470ea475 100644 --- a/src/Evolution/Systems/RadiationTransport/M1Grey/M1HydroCoupling.cpp +++ b/src/Evolution/Systems/RadiationTransport/M1Grey/M1HydroCoupling.cpp @@ -12,9 +12,9 @@ #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/Hydro/Tags.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/Evolution/Systems/RadiationTransport/M1Grey/Sources.cpp b/src/Evolution/Systems/RadiationTransport/M1Grey/Sources.cpp index 56094c43fd94..226f9b802edd 100644 --- a/src/Evolution/Systems/RadiationTransport/M1Grey/Sources.cpp +++ b/src/Evolution/Systems/RadiationTransport/M1Grey/Sources.cpp @@ -8,9 +8,9 @@ #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" // IWYU pragma: keep // IWYU pragma: no_forward_declare Tensor diff --git a/src/Evolution/Systems/RelativisticEuler/Valencia/Characteristics.cpp b/src/Evolution/Systems/RelativisticEuler/Valencia/Characteristics.cpp index f2344ed4df89..285de6843b09 100644 --- a/src/Evolution/Systems/RelativisticEuler/Valencia/Characteristics.cpp +++ b/src/Evolution/Systems/RelativisticEuler/Valencia/Characteristics.cpp @@ -8,9 +8,9 @@ #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" #include "DataStructures/Tensor/EagerMath/OrthonormalOneform.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/Evolution/Systems/RelativisticEuler/Valencia/ConservativeFromPrimitive.cpp b/src/Evolution/Systems/RelativisticEuler/Valencia/ConservativeFromPrimitive.cpp index 0f9116449086..7154b99b2771 100644 --- a/src/Evolution/Systems/RelativisticEuler/Valencia/ConservativeFromPrimitive.cpp +++ b/src/Evolution/Systems/RelativisticEuler/Valencia/ConservativeFromPrimitive.cpp @@ -5,9 +5,9 @@ #include "DataStructures/DataVector.hpp" // IWYU pragma: keep #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/Hydro/Tags.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/GenerateInstantiations.hpp" diff --git a/src/Evolution/Systems/RelativisticEuler/Valencia/PrimitiveFromConservative.cpp b/src/Evolution/Systems/RelativisticEuler/Valencia/PrimitiveFromConservative.cpp index 8034552cd88c..cc309f8d5bc1 100644 --- a/src/Evolution/Systems/RelativisticEuler/Valencia/PrimitiveFromConservative.cpp +++ b/src/Evolution/Systems/RelativisticEuler/Valencia/PrimitiveFromConservative.cpp @@ -8,9 +8,9 @@ #include "DataStructures/DataVector.hpp" // IWYU pragma: keep #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "NumericalAlgorithms/RootFinding/TOMS748.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/ContainerHelpers.hpp" #include "Utilities/GenerateInstantiations.hpp" diff --git a/src/Evolution/Systems/RelativisticEuler/Valencia/Sources.cpp b/src/Evolution/Systems/RelativisticEuler/Valencia/Sources.cpp index 843b736d332c..016671272e58 100644 --- a/src/Evolution/Systems/RelativisticEuler/Valencia/Sources.cpp +++ b/src/Evolution/Systems/RelativisticEuler/Valencia/Sources.cpp @@ -4,8 +4,8 @@ #include "Evolution/Systems/RelativisticEuler/Valencia/Sources.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/Evolution/Systems/RelativisticEuler/Valencia/TimeDerivativeTerms.cpp b/src/Evolution/Systems/RelativisticEuler/Valencia/TimeDerivativeTerms.cpp index a6179d9ca31e..29c62cc696d5 100644 --- a/src/Evolution/Systems/RelativisticEuler/Valencia/TimeDerivativeTerms.cpp +++ b/src/Evolution/Systems/RelativisticEuler/Valencia/TimeDerivativeTerms.cpp @@ -6,8 +6,8 @@ #include #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/Gsl.hpp" #include "Utilities/TMPL.hpp" diff --git a/src/ParallelAlgorithms/ApparentHorizonFinder/FastFlow.cpp b/src/ParallelAlgorithms/ApparentHorizonFinder/FastFlow.cpp index 431237d8b2f9..e7dcbcca5461 100644 --- a/src/ParallelAlgorithms/ApparentHorizonFinder/FastFlow.cpp +++ b/src/ParallelAlgorithms/ApparentHorizonFinder/FastFlow.cpp @@ -13,12 +13,12 @@ #include "DataStructures/DataBox/DataBox.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" // IWYU pragma: keep +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "NumericalAlgorithms/SphericalHarmonics/SpherepackIterator.hpp" #include "NumericalAlgorithms/SphericalHarmonics/Strahlkorper.hpp" #include "NumericalAlgorithms/SphericalHarmonics/Tags.hpp" #include "Options/ParseOptions.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/Expansion.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/GradUnitNormalOneForm.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/InverseSurfaceMetric.hpp" diff --git a/src/PointwiseFunctions/AnalyticData/GrMhd/SpecInitialData.cpp b/src/PointwiseFunctions/AnalyticData/GrMhd/SpecInitialData.cpp index 0ef31cfb9fdd..704a1aabc85e 100644 --- a/src/PointwiseFunctions/AnalyticData/GrMhd/SpecInitialData.cpp +++ b/src/PointwiseFunctions/AnalyticData/GrMhd/SpecInitialData.cpp @@ -12,9 +12,9 @@ #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "IO/External/InterpolateFromSpec.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/Hydro/SpecificEnthalpy.hpp" #include "PointwiseFunctions/Hydro/Tags.hpp" diff --git a/src/PointwiseFunctions/AnalyticData/Xcts/Binary.cpp b/src/PointwiseFunctions/AnalyticData/Xcts/Binary.cpp index 6b7b5f9a0833..38c699dce6ba 100644 --- a/src/PointwiseFunctions/AnalyticData/Xcts/Binary.cpp +++ b/src/PointwiseFunctions/AnalyticData/Xcts/Binary.cpp @@ -8,11 +8,11 @@ #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Elliptic/Systems/Xcts/Tags.hpp" #include "PointwiseFunctions/AnalyticData/Xcts/CommonVariables.tpp" #include "PointwiseFunctions/Elasticity/Strain.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/Xcts/LongitudinalOperator.hpp" #include "Utilities/ConstantExpressions.hpp" diff --git a/src/PointwiseFunctions/AnalyticData/Xcts/CommonVariables.tpp b/src/PointwiseFunctions/AnalyticData/Xcts/CommonVariables.tpp index 37bd28368875..c137d109c492 100644 --- a/src/PointwiseFunctions/AnalyticData/Xcts/CommonVariables.tpp +++ b/src/PointwiseFunctions/AnalyticData/Xcts/CommonVariables.tpp @@ -12,6 +12,8 @@ #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Elliptic/Systems/Xcts/Tags.hpp" @@ -20,7 +22,6 @@ #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" #include "NumericalAlgorithms/Spectral/Mesh.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp" #include "Utilities/ContainerHelpers.hpp" #include "Utilities/ErrorHandling/Assert.hpp" diff --git a/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.cpp b/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.cpp index f3dc2504d00b..6835f634d659 100644 --- a/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.cpp +++ b/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.cpp @@ -12,10 +12,11 @@ #include "DataStructures/DataVector.hpp" // IWYU pragma: keep #include "DataStructures/TempBuffer.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "Options/ParseError.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/ContainerHelpers.hpp" diff --git a/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/SphericalKerrSchild.cpp b/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/SphericalKerrSchild.cpp index ce1fa3f23a19..58c9ef603567 100644 --- a/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/SphericalKerrSchild.cpp +++ b/src/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/SphericalKerrSchild.cpp @@ -13,11 +13,12 @@ #include "DataStructures/DataVector.hpp" // IWYU pragma: keep #include "DataStructures/Tensor/EagerMath/CrossProduct.hpp" #include "DataStructures/Tensor/EagerMath/Determinant.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Options/ParseError.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/ContainerHelpers.hpp" diff --git a/src/PointwiseFunctions/AnalyticSolutions/Xcts/CommonVariables.tpp b/src/PointwiseFunctions/AnalyticSolutions/Xcts/CommonVariables.tpp index 4307998f2938..130c8f811b9d 100644 --- a/src/PointwiseFunctions/AnalyticSolutions/Xcts/CommonVariables.tpp +++ b/src/PointwiseFunctions/AnalyticSolutions/Xcts/CommonVariables.tpp @@ -13,7 +13,7 @@ #include "Elliptic/Systems/Xcts/Tags.hpp" #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" #include "PointwiseFunctions/AnalyticData/Xcts/CommonVariables.tpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/Xcts/LongitudinalOperator.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/PointwiseFunctions/AnalyticSolutions/Xcts/WrappedGr.cpp b/src/PointwiseFunctions/AnalyticSolutions/Xcts/WrappedGr.cpp index 302ff9dd6f4b..bc418c2bb10d 100644 --- a/src/PointwiseFunctions/AnalyticSolutions/Xcts/WrappedGr.cpp +++ b/src/PointwiseFunctions/AnalyticSolutions/Xcts/WrappedGr.cpp @@ -8,6 +8,7 @@ #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Elliptic/Systems/Xcts/Tags.hpp" #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" @@ -20,7 +21,6 @@ #include "PointwiseFunctions/AnalyticSolutions/RelativisticEuler/RotatingStar.hpp" #include "PointwiseFunctions/AnalyticSolutions/Xcts/CommonVariables.tpp" #include "PointwiseFunctions/Elasticity/Strain.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags/Conformal.hpp" #include "PointwiseFunctions/Hydro/ComovingMagneticField.hpp" diff --git a/src/PointwiseFunctions/GeneralRelativity/CMakeLists.txt b/src/PointwiseFunctions/GeneralRelativity/CMakeLists.txt index 7cf6a55d1f3c..17541c4f2355 100644 --- a/src/PointwiseFunctions/GeneralRelativity/CMakeLists.txt +++ b/src/PointwiseFunctions/GeneralRelativity/CMakeLists.txt @@ -12,7 +12,6 @@ spectre_target_sources( DerivativeSpatialMetric.cpp DerivativesOfSpacetimeMetric.cpp ExtrinsicCurvature.cpp - IndexManipulation.cpp InterfaceNullNormal.cpp InverseSpacetimeMetric.cpp KerrSchildCoords.cpp @@ -44,7 +43,6 @@ spectre_target_headers( DerivativesOfSpacetimeMetric.hpp DetAndInverseSpatialMetric.hpp ExtrinsicCurvature.hpp - IndexManipulation.hpp InterfaceNullNormal.hpp InverseSpacetimeMetric.hpp KerrSchildCoords.hpp diff --git a/src/PointwiseFunctions/GeneralRelativity/Christoffel.hpp b/src/PointwiseFunctions/GeneralRelativity/Christoffel.hpp index 15a0c35e1969..265b3edfd117 100644 --- a/src/PointwiseFunctions/GeneralRelativity/Christoffel.hpp +++ b/src/PointwiseFunctions/GeneralRelativity/Christoffel.hpp @@ -9,11 +9,12 @@ #include #include "DataStructures/DataBox/Tag.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/IndexType.hpp" #include "DataStructures/Tensor/TypeAliases.hpp" #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" /// \cond diff --git a/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp b/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp index adeb10a33e96..3ceb30d608e1 100644 --- a/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp +++ b/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp @@ -8,9 +8,9 @@ #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "Utilities/ContainerHelpers.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Ricci.hpp b/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Ricci.hpp index ed8c36ca32be..1cd49cbdffa2 100644 --- a/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Ricci.hpp +++ b/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Ricci.hpp @@ -9,8 +9,8 @@ #include #include "DataStructures/DataBox/Tag.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/TypeAliases.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" /// \cond namespace gsl { diff --git a/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivOfNormOfShift.cpp b/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivOfNormOfShift.cpp index 30e5de78725f..f2ec3f42fdaa 100644 --- a/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivOfNormOfShift.cpp +++ b/src/PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivOfNormOfShift.cpp @@ -3,15 +3,15 @@ #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivOfNormOfShift.hpp" -#include "DataStructures/DataVector.hpp" // IWYU pragma: keep +#include "DataStructures/DataVector.hpp" // IWYU pragma: keep #include "DataStructures/Tags/TempTensor.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" // IWYU pragma: keep #include "DataStructures/Tensor/TypeAliases.hpp" #include "DataStructures/Variables.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpatialDerivOfShift.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/TimeDerivOfLowerShift.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/TimeDerivOfShift.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/ContainerHelpers.hpp" #include "Utilities/GenerateInstantiations.hpp" diff --git a/src/PointwiseFunctions/GeneralRelativity/Ricci.cpp b/src/PointwiseFunctions/GeneralRelativity/Ricci.cpp index 0708737f5b27..71f53baf7f55 100644 --- a/src/PointwiseFunctions/GeneralRelativity/Ricci.cpp +++ b/src/PointwiseFunctions/GeneralRelativity/Ricci.cpp @@ -3,8 +3,8 @@ #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" -#include "IndexManipulation.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/Gsl.hpp" #include "Utilities/MakeWithValue.hpp" diff --git a/src/PointwiseFunctions/GeneralRelativity/Surfaces/ComputeItems.hpp b/src/PointwiseFunctions/GeneralRelativity/Surfaces/ComputeItems.hpp index 10251df25568..ac078c59a6b6 100644 --- a/src/PointwiseFunctions/GeneralRelativity/Surfaces/ComputeItems.hpp +++ b/src/PointwiseFunctions/GeneralRelativity/Surfaces/ComputeItems.hpp @@ -11,13 +11,13 @@ class DataVector; #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/TypeAliases.hpp" #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/DerivSpatialMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp" #include "PointwiseFunctions/GeneralRelativity/Shift.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeNormalVector.hpp" diff --git a/src/PointwiseFunctions/GeneralRelativity/Surfaces/RicciScalar.cpp b/src/PointwiseFunctions/GeneralRelativity/Surfaces/RicciScalar.cpp index 8b821062f5e8..5c79778063bf 100644 --- a/src/PointwiseFunctions/GeneralRelativity/Surfaces/RicciScalar.cpp +++ b/src/PointwiseFunctions/GeneralRelativity/Surfaces/RicciScalar.cpp @@ -6,8 +6,8 @@ #include #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/GenerateInstantiations.hpp" #include "Utilities/Gsl.hpp" diff --git a/src/PointwiseFunctions/GeneralRelativity/Surfaces/Spin.cpp b/src/PointwiseFunctions/GeneralRelativity/Surfaces/Spin.cpp index 7d2cc29e3a77..1b86947e0bbc 100644 --- a/src/PointwiseFunctions/GeneralRelativity/Surfaces/Spin.cpp +++ b/src/PointwiseFunctions/GeneralRelativity/Surfaces/Spin.cpp @@ -12,6 +12,8 @@ #include "DataStructures/Matrix.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "NumericalAlgorithms/LinearAlgebra/FindGeneralizedEigenvalues.hpp" #include "NumericalAlgorithms/SphericalHarmonics/Spherepack.hpp" @@ -19,7 +21,6 @@ #include "NumericalAlgorithms/SphericalHarmonics/Strahlkorper.hpp" #include "NumericalAlgorithms/SphericalHarmonics/StrahlkorperFunctions.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/ErrorHandling/Assert.hpp" #include "Utilities/GenerateInstantiations.hpp" diff --git a/src/PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp b/src/PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp index 7d87c14a81c0..36ed15d13c62 100644 --- a/src/PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp +++ b/src/PointwiseFunctions/GeneralRelativity/Surfaces/Tags.hpp @@ -12,11 +12,11 @@ #include "DataStructures/DataBox/TagName.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "NumericalAlgorithms/SphericalHarmonics/Strahlkorper.hpp" #include "NumericalAlgorithms/SphericalHarmonics/TagsDeclarations.hpp" #include "NumericalAlgorithms/SphericalHarmonics/TagsTypeAliases.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/AreaElement.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/ExtrinsicCurvature.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/GradUnitNormalOneForm.hpp" diff --git a/src/PointwiseFunctions/Hydro/CMakeLists.txt b/src/PointwiseFunctions/Hydro/CMakeLists.txt index 4b330530640e..949146bbe299 100644 --- a/src/PointwiseFunctions/Hydro/CMakeLists.txt +++ b/src/PointwiseFunctions/Hydro/CMakeLists.txt @@ -48,10 +48,11 @@ target_link_libraries( Boost::boost DataStructures ErrorHandling - GeneralRelativity H5 Options Serialization + INTERFACE + GeneralRelativity ) add_subdirectory(EquationsOfState) diff --git a/src/PointwiseFunctions/Hydro/LowerSpatialFourVelocity.cpp b/src/PointwiseFunctions/Hydro/LowerSpatialFourVelocity.cpp index 9f47fb42a67a..958261370e92 100644 --- a/src/PointwiseFunctions/Hydro/LowerSpatialFourVelocity.cpp +++ b/src/PointwiseFunctions/Hydro/LowerSpatialFourVelocity.cpp @@ -4,8 +4,8 @@ #include "PointwiseFunctions/Hydro/LowerSpatialFourVelocity.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" namespace hydro::Tags { void LowerSpatialFourVelocityCompute::function( diff --git a/src/PointwiseFunctions/Xcts/SpacetimeQuantities.cpp b/src/PointwiseFunctions/Xcts/SpacetimeQuantities.cpp index 61fbe2ee5656..dc69e18c42e5 100644 --- a/src/PointwiseFunctions/Xcts/SpacetimeQuantities.cpp +++ b/src/PointwiseFunctions/Xcts/SpacetimeQuantities.cpp @@ -6,6 +6,7 @@ #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataBox/Tag.hpp" #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Elliptic/Systems/Xcts/Tags.hpp" #include "NumericalAlgorithms/LinearOperators/Divergence.hpp" @@ -15,7 +16,6 @@ #include "PointwiseFunctions/Elasticity/Strain.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/Xcts/ExtrinsicCurvature.hpp" diff --git a/tests/Unit/DataStructures/Tensor/EagerMath/CMakeLists.txt b/tests/Unit/DataStructures/Tensor/EagerMath/CMakeLists.txt index 94dc0b7dbd4a..355082f8713f 100644 --- a/tests/Unit/DataStructures/Tensor/EagerMath/CMakeLists.txt +++ b/tests/Unit/DataStructures/Tensor/EagerMath/CMakeLists.txt @@ -11,6 +11,8 @@ set(LIBRARY_SOURCES Test_Magnitude.cpp Test_Norms.cpp Test_OrthonormalOneform.cpp + Test_OuterProduct.cpp + Test_RaiseOrLowerIndex.cpp ) add_test_library(${LIBRARY} "${LIBRARY_SOURCES}") diff --git a/tests/Unit/PointwiseFunctions/GeneralRelativity/IndexManipulation.py b/tests/Unit/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.py similarity index 67% rename from tests/Unit/PointwiseFunctions/GeneralRelativity/IndexManipulation.py rename to tests/Unit/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.py index 15f695651468..6cffd27b3070 100644 --- a/tests/Unit/PointwiseFunctions/GeneralRelativity/IndexManipulation.py +++ b/tests/Unit/DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.py @@ -6,7 +6,3 @@ def raise_or_lower_first_index(tensor, metric): return np.einsum("ij,ikl", metric, tensor) - - -def trace_last_indices(tensor, metric): - return np.einsum("ij,kij", metric, tensor) diff --git a/tests/Unit/DataStructures/Tensor/EagerMath/Test_OrthonormalOneform.cpp b/tests/Unit/DataStructures/Tensor/EagerMath/Test_OrthonormalOneform.cpp index d0d1d4754857..d722637c00fc 100644 --- a/tests/Unit/DataStructures/Tensor/EagerMath/Test_OrthonormalOneform.cpp +++ b/tests/Unit/DataStructures/Tensor/EagerMath/Test_OrthonormalOneform.cpp @@ -13,6 +13,7 @@ #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" #include "DataStructures/Tensor/EagerMath/OrthonormalOneform.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Domain/Structure/Direction.hpp" #include "Framework/CheckWithRandomValues.hpp" @@ -21,7 +22,6 @@ #include "Helpers/DataStructures/RandomUnitNormal.hpp" #include "Helpers/Domain/DomainTestHelpers.hpp" #include "Helpers/PointwiseFunctions/GeneralRelativity/TestHelpers.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ContainerHelpers.hpp" #include "Utilities/Gsl.hpp" diff --git a/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_IndexManipulation.cpp b/tests/Unit/DataStructures/Tensor/EagerMath/Test_RaiseOrLowerIndex.cpp similarity index 53% rename from tests/Unit/PointwiseFunctions/GeneralRelativity/Test_IndexManipulation.cpp rename to tests/Unit/DataStructures/Tensor/EagerMath/Test_RaiseOrLowerIndex.cpp index bfb5b38a77f6..316a3438ed64 100644 --- a/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_IndexManipulation.cpp +++ b/tests/Unit/DataStructures/Tensor/EagerMath/Test_RaiseOrLowerIndex.cpp @@ -6,10 +6,10 @@ #include #include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Framework/CheckWithRandomValues.hpp" #include "Framework/SetupLocalPythonEnvironment.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/TMPL.hpp" // IWYU pragma: no_include @@ -33,7 +33,7 @@ void test_raise_or_lower_first_index(const DataType& used_for_size) { index_list, change_index_up_lo>>&) = &raise_or_lower_first_index; - pypp::check_with_random_values<1>(f, "IndexManipulation", + pypp::check_with_random_values<1>(f, "RaiseOrLowerIndex", "raise_or_lower_first_index", {{{-10., 10.}}}, used_for_size); } @@ -51,41 +51,12 @@ void test_raise_or_lower(const DataType& used_for_size) { pypp::check_with_random_values<1>(f, "numpy", "matmul", {{{-10., 10.}}}, used_for_size); } -template -void test_trace_last_indices(const DataType& used_for_size) { - using Index0 = Tensor_detail::TensorIndexType; - using Index1 = Tensor_detail::TensorIndexType; - Tensor, index_list> (*f)( - const Tensor, - index_list>&, - const Tensor, - index_list, - change_index_up_lo>>&) = - &trace_last_indices; - pypp::check_with_random_values<1>(f, "IndexManipulation", - "trace_last_indices", {{{-10., 10.}}}, - used_for_size); -} -template -void test_trace(const DataType& used_for_size) { - using Index0 = Tensor_detail::TensorIndexType; - Scalar (*f)( - const Tensor, index_list>&, - const Tensor, - index_list, - change_index_up_lo>>&) = - &trace; - pypp::check_with_random_values<1>(f, "numpy", "tensordot", {{{-10., 10.}}}, - used_for_size); -} } // namespace -SPECTRE_TEST_CASE("Unit.PointwiseFunctions.GeneralRelativity.IndexManipulation", - "[PointwiseFunctions][Unit]") { +SPECTRE_TEST_CASE("Unit.Tensor.EagerMath.RaiseOrLowerIndex", + "[DataStructures][Unit]") { pypp::SetupLocalPythonEnvironment local_python_env( - "PointwiseFunctions/GeneralRelativity/"); + "DataStructures/Tensor/EagerMath/"); GENERATE_UNINITIALIZED_DOUBLE_AND_DATAVECTOR; @@ -96,13 +67,4 @@ SPECTRE_TEST_CASE("Unit.PointwiseFunctions.GeneralRelativity.IndexManipulation", CHECK_FOR_DOUBLES_AND_DATAVECTORS(test_raise_or_lower, (1, 2, 3), (UpLo::Lo, UpLo::Up), (IndexType::Spatial, IndexType::Spacetime)); - - CHECK_FOR_DOUBLES_AND_DATAVECTORS(test_trace_last_indices, (1, 2, 3), - (UpLo::Lo, UpLo::Up), (UpLo::Lo, UpLo::Up), - (Frame::Grid, Frame::Inertial), - (IndexType::Spatial, IndexType::Spacetime)); - - CHECK_FOR_DOUBLES_AND_DATAVECTORS(test_trace, (1, 2, 3), (UpLo::Lo, UpLo::Up), - (Frame::Grid, Frame::Inertial), - (IndexType::Spatial, IndexType::Spacetime)); } diff --git a/tests/Unit/DataStructures/Tensor/EagerMath/Test_Trace.cpp b/tests/Unit/DataStructures/Tensor/EagerMath/Test_Trace.cpp new file mode 100644 index 000000000000..4ea2a767e5b2 --- /dev/null +++ b/tests/Unit/DataStructures/Tensor/EagerMath/Test_Trace.cpp @@ -0,0 +1,60 @@ +// Distributed under the MIT License. +// See LICENSE.txt for details. + +#include "Framework/TestingFramework.hpp" + +#include + +#include "DataStructures/DataVector.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" +#include "DataStructures/Tensor/Tensor.hpp" +#include "Framework/CheckWithRandomValues.hpp" +#include "Framework/SetupLocalPythonEnvironment.hpp" +#include "Utilities/TMPL.hpp" + +namespace { +template +void test_trace_last_indices(const DataType& used_for_size) { + using Index0 = Tensor_detail::TensorIndexType; + using Index1 = Tensor_detail::TensorIndexType; + Tensor, index_list> (*f)( + const Tensor, + index_list>&, + const Tensor, + index_list, + change_index_up_lo>>&) = + &trace_last_indices; + pypp::check_with_random_values<1>(f, "Trace", "trace_last_indices", + {{{-10., 10.}}}, used_for_size); +} +template +void test_trace(const DataType& used_for_size) { + using Index0 = Tensor_detail::TensorIndexType; + Scalar (*f)( + const Tensor, index_list>&, + const Tensor, + index_list, + change_index_up_lo>>&) = + &trace; + pypp::check_with_random_values<1>(f, "numpy", "tensordot", {{{-10., 10.}}}, + used_for_size); +} +} // namespace + +SPECTRE_TEST_CASE("Unit.Tensor.EagerMath.Trace", "[DataStructures][Unit]") { + pypp::SetupLocalPythonEnvironment local_python_env( + "DataStructures/Tensor/EagerMath/"); + + GENERATE_UNINITIALIZED_DOUBLE_AND_DATAVECTOR; + + CHECK_FOR_DOUBLES_AND_DATAVECTORS(test_trace_last_indices, (1, 2, 3), + (UpLo::Lo, UpLo::Up), (UpLo::Lo, UpLo::Up), + (Frame::Grid, Frame::Inertial), + (IndexType::Spatial, IndexType::Spacetime)); + + CHECK_FOR_DOUBLES_AND_DATAVECTORS(test_trace, (1, 2, 3), (UpLo::Lo, UpLo::Up), + (Frame::Grid, Frame::Inertial), + (IndexType::Spatial, IndexType::Spacetime)); +} diff --git a/tests/Unit/DataStructures/Tensor/EagerMath/Trace.py b/tests/Unit/DataStructures/Tensor/EagerMath/Trace.py new file mode 100644 index 000000000000..c530e4f25310 --- /dev/null +++ b/tests/Unit/DataStructures/Tensor/EagerMath/Trace.py @@ -0,0 +1,8 @@ +# Distributed under the MIT License. +# See LICENSE.txt for details. + +import numpy as np + + +def trace_last_indices(tensor, metric): + return np.einsum("ij,kij", metric, tensor) diff --git a/tests/Unit/Evolution/Systems/CurvedScalarWave/Test_Characteristics.cpp b/tests/Unit/Evolution/Systems/CurvedScalarWave/Test_Characteristics.cpp index f598f4d90246..8b0cbe1216d8 100644 --- a/tests/Unit/Evolution/Systems/CurvedScalarWave/Test_Characteristics.cpp +++ b/tests/Unit/Evolution/Systems/CurvedScalarWave/Test_Characteristics.cpp @@ -11,6 +11,7 @@ #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Evolution/Systems/CurvedScalarWave/Characteristics.hpp" @@ -20,7 +21,6 @@ #include "Helpers/DataStructures/DataBox/TestHelpers.hpp" #include "Helpers/DataStructures/RandomUnitNormal.hpp" #include "Helpers/PointwiseFunctions/GeneralRelativity/TestHelpers.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" namespace { diff --git a/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_Characteristics.cpp b/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_Characteristics.cpp index e5e14e77f22b..5d8971847b70 100644 --- a/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_Characteristics.cpp +++ b/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_Characteristics.cpp @@ -18,6 +18,7 @@ #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Domain/CoordinateMaps/Affine.hpp" @@ -41,7 +42,6 @@ #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Phi.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Pi.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeNormalOneForm.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeNormalVector.hpp" diff --git a/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_Constraints.cpp b/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_Constraints.cpp index 3c570d8f2f1d..3c5f9c4efb06 100644 --- a/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_Constraints.cpp +++ b/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_Constraints.cpp @@ -15,6 +15,7 @@ #include "DataStructures/DataBox/Prefixes.hpp" // IWYU pragma: keep #include "DataStructures/DataVector.hpp" // IWYU pragma: keep #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Domain/CoordinateMaps/Affine.hpp" @@ -47,7 +48,6 @@ #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/GaugeSource.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Phi.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Pi.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeNormalOneForm.hpp" diff --git a/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_DuDt.cpp b/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_DuDt.cpp index 43f5a6d696ad..8c1e4d48886b 100644 --- a/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_DuDt.cpp +++ b/tests/Unit/Evolution/Systems/GeneralizedHarmonic/Test_DuDt.cpp @@ -10,6 +10,8 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Identity.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" @@ -31,7 +33,6 @@ #include "NumericalAlgorithms/Spectral/Quadrature.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/SpacetimeDerivativeOfSpacetimeMetric.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp" #include "PointwiseFunctions/GeneralRelativity/Shift.hpp" diff --git a/tests/Unit/Evolution/Systems/RelativisticEuler/Valencia/Test_Characteristics.cpp b/tests/Unit/Evolution/Systems/RelativisticEuler/Valencia/Test_Characteristics.cpp index 6f36fc6ba3a8..3c0ca36acdf0 100644 --- a/tests/Unit/Evolution/Systems/RelativisticEuler/Valencia/Test_Characteristics.cpp +++ b/tests/Unit/Evolution/Systems/RelativisticEuler/Valencia/Test_Characteristics.cpp @@ -13,6 +13,7 @@ #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Tensor/TypeAliases.hpp" #include "Domain/FaceNormal.hpp" @@ -28,7 +29,6 @@ #include "Helpers/Domain/DomainTestHelpers.hpp" #include "Helpers/PointwiseFunctions/GeneralRelativity/TestHelpers.hpp" #include "Helpers/PointwiseFunctions/Hydro/TestHelpers.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp" #include "PointwiseFunctions/Hydro/EquationsOfState/IdealFluid.hpp" diff --git a/tests/Unit/Evolution/Systems/RelativisticEuler/Valencia/Test_PrimitiveFromConservative.cpp b/tests/Unit/Evolution/Systems/RelativisticEuler/Valencia/Test_PrimitiveFromConservative.cpp index 937f8e72e515..45a44266a0b7 100644 --- a/tests/Unit/Evolution/Systems/RelativisticEuler/Valencia/Test_PrimitiveFromConservative.cpp +++ b/tests/Unit/Evolution/Systems/RelativisticEuler/Valencia/Test_PrimitiveFromConservative.cpp @@ -11,13 +11,13 @@ #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Evolution/Systems/RelativisticEuler/Valencia/ConservativeFromPrimitive.hpp" #include "Evolution/Systems/RelativisticEuler/Valencia/PrimitiveFromConservative.hpp" #include "Framework/TestHelpers.hpp" #include "Helpers/PointwiseFunctions/GeneralRelativity/TestHelpers.hpp" #include "Helpers/PointwiseFunctions/Hydro/TestHelpers.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp" #include "PointwiseFunctions/Hydro/EquationsOfState/IdealFluid.hpp" #include "PointwiseFunctions/Hydro/EquationsOfState/PolytropicFluid.hpp" diff --git a/tests/Unit/Helpers/DataStructures/MakeRandomVectorInMagnitudeRange.hpp b/tests/Unit/Helpers/DataStructures/MakeRandomVectorInMagnitudeRange.hpp index 1cd56c818ce3..13e6cf4ddd4d 100644 --- a/tests/Unit/Helpers/DataStructures/MakeRandomVectorInMagnitudeRange.hpp +++ b/tests/Unit/Helpers/DataStructures/MakeRandomVectorInMagnitudeRange.hpp @@ -7,12 +7,12 @@ #include #include "DataStructures/DataVector.hpp" // IWYU pragma: keep +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/IndexType.hpp" #include "DataStructures/Tensor/Tensor.hpp" // IWYU pragma: keep #include "DataStructures/Tensor/TypeAliases.hpp" #include "Helpers/DataStructures/MakeWithRandomValues.hpp" #include "Helpers/DataStructures/RandomUnitNormal.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/Gsl.hpp" diff --git a/tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/VerifyGrSolution.hpp b/tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/VerifyGrSolution.hpp index 6ee4c54a65a6..7ac0b7c7afee 100644 --- a/tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/VerifyGrSolution.hpp +++ b/tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/GeneralRelativity/VerifyGrSolution.hpp @@ -12,6 +12,7 @@ #include "DataStructures/DataBox/Prefixes.hpp" // IWYU pragma: keep #include "DataStructures/DataVector.hpp" // IWYU pragma: keep #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "DataStructures/Variables.hpp" #include "Domain/CoordinateMaps/Affine.hpp" @@ -38,7 +39,6 @@ #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/GaugeSource.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Phi.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Pi.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeNormalOneForm.hpp" diff --git a/tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/Xcts/VerifySolution.hpp b/tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/Xcts/VerifySolution.hpp index a2f5903f8c27..08e6e83798f2 100644 --- a/tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/Xcts/VerifySolution.hpp +++ b/tests/Unit/Helpers/PointwiseFunctions/AnalyticSolutions/Xcts/VerifySolution.hpp @@ -3,6 +3,7 @@ #pragma once +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "Domain/CoordinateMaps/Affine.hpp" #include "Domain/CoordinateMaps/CoordinateMap.hpp" #include "Domain/CoordinateMaps/CoordinateMap.tpp" @@ -16,7 +17,6 @@ #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" #include "NumericalAlgorithms/Spectral/Mesh.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Ricci.hpp" #include "PointwiseFunctions/Xcts/SpacetimeQuantities.hpp" diff --git a/tests/Unit/ParallelAlgorithms/ApparentHorizonFinder/Test_FastFlow.cpp b/tests/Unit/ParallelAlgorithms/ApparentHorizonFinder/Test_FastFlow.cpp index cac488ae661d..55f7a827e829 100644 --- a/tests/Unit/ParallelAlgorithms/ApparentHorizonFinder/Test_FastFlow.cpp +++ b/tests/Unit/ParallelAlgorithms/ApparentHorizonFinder/Test_FastFlow.cpp @@ -15,6 +15,7 @@ #include "DataStructures/DataBox/Prefixes.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Framework/TestCreation.hpp" #include "Framework/TestHelpers.hpp" @@ -26,7 +27,6 @@ #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/KerrSchild.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" #include "Utilities/ConstantExpressions.hpp" #include "Utilities/GetOutput.hpp" diff --git a/tests/Unit/PointwiseFunctions/GeneralRelativity/CMakeLists.txt b/tests/Unit/PointwiseFunctions/GeneralRelativity/CMakeLists.txt index d1d6d01d5ffe..481a41f318d2 100644 --- a/tests/Unit/PointwiseFunctions/GeneralRelativity/CMakeLists.txt +++ b/tests/Unit/PointwiseFunctions/GeneralRelativity/CMakeLists.txt @@ -7,7 +7,6 @@ set(LIBRARY_SOURCES Test_Christoffel.cpp Test_ComputeGhQuantities.cpp Test_ComputeSpacetimeQuantities.cpp - Test_IndexManipulation.cpp Test_InterfaceNullNormal.cpp Test_KerrSchildCoords.cpp Test_ProjectionOperators.cpp diff --git a/tests/Unit/PointwiseFunctions/GeneralRelativity/Surfaces/Test_ComputeItems.cpp b/tests/Unit/PointwiseFunctions/GeneralRelativity/Surfaces/Test_ComputeItems.cpp index 55df0ebe1532..3502067c806e 100644 --- a/tests/Unit/PointwiseFunctions/GeneralRelativity/Surfaces/Test_ComputeItems.cpp +++ b/tests/Unit/PointwiseFunctions/GeneralRelativity/Surfaces/Test_ComputeItems.cpp @@ -9,6 +9,7 @@ #include "DataStructures/DataBox/DataBox.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/TypeAliases.hpp" #include "Evolution/Systems/GeneralizedHarmonic/Tags.hpp" #include "Framework/TestHelpers.hpp" @@ -18,7 +19,6 @@ #include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Phi.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/Pi.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/SpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/ComputeItems.hpp" #include "PointwiseFunctions/GeneralRelativity/Tags.hpp" diff --git a/tests/Unit/PointwiseFunctions/GeneralRelativity/Surfaces/Test_GrSurfaces.cpp b/tests/Unit/PointwiseFunctions/GeneralRelativity/Surfaces/Test_GrSurfaces.cpp index c194c91f568b..79a701a1c85b 100644 --- a/tests/Unit/PointwiseFunctions/GeneralRelativity/Surfaces/Test_GrSurfaces.cpp +++ b/tests/Unit/PointwiseFunctions/GeneralRelativity/Surfaces/Test_GrSurfaces.cpp @@ -15,6 +15,7 @@ #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" #include "DataStructures/Tensor/EagerMath/DotProduct.hpp" // IWYU pragma: keep #include "DataStructures/Tensor/EagerMath/Magnitude.hpp" // IWYU prgma: keep +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Framework/TestHelpers.hpp" #include "Helpers/DataStructures/MakeWithRandomValues.hpp" @@ -30,7 +31,6 @@ #include "PointwiseFunctions/AnalyticSolutions/GeneralRelativity/Minkowski.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/ExtrinsicCurvature.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/AreaElement.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/Expansion.hpp" #include "PointwiseFunctions/GeneralRelativity/Surfaces/ExtrinsicCurvature.hpp" diff --git a/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_Christoffel.cpp b/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_Christoffel.cpp index 18b5359b0368..f01cf37446ee 100644 --- a/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_Christoffel.cpp +++ b/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_Christoffel.cpp @@ -12,6 +12,8 @@ #include "DataStructures/DataBox/DataBox.hpp" #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Framework/CheckWithRandomValues.hpp" #include "Framework/SetupLocalPythonEnvironment.hpp" @@ -21,7 +23,6 @@ #include "NumericalAlgorithms/LinearOperators/PartialDerivatives.hpp" #include "PointwiseFunctions/GeneralRelativity/Christoffel.hpp" #include "PointwiseFunctions/GeneralRelativity/DerivativesOfSpacetimeMetric.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp" #include "PointwiseFunctions/GeneralRelativity/Shift.hpp" diff --git a/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_ComputeGhQuantities.cpp b/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_ComputeGhQuantities.cpp index 278d91795112..b401d3c93435 100644 --- a/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_ComputeGhQuantities.cpp +++ b/tests/Unit/PointwiseFunctions/GeneralRelativity/Test_ComputeGhQuantities.cpp @@ -16,6 +16,8 @@ #include "DataStructures/DataBox/Prefixes.hpp" // IWYU pragma: keep #include "DataStructures/DataVector.hpp" #include "DataStructures/Tensor/EagerMath/DeterminantAndInverse.hpp" +#include "DataStructures/Tensor/EagerMath/RaiseOrLowerIndex.hpp" +#include "DataStructures/Tensor/EagerMath/Trace.hpp" #include "DataStructures/Tensor/Tensor.hpp" #include "Domain/CoordinateMaps/Affine.hpp" #include "Domain/CoordinateMaps/CoordinateMap.hpp" @@ -61,7 +63,6 @@ #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/TimeDerivOfShift.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/TimeDerivOfSpatialMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/GeneralizedHarmonic/TimeDerivativeOfSpacetimeMetric.hpp" -#include "PointwiseFunctions/GeneralRelativity/IndexManipulation.hpp" #include "PointwiseFunctions/GeneralRelativity/InverseSpacetimeMetric.hpp" #include "PointwiseFunctions/GeneralRelativity/Lapse.hpp" #include "PointwiseFunctions/GeneralRelativity/Shift.hpp"