22 #ifndef LAPLACE_3D_SINGULAR_INTEGRALS_HPP_INCLUDED
23 #define LAPLACE_3D_SINGULAR_INTEGRALS_HPP_INCLUDED
25 #include "../core/match_types.hpp"
26 #include "../core/singular_integral_shortcut.hpp"
27 #include "../util/math_functions.hpp"
28 #include "field_type_helpers.hpp"
32 #include "normal_derivative_singular_integrals.hpp"
34 #include "quadrature_store_helper.hpp"
36 #include <boost/math/constants/constants.hpp>
38 #define NIHU_PRINT_DEBUG
39 #ifdef NIHU_PRINT_DEBUG
56 template <
class elem_t>
59 using namespace boost::math::double_constants;
61 #ifdef NIHU_PRINT_DEBUG
62 static bool printed =
false;
64 std::cout <<
"Using laplace_3d_SLP_collocation_constant_plane" << std::endl;
69 enum { N = elem_t::domain_t::num_corners };
70 double r[N], theta[N], alpha[N], result = 0.;
73 for (
unsigned i = 0; i < N; ++i)
74 result += r[i] * std::sin(alpha[i]) *
75 std::log(std::tan((alpha[i] + theta[i]) / 2.) / std::tan(alpha[i] / 2.));
77 return result / (4. * pi);
92 template <
class elem_t>
95 using namespace boost::math::double_constants;
97 #ifdef NIHU_PRINT_DEBUG
98 static bool printed =
false;
100 std::cout <<
"Using laplace_3d_HSP_collocation_constant_plane" << std::endl;
105 enum { N = elem_t::domain_t::num_corners };
106 double r[N], theta[N], alpha[N], result = 0.;
109 for (
unsigned i = 0; i < N; ++i)
110 result += (std::cos(alpha[i] + theta[i]) - std::cos(alpha[i])) / (r[i] * std::sin(alpha[i]));
112 return result / (4. * pi);
121 template <
class TestField,
class TrialField>
124 typename std::enable_if<
125 is_collocational<TestField, TrialField>::value &&
126 is_constant_tria<TrialField>::value
136 template <
class result_t>
146 trial_field.
get_elem().get_center());
156 template <
class TestField,
class TrialField>
159 typename std::enable_if<
160 is_collocational<TestField, TrialField>::value &&
161 is_constant_tria<TrialField>::value
171 template <
class result_t>
181 trial_field.
get_elem().get_center());
191 template <
class TestField,
class TrialField>
194 typename std::enable_if<
195 is_collocational<TestField, TrialField>::value &&
196 is_constant_tria<TrialField>::value
206 template <
class result_t>
217 trial_field.
get_elem().get_center());
227 template <
class TestField,
class TrialField>
230 typename std::enable_if<
231 is_collocational<TestField, TrialField>::value &&
232 !is_constant_tria<TrialField>::value
243 template <
class result_t>
251 #ifdef NIHU_PRINT_DEBUG
252 static bool printed =
false;
254 std::cout <<
"Using guiggiani for laplace_3d_HSP_kernel" << std::endl;
259 auto const &elem = trial_field.
get_elem();
260 guiggiani_t gui(elem, kernel.derived());
261 for (
unsigned r = 0; r < TestField::num_dofs; ++r)
263 auto const &xi0 = TestField::nset_t::corner_at(r);
264 gui.integrate(result.row(r), xi0, elem.get_normal(xi0));