NiHu  2.0
fmm_integrated.hpp
Go to the documentation of this file.
1 
7 #ifndef NIHU_FMM_INTEGRATED_HPP_INCLUDED
8 #define NIHU_FMM_INTEGRATED_HPP_INCLUDED
9 
10 #include "p2x_integral.hpp"
11 #include "x2p_integral.hpp"
12 #include "p2p_integral.hpp"
13 
14 
15 namespace NiHu
16 {
17 namespace fmm
18 {
19 
25 template <class Op, class FmmTag = typename std::decay<Op>::type::fmm_tag>
26 class integrated;
27 
29 template <class Op>
30 class integrated<Op, m2p_tag>
31 {
32 public:
33  template <class TestTag, class TrialTag>
34  static auto eval(Op &&op, TestTag test_tag, TrialTag trial_tag, size_t quadrature_order, bool sing_check)
35  {
36  return create_x2p_integral(
37  std::forward<Op>(op), quadrature_order, test_tag);
38  }
39 };
40 
42 template <class Op>
43 class integrated<Op, l2p_tag>
44 {
45 public:
46  template <class TestTag, class TrialTag>
47  static auto eval(Op &&op, TestTag test_tag, TrialTag trial_tag, size_t quadrature_order, bool sing_check)
48  {
49  return create_x2p_integral(
50  std::forward<Op>(op), quadrature_order, test_tag);
51  }
52 };
53 
55 template <class Op>
56 class integrated<Op, p2m_tag>
57 {
58 public:
59  template <class TestTag, class TrialTag>
60  static auto eval(Op &&op, TestTag test_tag, TrialTag trial_tag, size_t quadrature_order, bool sing_check)
61  {
62  return create_p2x_integral(
63  std::forward<Op>(op), quadrature_order, trial_tag);
64  }
65 };
66 
67 
69 template <class Op>
70 class integrated<Op, p2l_tag> {
71 public:
72  template <class TestTag, class TrialTag>
73  static auto eval(Op &&op, TestTag test_tag, TrialTag trial_tag, size_t quadrature_order, bool sing_check)
74  {
75  return create_p2x_integral(
76  std::forward<Op>(op), quadrature_order, trial_tag);
77  }
78 };
79 
80 
82 template <class Op>
83 class integrated<Op, p2p_tag> {
84 public:
85  template <class TestTag, class TrialTag>
86  static auto eval(Op &&op, TestTag test_tag, TrialTag trial_tag, size_t quadrature_order, bool sing_check)
87  {
88  return create_p2p_integral(std::forward<Op>(op), test_tag, trial_tag, sing_check);
89  }
90 };
91 
92 
93 
94 template <class Op, class TestTag, class TrialTag>
95 auto create_integrated(Op &&op, TestTag test_tag, TrialTag trial_tag, size_t quadrature_order, bool sing_check)
96 {
97  return integrated<Op>::eval(std::forward<Op>(op), test_tag, trial_tag, quadrature_order, sing_check);
98 }
99 
100 
101 template <class TestTag, class TrialTag>
103 {
104  integrated_functor(size_t quadrature_order, bool sing_check)
105  : m_quadrature_order(quadrature_order)
106  , m_sing_check(sing_check)
107  {
108  }
109 
110  template <class Op>
111  auto operator()(Op &&op) const
112  {
113  return create_integrated(std::forward<Op>(op), TestTag(), TrialTag(),
114  m_quadrature_order,
115  m_sing_check);
116  }
117 
118  size_t m_quadrature_order;
119  bool m_sing_check;
120 };
121 
130 template <class TestTag, class TrialTag>
132  TestTag test_tag, TrialTag trial_tag,
133  size_t quadrature_order, bool sing_check)
134 {
136  quadrature_order, sing_check);
137 }
138 
139 } // end of namespace fmm
140 } // end of namespace NiHu
141 
142 #endif /* NIHU_FMM_INTEGRATED_HPP_INCLUDED */
NiHu::fmm::op_tags::l2p
Definition: fmm_operator.hpp:26
NiHu::fmm::integrated
Generic integrated FMM operator.
Definition: fmm_integrated.hpp:26
p2x_integral.hpp
Implementation of class template NiHu::fmm::p2x_integral.
p2p_integral.hpp
P2P integral.
x2p_integral.hpp
Implementation of class template NiHu::fmm::x2p_integral.
NiHu::fmm::op_tags::p2l
Definition: fmm_operator.hpp:25
NiHu::fmm::op_tags::p2m
Definition: fmm_operator.hpp:24
NiHu::fmm::integrated_functor
Definition: fmm_integrated.hpp:102
NiHu::fmm::op_tags::p2p
Definition: fmm_operator.hpp:29
NiHu::fmm::create_integrated_functor
auto create_integrated_functor(TestTag test_tag, TrialTag trial_tag, size_t quadrature_order, bool sing_check)
factory function to create an integrated functor
Definition: fmm_integrated.hpp:131
NiHu::fmm::op_tags::m2p
Definition: fmm_operator.hpp:27