Commit e7830a61 authored by Quentin Khan's avatar Quentin Khan

Update the kernel operator traits to fit the new kernel data layout

parent 1dc27b23
......@@ -3,10 +3,12 @@
#include <type_traits>
#include "Utils/Contribs/inria/logic.hpp"
#include "Containers/FTreeCoordinate.hpp"
namespace scalfmm {
namespace sfinae {
namespace meta {
namespace details {
#ifdef declare_has_method
......@@ -42,8 +44,10 @@ namespace scalfmm {
enum : bool {
value =
details::has_M2P<Kernel, void,
typename Tree::node_t::data_t*,
typename Tree::node_t::particle_container_t*
typename Tree::node_t::data_t::multipole_t*,
typename Tree::node_t::symbolic_data_t*,
typename Tree::node_t::particle_container_t*,
typename Tree::node_t::symbolic_data_t*
>::value
};
};
......@@ -53,8 +57,10 @@ namespace scalfmm {
enum : bool {
value =
details::has_P2L<Kernel, void,
typename Tree::node_t::data_t*,
typename Tree::node_t::particle_container_t*
typename Tree::node_t::data_t::local_expansion_t*,
typename Tree::node_t::symbolic_data_t*,
typename Tree::node_t::particle_container_t*,
typename Tree::node_t::symbolic_data_t*
>::value
};
};
......@@ -64,7 +70,8 @@ namespace scalfmm {
enum : bool {
value =
details::has_P2M<Kernel, void,
typename Tree::node_t::data_t*,
typename Tree::node_t::data_t::multipole_t*,
typename Tree::node_t::symbolic_data_t*,
typename Tree::node_t::particle_container_t*
>::value
};
......@@ -75,9 +82,10 @@ namespace scalfmm {
enum : bool {
value =
details::has_M2M<Kernel, void,
typename Tree::node_t::data_t*,
typename Tree::node_t::data_t**,
int
typename Tree::node_t::data_t::multipole_t*,
typename Tree::node_t::symbolic_data_t*,
typename Tree::node_t::data_t::multipole_t**,
typename Tree::node_t::symbolic_data_t**
>::value
};
};
......@@ -87,9 +95,11 @@ namespace scalfmm {
enum : bool {
value =
details::has_M2L<Kernel, void,
typename Tree::node_t::data_t*,
typename Tree::node_t::data_t const**,
int*, int, int
typename Tree::node_t::data_t::local_expansion_t*,
typename Tree::node_t::symbolic_data_t*,
typename Tree::node_t::data_t::multipole_t**,
typename Tree::node_t::symbolic_data_t**,
int*, int
>::value
};
};
......@@ -99,9 +109,10 @@ namespace scalfmm {
enum : bool {
value =
details::has_L2L<Kernel, void,
typename Tree::node_t::data_t*,
typename Tree::node_t::data_t**,
int
typename Tree::node_t::data_t::local_expansion_t*,
typename Tree::node_t::symbolic_data_t*,
typename Tree::node_t::data_t::local_expansion_t**,
typename Tree::node_t::symbolic_data_t**
>::value
};
};
......@@ -111,7 +122,8 @@ namespace scalfmm {
enum : bool {
value =
details::has_L2P<Kernel, void,
typename Tree::node_t::data_t*,
typename Tree::node_t::data_t::local_expansion_t*,
typename Tree::node_t::symbolic_data_t*,
typename Tree::node_t::particle_container_t*
>::value
};
......@@ -131,7 +143,7 @@ namespace scalfmm {
};
};
template<typename Tree, typename Kernel>
template<typename Tree, typename Kernel>
struct has_partial_P2P {
enum : bool {
value =
......@@ -145,6 +157,36 @@ namespace scalfmm {
};
};
template<class Tree, class Kernel>
using adaptive_compatible = inria::conjunction<
has_P2M<Tree, Kernel>,
has_M2M<Tree, Kernel>,
has_M2L<Tree, Kernel>,
has_L2L<Tree, Kernel>,
has_L2P<Tree, Kernel>,
has_P2P<Tree, Kernel>,
has_M2P<Tree, Kernel>,
has_P2L<Tree, Kernel>
>;
template<class Tree, class Kernel>
constexpr bool check_adaptive_compatible() noexcept {
#ifdef CHECK_CONCEPT_FAILURE
#error "Macro CHECK_CONCEPT_FAILURE is already defined..."
#endif
#define CHECK_CONCEPT_FAILURE(NAME) \
static_assert(has_##NAME<Tree,Kernel>::value, #NAME);
CHECK_CONCEPT_FAILURE(P2M);
CHECK_CONCEPT_FAILURE(M2M);
CHECK_CONCEPT_FAILURE(M2L);
CHECK_CONCEPT_FAILURE(L2L);
CHECK_CONCEPT_FAILURE(L2P);
CHECK_CONCEPT_FAILURE(P2P);
CHECK_CONCEPT_FAILURE(M2P);
CHECK_CONCEPT_FAILURE(P2L);
#undef CHECK_CONCEPT_FAILURE
return adaptive_compatible<Tree,Kernel>::value;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment