24 #ifndef WEIGHTED_RESIDUAL_HPP_INCLUDED
25 #define WEIGHTED_RESIDUAL_HPP_INCLUDED
27 #include <type_traits>
29 #include "../tmp/bool.hpp"
30 #include "../util/crtp_base.hpp"
42 template <
class Derived>
53 template <
class result_t>
54 result_t &
eval(result_t &result)
const
56 return derived().eval(result);
65 template <
class TestSpace,
class Projection>
67 public wr_base<weighted_residual<TestSpace, Projection> >
77 m_test(std::forward<TestSpace>(test)),
78 m_proj(std::forward<Projection>(proj))
87 template <
class result_t>
88 result_t &
eval(result_t &result)
const
90 m_proj.test_on_into(m_test, result);
107 wr_base<typename std::decay<Wr>::type>,
108 typename std::decay<Wr>::type
116 template <
class Left,
class Right>
118 public wr_base<wr_sum<Left, Right> >
126 m_lhs(std::forward<Left>(left)), m_rhs(std::forward<Right>(right))
135 template <
class result_t>
136 result_t &
eval(result_t &result)
const
155 template <
class LeftWr,
class RightWr>
157 typename std::enable_if<is_weighted_residual<LeftWr>::value, LeftWr>::type,
158 typename std::enable_if<is_weighted_residual<RightWr>::value, RightWr>::type
160 operator+(LeftWr &&lhs, RightWr &&rhs)
163 std::forward<LeftWr>(lhs),
164 std::forward<RightWr>(rhs));
176 template <
class Test,
class Proj>
178 typename std::enable_if<is_function_space<Test>::value, Test>::type,
179 typename std::enable_if<is_integral_transform<Proj>::value, Proj>::type
181 operator *(Test &&test, Proj &&proj)
184 std::forward<Test>(test),
185 std::forward<Proj>(proj));
197 template <
class WR,
class Res>
198 typename std::enable_if<
199 is_weighted_residual<WR>::value && is_result_matrix<Res>::value,
202 operator << (Res &res, WR &&wr)
210 #endif // ifndef WEIGHTED_RESIDUAL_HPP_INCLUDED