From 5c78ce74acc33ebfb166529c6ef2822ed778d070 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 19 May 2026 16:45:23 -0700 Subject: [PATCH 1/2] bump mfem to branch that has extended tuple --- mfem | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mfem b/mfem index dbbd425a2..4de2705eb 160000 --- a/mfem +++ b/mfem @@ -1 +1 @@ -Subproject commit dbbd425a225b2ad0c3e1dc0e2b3992899e27556a +Subproject commit 4de2705ebf1c88b52e1ea93e76cf4f46a34b0f7d From b90636c82891a1f52dec5e8e6ccb50f31ca91a9a Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 19 May 2026 16:46:24 -0700 Subject: [PATCH 2/2] remove logic for extending tuple to 10 and 11 elements --- src/smith/numerics/functional/tuple.hpp | 221 ------------------------ 1 file changed, 221 deletions(-) diff --git a/src/smith/numerics/functional/tuple.hpp b/src/smith/numerics/functional/tuple.hpp index 9331b8ef0..f6fd60582 100644 --- a/src/smith/numerics/functional/tuple.hpp +++ b/src/smith/numerics/functional/tuple.hpp @@ -13,227 +13,6 @@ #include "mfem.hpp" -#include "smith/infrastructure/accelerator.hpp" - -namespace mfem::future { - -/** - * @brief Smith compatibility extension for the MFEM tuple implementation. - * - * MFEM's tuple copy currently stores up to nine elements, while Smith's - * historical tuple API supports ten and eleven elements. - */ -template -struct tuple { - T0 v0; ///< The first member of the tuple - T1 v1; ///< The second member of the tuple - T2 v2; ///< The third member of the tuple - T3 v3; ///< The fourth member of the tuple - T4 v4; ///< The fifth member of the tuple - T5 v5; ///< The sixth member of the tuple - T6 v6; ///< The seventh member of the tuple - T7 v7; ///< The eighth member of the tuple - T8 v8; ///< The ninth member of the tuple - T9 v9; ///< The tenth member of the tuple -}; - -/** - * @brief Smith compatibility extension for the MFEM tuple implementation. - */ -template -struct tuple { - T0 v0; ///< The first member of the tuple - T1 v1; ///< The second member of the tuple - T2 v2; ///< The third member of the tuple - T3 v3; ///< The fourth member of the tuple - T4 v4; ///< The fifth member of the tuple - T5 v5; ///< The sixth member of the tuple - T6 v6; ///< The seventh member of the tuple - T7 v7; ///< The eighth member of the tuple - T8 v8; ///< The ninth member of the tuple - T9 v9; ///< The tenth member of the tuple - T10 v10; ///< The eleventh member of the tuple -}; - -namespace detail { - -/// @brief Return element @p i from a 10- or 11-element tuple. -template -MFEM_HOST_DEVICE constexpr auto& tuple_get_extended(Tuple& values) -{ - if constexpr (i == 0) { - return values.v0; - } - if constexpr (i == 1) { - return values.v1; - } - if constexpr (i == 2) { - return values.v2; - } - if constexpr (i == 3) { - return values.v3; - } - if constexpr (i == 4) { - return values.v4; - } - if constexpr (i == 5) { - return values.v5; - } - if constexpr (i == 6) { - return values.v6; - } - if constexpr (i == 7) { - return values.v7; - } - if constexpr (i == 8) { - return values.v8; - } - if constexpr (i == 9) { - return values.v9; - } - if constexpr (i == 10) { - return values.v10; - } - MFEM_UNREACHABLE(); -} - -/// @brief Return const element @p i from a 10- or 11-element tuple. -template -MFEM_HOST_DEVICE constexpr const auto& tuple_get_extended(const Tuple& values) -{ - if constexpr (i == 0) { - return values.v0; - } - if constexpr (i == 1) { - return values.v1; - } - if constexpr (i == 2) { - return values.v2; - } - if constexpr (i == 3) { - return values.v3; - } - if constexpr (i == 4) { - return values.v4; - } - if constexpr (i == 5) { - return values.v5; - } - if constexpr (i == 6) { - return values.v6; - } - if constexpr (i == 7) { - return values.v7; - } - if constexpr (i == 8) { - return values.v8; - } - if constexpr (i == 9) { - return values.v9; - } - if constexpr (i == 10) { - return values.v10; - } - MFEM_UNREACHABLE(); -} - -} // namespace detail - -/// @brief Return mutable element @p i from a 10-element tuple. -template -MFEM_HOST_DEVICE constexpr auto& get(tuple& values) -{ - static_assert(i < 10); - return detail::tuple_get_extended(values); -} - -/// @brief Return mutable element @p i from an 11-element tuple. -template -MFEM_HOST_DEVICE constexpr auto& get(tuple& values) -{ - static_assert(i < 11); - return detail::tuple_get_extended(values); -} - -/// @brief Return const element @p i from a 10-element tuple. -template -MFEM_HOST_DEVICE constexpr const auto& get(const tuple& values) -{ - static_assert(i < 10); - return detail::tuple_get_extended(values); -} - -/// @brief Return const element @p i from an 11-element tuple. -template -MFEM_HOST_DEVICE constexpr const auto& get(const tuple& values) -{ - static_assert(i < 11); - return detail::tuple_get_extended(values); -} - -/** - * @brief a function intended to be used for extracting the ith type from a tuple. - * - * @note type(my_tuple) returns a value, whereas get(my_tuple) returns a reference - * - * @tparam i the index of the tuple to query - * @tparam T0 The first type stored in the tuple - * @tparam T1 The second type stored in the tuple - * @tparam T2 The third type stored in the tuple - * @tparam T3 The fourth type stored in the tuple - * @tparam T4 The fifth type stored in the tuple - * @tparam T5 The sixth type stored in the tuple - * @tparam T6 The seventh type stored in the tuple - * @tparam T7 The eighth type stored in the tuple - * @tparam T8 The ninth type stored in the tuple - * @tparam T9 The tenth type stored in the tuple - * @param values the tuple of values - * @return a copy of the ith entry of the input - */ -template -MFEM_HOST_DEVICE constexpr auto type(const tuple& values) -{ - static_assert(i < 10); - return detail::tuple_get_extended(values); -} - -/** - * @brief a function intended to be used for extracting the ith type from a tuple. - * - * @note type(my_tuple) returns a value, whereas get(my_tuple) returns a reference - * - * @tparam i the index of the tuple to query - * @tparam T0 The first type stored in the tuple - * @tparam T1 The second type stored in the tuple - * @tparam T2 The third type stored in the tuple - * @tparam T3 The fourth type stored in the tuple - * @tparam T4 The fifth type stored in the tuple - * @tparam T5 The sixth type stored in the tuple - * @tparam T6 The seventh type stored in the tuple - * @tparam T7 The eighth type stored in the tuple - * @tparam T8 The ninth type stored in the tuple - * @tparam T9 The tenth type stored in the tuple - * @tparam T10 The eleventh type stored in the tuple - * @param values the tuple of values - * @return a copy of the ith entry of the input - */ -template -MFEM_HOST_DEVICE constexpr auto type(const tuple& values) -{ - static_assert(i < 11); - return detail::tuple_get_extended(values); -} - -} // namespace mfem::future - namespace smith { /// @brief Expose MFEM tuple in the Smith namespace.