23 #ifndef INTEGRAL_OPERATOR_HPP_INCLUDED
24 #define INTEGRAL_OPERATOR_HPP_INCLUDED
26 #include "../util/crtp_base.hpp"
30 #include "integral_transform_forward.hpp"
39 template <
class Derived>
45 template <
class Derived>
55 template <
class TestField,
class TrialField>
65 template <
class TestField,
class TrialField,
class OnSameMesh>
72 return derived().derived_eval_on_fields(test_field, trial_field, OnSameMesh());
79 template <
class FuncSpace>
82 typename std::enable_if<is_function_space<FuncSpace>::value, FuncSpace>::type
88 std::forward<FuncSpace>(funcspace));
93 template <
class IntOp>
95 integral_operator_base<typename std::decay<IntOp>::type>,
96 typename std::decay<IntOp>::type
101 template <
class Scalar,
class IntOp>
106 template <
class Scalar,
class IntOp>
110 template <
class TestField,
class TrialField>
112 typename product_type<
114 typename integral_operator_traits<
115 typename std::decay<IntOp>::type
116 >::template wr_result_type<TestField, TrialField>::type
122 typename std::decay<IntOp>::type
131 template <
class Scalar,
class IntOp>
147 m_scalar(std::forward<Scalar>(
scalar)),
148 m_parent(std::forward<IntOp>(parent))
159 template <
class TestField,
class TrialField,
class OnSameMesh>
160 typename base_t::template wr_result_type<TestField, TrialField>::type
166 return m_scalar * m_parent.eval_on_fields(test_field, trial_field, OnSameMesh());
184 template <
class Scalar,
class IntOp>
185 scaled_integral_operator<
187 typename std::enable_if<is_integral_operator<IntOp>::value, IntOp>::type
192 std::forward<Scalar>(
scalar),
193 std::forward<IntOp>(intop));
198 template <
class LhsOp,
class RhsOp>
201 template <
class LhsOp,
class RhsOp>
205 template <
class TestField,
class TrialField>
208 typename integral_operator_traits<
209 typename std::decay<LhsOp>::type
210 >::template wr_result_type<TestField, TrialField>::type,
211 typename integral_operator_traits<
212 typename std::decay<RhsOp>::type
213 >::template wr_result_type<TestField, TrialField>::type
219 typename std::decay<LhsOp>::type
221 typename std::decay<RhsOp>::type
227 ,
"You cannot form the sum of operators with different locality");
231 template <
class LhsOp,
class RhsOp>
239 ,
"You cannot form the sum of operators with different locality");
248 m_lhs(std::forward<LhsOp>(lhs)),
249 m_rhs(std::forward<RhsOp>(rhs))
260 template <
class TestField,
class TrialField,
class OnSameMesh>
261 typename base_t::template wr_result_type<TestField, TrialField>::type
267 return m_lhs.eval_on_fields(test_field, trial_field, OnSameMesh()) + m_rhs.eval_on_fields(test_field, trial_field, OnSameMesh());
278 template <
class LhsOp,
class RhsOp>
279 sum_integral_operator<
280 typename std::enable_if<is_integral_operator<LhsOp>::value, LhsOp>::type,
281 typename std::enable_if<is_integral_operator<RhsOp>::value, RhsOp>::type
283 operator+(LhsOp &&lhs, RhsOp &&rhs)
285 return sum_integral_operator<LhsOp, RhsOp>(
286 std::forward<LhsOp>(lhs),
287 std::forward<RhsOp>(rhs));
293 class identity_integral_operator;
299 template <
class TestField,
class TrialField>
300 struct wr_result_type
306 static bool const is_local =
true;
324 template <
class TestField,
class TrialField,
class OnSameMesh = std::false_type>
325 typename base_t::template wr_result_type<TestField, TrialField>::type
338 template <
class Kernel>
344 template <
class Kernel>
348 template <
class TestField,
class TrialField>
349 struct wr_result_type
355 static bool const is_local =
false;
363 template <
class Kernel>
372 typedef typename std::decay<Kernel>::type
kernel_t;
378 m_kernel(std::forward<Kernel>(kernel))
397 template <
class TestField,
class TrialField,
class OnSameMesh>
398 typename base_t::template wr_result_type<TestField, TrialField>::type
405 m_kernel, test_field, trial_field, OnSameMesh());
419 template <
class Kernel>
420 integral_operator<Kernel>