27 #ifndef MATSUMOTO_2010_HPP_INCLUDED
28 #define MATSUMOTO_2010_HPP_INCLUDED
30 #include "../core/element_match.hpp"
31 #include "../core/integral_operator.hpp"
32 #include "../core/singular_integral_shortcut.hpp"
33 #include "../core/match_types.hpp"
37 #include <boost/math/constants/constants.hpp>
43 namespace matsumoto_internal
47 template <
unsigned order>
55 template <
unsigned order>
64 template <
class WaveNumber,
class TestField,
class TrialField>
67 typename std::enable_if<
68 std::is_same<typename get_formalism<TestField, TrialField>::type, formalism::collocational>::value &&
69 std::is_same<typename TrialField::lset_t, tria_1_shape_set>::value &&
70 std::is_same<typename TrialField::nset_t, tria_0_shape_set>::value
82 template <
class result_t>
90 using namespace boost::math::double_constants;
93 std::complex<scalar_t>
const I(0.0, 1.0);
95 auto const &k = kernel.derived().get_wave_number();
98 auto const &tr_elem = trial_field.
get_elem();
99 unsigned const N = tria_1_elem::num_nodes;
102 auto const &coords = tr_elem.get_coords();
103 auto const &x0 = tr_elem.get_center();
105 for(
unsigned i = 0; i < N; ++i)
108 x_t
const D = coords.col((i+1)%N) - coords.col(i);
112 for (
auto it = quadr_t::quadrature.begin(); it != quadr_t::quadrature.end(); ++it)
115 x_t
const x1 = coords.col((i+1)%N) * (1.0 + it->get_xi()(0))/2
116 + coords.col(i) * (1.0 - it->get_xi()(0))/2;
118 x_t
const R = x1 - x0;
121 double tmp = R.dot(D) / (r*l);
122 double jac = sqrt(1.0 -
tmp*
tmp) / r * l / 2.0;
124 result(0,0) += jac * it->get_w() * (std::exp(-I*k*r) / r);
127 result(0,0) /= (-4 * pi);
128 result(0,0) -= I*k / 2.0;
132 enum { quadrature_order = 31 };
133 typedef matsumoto_internal::line_quad_store<quadrature_order> quadr_t;
134 typedef typename tria_1_elem::xi_t xi_t;
135 typedef typename tria_1_elem::x_t x_t;
136 typedef typename kernel_base<helmholtz_3d_HSP_kernel<WaveNumber> >::scalar_t scalar_t;
144 template <
class WaveNumber,
class TestField,
class TrialField>
147 typename std::enable_if<
148 std::is_same<typename get_formalism<TestField, TrialField>::type, formalism::collocational>::value &&
149 std::is_same<typename TrialField::lset_t, tria_1_shape_set>::value &&
150 std::is_same<typename TrialField::nset_t, tria_0_shape_set>::value
162 template <
class result_t>
170 using namespace boost::math::double_constants;
173 std::complex<scalar_t>
const I(0.0, 1.0);
175 auto const &k = kernel.derived().get_wave_number();
178 auto const &tr_elem = trial_field.
get_elem();
179 unsigned const N = tria_1_elem::num_nodes;
182 auto const &coords = tr_elem.get_coords();
183 auto const &x0 = tr_elem.get_center();
185 for(
unsigned i = 0; i < N; ++i)
188 x_t
const D = coords.col((i+1)%N) - coords.col(i);
193 for (
auto it = quadr_t::quadrature.begin(); it != quadr_t::quadrature.end(); ++it)
196 x_t
const x1 = coords.col((i+1)%N) * (1.0 + it->get_xi()(0))/2
197 + coords.col(i) * (1.0 - it->get_xi()(0))/2;
200 x_t
const R = x1 - x0;
203 double tmp = R.dot(D) / (r*l);
204 double jac = sqrt(1.0 -
tmp*
tmp) / r * l / 2.0;
206 result(0,0) += jac * it->get_w() * (std::exp(-I*k*r));
209 result(0,0) *= I / (4.0 * pi * k);
210 result(0,0) -= I/(2*k);
214 enum { quadrature_order = 31 };
215 typedef matsumoto_internal::line_quad_store<quadrature_order> quadr_t;
216 typedef typename tria_1_elem::xi_t xi_t;
217 typedef typename tria_1_elem::x_t x_t;
218 typedef typename kernel_base<helmholtz_3d_SLP_kernel<WaveNumber> >::scalar_t scalar_t;