Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mfem
Submodule mfem updated 93 files
+1 −1 .github/actions/sanitize/mfem/action.yml
+1 −1 .github/actions/sanitize/restore/action.yml
+2 −2 .github/workflows/sanitize-tests.yml
+5 −0 .gitlab/jobs/dane.yml
+5 −0 .gitlab/jobs/matrix.yml
+2 −2 .gitlab/scripts/baseline
+6 −8 CHANGELOG
+8 −0 CONTRIBUTING.md
+1 −0 NOTICE
+4 −0 config/cmake/MFEMConfig.cmake.in
+3 −3 config/cmake/modules/FindUMPIRE.cmake
+1 −1 examples/CMakeLists.txt
+1 −1 examples/amgx/makefile
+3 −3 examples/caliper/makefile
+11 −52 examples/ex37.cpp
+183 −23 examples/ex37.hpp
+11 −60 examples/ex37p.cpp
+1 −1 examples/ginkgo/makefile
+5 −2 examples/makefile
+4 −0 fem/CMakeLists.txt
+3 −0 fem/coefficient.hpp
+18 −5 fem/datacollection.cpp
+92 −1 fem/dfem/tuple.hpp
+1 −1 fem/dgmassinv_kernels.hpp
+6 −6 fem/estimators.hpp
+11 −11 fem/gridfunc.cpp
+24 −8 fem/gridfunc.hpp
+2,431 −216 fem/gslib.cpp
+343 −67 fem/gslib.hpp
+15 −13 fem/gslib/findpts_local_2.cpp
+16 −16 fem/gslib/findpts_local_3.cpp
+725 −0 fem/gslib/findptsedge_local_2.cpp
+733 −0 fem/gslib/findptsedge_local_3.cpp
+1,257 −0 fem/gslib/findptssurf_local_3.cpp
+157 −0 fem/gslib/interpolate_local_1.cpp
+19 −19 fem/gslib/interpolate_local_2.cpp
+18 −19 fem/gslib/interpolate_local_3.cpp
+76 −48 fem/integ/bilininteg_mass_kernels.hpp
+33 −37 fem/intrules.hpp
+2 −2 fem/lininteg.hpp
+2 −2 fem/pgridfunc.cpp
+6 −5 fem/pgridfunc.hpp
+66 −10 fem/tmop.cpp
+62 −11 fem/tmop.hpp
+119 −0 fem/tmop/assemble/diag2_limit.cpp
+159 −0 fem/tmop/assemble/diag3_limit.cpp
+197 −0 fem/tmop/assemble/grad2_limit.cpp
+248 −0 fem/tmop/assemble/grad3_limit.cpp
+120 −0 fem/tmop/mult/grad2_limit.cpp
+131 −0 fem/tmop/mult/grad3_limit.cpp
+86 −0 fem/tmop/mult/mult2_limit.cpp
+91 −0 fem/tmop/mult/mult3_limit.cpp
+121 −3 fem/tmop/pa.cpp
+77 −0 fem/tmop/tools/energy2_limit.cpp
+78 −0 fem/tmop/tools/energy3_limit.cpp
+21 −4 general/array.cpp
+39 −0 general/binaryio.hpp
+6 −0 general/forall.hpp
+33 −11 makefile
+2 −1 mesh/CMakeLists.txt
+414 −0 mesh/bb_grid_map.cpp
+199 −0 mesh/bb_grid_map.hpp
+839 −14 mesh/gmsh.cpp
+0 −55 mesh/gmsh.hpp
+9 −2 mesh/mesh.cpp
+4 −1 mesh/mesh.hpp
+1 −0 mesh/mesh_headers.hpp
+0 −3 mesh/mesh_operators.cpp
+0 −1 mesh/mesh_operators.hpp
+0 −1,335 mesh/mesh_readers.cpp
+17 −3 mesh/submesh/psubmesh.hpp
+14 −0 mesh/submesh/submesh.hpp
+54 −5 miniapps/electromagnetics/CMakeLists.txt
+2 −2 miniapps/electromagnetics/makefile
+10 −2 miniapps/gslib/CMakeLists.txt
+130 −66 miniapps/gslib/findpts.cpp
+6 −1 miniapps/gslib/makefile
+77 −53 miniapps/gslib/pfindpts.cpp
+1 −0 miniapps/hooke/hooke.cpp
+1 −0 miniapps/meshing/CMakeLists.txt
+1 −0 miniapps/meshing/fit-node-position.cpp
+1 −1 miniapps/meshing/makefile
+7 −8 miniapps/meshing/mesh-optimizer.cpp
+13 −4 miniapps/meshing/mesh-optimizer.hpp
+8 −9 miniapps/meshing/pmesh-optimizer.cpp
+568 −0 miniapps/meshing/stretched3D.mesh
+21 −24 miniapps/plasma/makefile
+4 −3 miniapps/plasma/pic/makefile
+1 −0 tests/unit/CMakeLists.txt
+1 −1 tests/unit/fem/test_particleset.cpp
+164 −0 tests/unit/mesh/test_bb_grid_map.cpp
+39 −0 tests/unit/mesh/test_mesh.cpp
+100 −18 tests/unit/miniapps/test_tmop_pa.cpp
221 changes: 0 additions & 221 deletions src/smith/numerics/functional/tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
typename T8, typename T9>
struct tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> {
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 <typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
typename T8, typename T9, typename T10>
struct tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {
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 <int i, typename Tuple>
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 <int i, typename Tuple>
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 <int i, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
typename T8, typename T9>
MFEM_HOST_DEVICE constexpr auto& get(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& values)
{
static_assert(i < 10);
return detail::tuple_get_extended<i>(values);
}

/// @brief Return mutable element @p i from an 11-element tuple.
template <int i, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
typename T8, typename T9, typename T10>
MFEM_HOST_DEVICE constexpr auto& get(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& values)
{
static_assert(i < 11);
return detail::tuple_get_extended<i>(values);
}

/// @brief Return const element @p i from a 10-element tuple.
template <int i, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
typename T8, typename T9>
MFEM_HOST_DEVICE constexpr const auto& get(const tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& values)
{
static_assert(i < 10);
return detail::tuple_get_extended<i>(values);
}

/// @brief Return const element @p i from an 11-element tuple.
template <int i, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
typename T8, typename T9, typename T10>
MFEM_HOST_DEVICE constexpr const auto& get(const tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& values)
{
static_assert(i < 11);
return detail::tuple_get_extended<i>(values);
}

/**
* @brief a function intended to be used for extracting the ith type from a tuple.
*
* @note type<i>(my_tuple) returns a value, whereas get<i>(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 <int i, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
typename T8, typename T9>
MFEM_HOST_DEVICE constexpr auto type(const tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& values)
{
static_assert(i < 10);
return detail::tuple_get_extended<i>(values);
}

/**
* @brief a function intended to be used for extracting the ith type from a tuple.
*
* @note type<i>(my_tuple) returns a value, whereas get<i>(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 <int i, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
typename T8, typename T9, typename T10>
MFEM_HOST_DEVICE constexpr auto type(const tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& values)
{
static_assert(i < 11);
return detail::tuple_get_extended<i>(values);
}

} // namespace mfem::future

namespace smith {

/// @brief Expose MFEM tuple in the Smith namespace.
Expand Down
Loading