21 #ifndef stokes_SINGULAR_INTEGRALS_HPP_INCLUDED
22 #define stokes_SINGULAR_INTEGRALS_HPP_INCLUDED
24 #include <boost/math/constants/constants.hpp>
26 #include "../core/integral_operator.hpp"
27 #include "../core/singular_integral_shortcut.hpp"
30 #include "field_type_helpers.hpp"
41 typedef Eigen::Matrix<double, 2, 2> result_t;
49 using boost::math::double_constants::pi;
51 auto const &
C = elem.get_coords();
52 auto rvec = (
C.col(1) -
C.col(0)).
eval();
54 auto gradr = rvec.normalized();
57 - result_t::Identity() * (r * (2.*(std::log(r/2) - 1.) +1. ) )
59 2.* (gradr * gradr.transpose()) * r
67 template <
class TestField,
class TrialField>
70 typename std::enable_if<
71 is_collocational<TestField, TrialField>::value &&
72 is_constant_line<TrialField>::value
83 template <
class result_t>
92 trial_field.
get_elem(), kernel.derived().get_viscosity());
101 template <
class TestField,
class TrialField>
104 typename std::enable_if<
105 is_collocational<TestField, TrialField>::value &&
106 is_constant_line<TrialField>::value
117 template <
class result_t>
134 template <
class TestField,
class TrialField>
137 typename std::enable_if<
138 std::is_same<typename get_formalism<TestField, TrialField>::type, formalism::collocational>::value
148 template <
class result_t>
157 auto const &elem = trial_field.
get_elem();
158 guiggiani_t gui(elem, kernel.derived());
160 auto const &xi0 = TestField::nset_t::corner_at(0);
161 gui.integrate(result, xi0, elem.get_normal(xi0));
171 typedef Eigen::Matrix<double, 2, 2> result_t;
180 using boost::math::double_constants::pi;
182 auto const &
C = elem.get_coords();
183 auto rvec = (
C.col(1) -
C.col(0)).
eval();
184 auto r = rvec.norm();
185 auto gradr = rvec.normalized();
188 - result_t::Identity() * (2.*(std::log(r) - 1.5)+1.)
189 + 2.* (gradr * gradr.transpose())
199 template <
class TestField,
class TrialField>
202 typename std::enable_if<
203 std::is_same<typename get_formalism<TestField, TrialField>::type, formalism::general>::value &&
204 std::is_same<typename TrialField::elem_t::lset_t, line_1_shape_set>::value &&
205 std::is_same<typename TestField::nset_t, line_0_shape_set>::value &&
206 std::is_same<typename TrialField::nset_t, line_0_shape_set>::value
217 template <
class result_t>
226 trial_field.
get_elem(), kernel.derived().get_viscosity());
237 template <
class TestField,
class TrialField>
240 typename std::enable_if<
241 std::is_same<typename get_formalism<TestField, TrialField>::type, formalism::general>::value &&
242 std::is_same<typename TestField::elem_t::lset_t, line_1_shape_set>::value &&
243 std::is_same<typename TrialField::elem_t::lset_t, line_1_shape_set>::value &&
244 std::is_same<typename TestField::nset_t, line_0_shape_set>::value &&
245 std::is_same<typename TrialField::nset_t, line_0_shape_set>::value
257 template <
class result_t>
273 #endif // STOKES_SINGULAR_INTEGRALS_HPP_INCLUDED