7 #ifndef NIHU_P2P_INTEGRAL_HPP_INCLUDED
8 #define NIHU_P2P_INTEGRAL_HPP_INCLUDED
15 #include "../core/double_integral.hpp"
16 #include "../core/single_integral.hpp"
18 #include "../util/matrix_traits.hpp"
19 #include "../util/type2tag.hpp"
21 #include <type_traits>
28 template <
class Operator,
class TestField,
class TrialField>
31 template <
class Operator,
class TestField,
class TrialField>
35 template <
class Operator,
class TestField,
class TrialField>
38 typedef TestField test_input_t;
39 typedef TrialField trial_input_t;
42 typename std::decay<Operator>::type::kernel_t,
49 template <
class TestField,
class TrialField>
52 typedef TestField test_input_t;
53 typedef TrialField trial_input_t;
61 template <
class Operator,
class TestField,
class TrialField>
64 ,
public fmm_operator<typename std::decay<Operator>::type::fmm_tag>
69 typedef typename base_t::test_input_t test_input_t;
70 typedef typename base_t::trial_input_t trial_input_t;
71 typedef typename base_t::result_t result_t;
73 typedef typename std::decay<Operator>::type operator_t;
74 typedef TestField test_field_t;
75 typedef TrialField trial_field_t;
77 typedef typename operator_t::kernel_t
kernel_t;
81 : m_kernel(op.get_kernel())
82 , m_singular_check(sing_check)
86 size_t rows(test_input_t
const &tsi)
const
91 size_t cols(trial_input_t
const &tri)
const
93 return num_cols<result_t>::value;
96 result_t operator()(test_input_t
const &x, trial_input_t
const &y)
const
99 return double_integral_t::eval(
103 return double_integral_t::eval(
110 bool const m_singular_check;
114 template <
class TestField,
class TrialField>
117 ,
public fmm_operator<typename identity_p2p_operator::fmm_tag>
122 typedef typename base_t::test_input_t test_input_t;
123 typedef typename base_t::trial_input_t trial_input_t;
124 typedef typename base_t::result_t result_t;
126 typedef TestField test_field_t;
127 typedef TrialField trial_field_t;
135 size_t rows(test_input_t
const &tsi)
const
140 size_t cols(trial_input_t
const &tri)
const
145 result_t
operator()(test_input_t
const &x, trial_input_t
const &y)
const
148 bool on_same_elem = &x.get_elem() == &y.get_elem();
150 return single_integral_t::eval(x, y);
151 return result_t::Zero();
157 template <
class Operator,
class TestTag,
class TrialTag>
158 auto create_p2p_integral(Operator &&op, TestTag, TrialTag,
bool sing_check)
162 return p2p_integral<Operator, test_field_t, trial_field_t>(std::forward<Operator>(op), sing_check);
165 template <
class TestTag,
class TrialTag>
166 auto create_identity_p2p_integral(TestTag, TrialTag)
168 typedef typename tag2type<TestTag>::type test_field_t;
169 typedef typename tag2type<TrialTag>::type trial_field_t;
170 return p2p_integral<identity_p2p_operator, test_field_t, trial_field_t>(identity_p2p_operator());