NiHu  2.0
convected_helmholtz_3d_singular_integrals.hpp
1 #ifndef NIHU_CONVECTED_HELMHOLTZ_3D_SINGULAR_INTEGRALS_HPP_INCLUDED
2 #define NIHU_CONVECTED_HELMHOLTZ_3D_SINGULAR_INTEGRALS_HPP_INCLUDED
3 
4 #include "core/element_match.hpp"
5 #include "core/singular_integral_shortcut.hpp"
6 
7 #include "convected_helmholtz_3d_kernel.hpp"
8 #include "field_type_helpers.hpp"
9 
10 #define NIHU_GUIGGIANI_DEBUGGING 1
11 
12 namespace NiHu
13 {
14 
20 template <class WaveNumber, class TestField, class TrialField>
22  convected_helmholtz_3d_DLPt_kernel<WaveNumber>, TestField, TrialField, match::match_2d_type,
23  typename std::enable_if<
24  is_collocational<TestField, TrialField>::value
25  >::type
26 >
27 {
28 public:
35  template <class result_t>
36  static result_t &eval(
37  result_t &result,
39  field_base<TestField> const &,
40  field_base<TrialField> const &trial_field,
41  element_match const &)
42  {
43 #if NIHU_GUIGGIANI_DEBUGGING
44  static bool printed = false;
45  if (!printed)
46  {
47  std::cout << "Calling Guiggiani for convected_helmholtz_3d_DLPt_kernel now" << std::endl;
48  printed = true;
49  }
50 #endif
52  auto const &elem = trial_field.get_elem();
53  guiggiani_t gui(elem, kernel.derived());
54  for (unsigned r = 0; r < TestField::num_dofs; ++r)
55  {
56  auto const &xi0 = TestField::nset_t::corner_at(r);
57  gui.integrate(result.row(r), xi0, elem.get_normal(xi0));
58  }
59 
60  return result;
61  }
62 };
63 
64 
70 template <class WaveNumber, class TestField, class TrialField>
72  convected_helmholtz_3d_DLPt_n_kernel<WaveNumber>, TestField, TrialField, match::match_2d_type,
73  typename std::enable_if<
74  is_collocational<TestField, TrialField>::value
75  >::type
76 >
77 {
78 public:
85  template <class result_t>
86  static result_t &eval(
87  result_t &result,
89  field_base<TestField> const &,
90  field_base<TrialField> const &trial_field,
91  element_match const &)
92  {
93 #if NIHU_GUIGGIANI_DEBUGGING
94  static bool printed = false;
95  if (!printed)
96  {
97  std::cout << "Calling Guiggiani for convected_helmholtz_3d_DLPt_n_kernel now" << std::endl;
98  printed = true;
99  }
100 #endif
102  auto const &elem = trial_field.get_elem();
103  guiggiani_t gui(elem, kernel.derived());
104  for (unsigned r = 0; r < TestField::num_dofs; ++r)
105  {
106  auto const &xi0 = TestField::nset_t::corner_at(r);
107  gui.integrate(result.row(r), xi0, elem.get_normal(xi0));
108  }
109 
110  return result;
111  }
112 };
113 
114 
115 
121 template <class WaveNumber, class TestField, class TrialField>
123  convected_helmholtz_3d_HSP_kernel<WaveNumber>, TestField, TrialField, match::match_2d_type,
124  typename std::enable_if<
125  is_collocational<TestField, TrialField>::value
126  >::type
127 >
128 {
129 public:
136  template <class result_t>
137  static result_t &eval(
138  result_t &result,
140  field_base<TestField> const &,
141  field_base<TrialField> const &trial_field,
142  element_match const &)
143  {
144 #if NIHU_GUIGGIANI_DEBUGGING
145  static bool printed = false;
146  if (!printed)
147  {
148  std::cout << "Calling Guiggiani for convected_helmholtz_3d_HSP_kernel now" << std::endl;
149  printed = true;
150  }
151 #endif
153  auto const &elem = trial_field.get_elem();
154  guiggiani_t gui(elem, kernel.derived());
155  for (unsigned r = 0; r < TestField::num_dofs; ++r)
156  {
157  auto const &xi0 = TestField::nset_t::corner_at(r);
158  gui.integrate(result.row(r), xi0, elem.get_normal(xi0));
159  }
160 
161  return result;
162  }
163 };
164 
165 } // end of namespace NiHu
166 
167 #endif /* NIHU_CONVECTED_HELMHOLTZ_3D_SINGULAR_INTEGRALS_HPP_INCLUDED */
element_match.hpp
determine element singularities
NiHu::singular_integral_shortcut< convected_helmholtz_3d_HSP_kernel< WaveNumber >, TestField, TrialField, match::match_2d_type, typename std::enable_if< is_collocational< TestField, TrialField >::value >::type >::eval
static result_t & eval(result_t &result, kernel_base< convected_helmholtz_3d_HSP_kernel< WaveNumber > > const &kernel, field_base< TestField > const &, field_base< TrialField > const &trial_field, element_match const &)
evaluate singular integral
Definition: convected_helmholtz_3d_singular_integrals.hpp:137
NiHu::kernel_base
CRTP base class of all BEM kernels.
Definition: kernel.hpp:133
NiHu::match::match_2d_type
std::integral_constant< int, 2 > match_2d_type
two elements are adjacent with a 2d (surface) match
Definition: match_types.hpp:42
NiHu::element_match
class describing the adjacency (match) state of two elements
Definition: element_match.hpp:39
NiHu::singular_integral_shortcut
a shortcut for the user to define customised singular integral methods
Definition: double_integral.hpp:709
NiHu::singular_integral_shortcut< convected_helmholtz_3d_DLPt_n_kernel< WaveNumber >, TestField, TrialField, match::match_2d_type, typename std::enable_if< is_collocational< TestField, TrialField >::value >::type >::eval
static result_t & eval(result_t &result, kernel_base< convected_helmholtz_3d_DLPt_n_kernel< WaveNumber > > const &kernel, field_base< TestField > const &, field_base< TrialField > const &trial_field, element_match const &)
evaluate singular integral
Definition: convected_helmholtz_3d_singular_integrals.hpp:86
NiHu::convected_helmholtz_3d_DLPt_kernel
Definition: convected_helmholtz_3d_kernel.hpp:319
NiHu::field_base::get_elem
const elem_t & get_elem() const
return underlying element
Definition: field.hpp:149
NiHu::singular_integral_shortcut< convected_helmholtz_3d_DLPt_kernel< WaveNumber >, TestField, TrialField, match::match_2d_type, typename std::enable_if< is_collocational< TestField, TrialField >::value >::type >::eval
static result_t & eval(result_t &result, kernel_base< convected_helmholtz_3d_DLPt_kernel< WaveNumber > > const &kernel, field_base< TestField > const &, field_base< TrialField > const &trial_field, element_match const &)
evaluate singular integral
Definition: convected_helmholtz_3d_singular_integrals.hpp:36
NiHu::field_base
CRTP base class of all fields.
Definition: field.hpp:111
NiHu::convected_helmholtz_3d_HSP_kernel
Definition: convected_helmholtz_3d_kernel.hpp:478
NiHu::convected_helmholtz_3d_DLPt_n_kernel
Definition: convected_helmholtz_3d_kernel.hpp:396
NiHu::guiggiani
Implementation of Guiggiani's method.
Definition: guiggiani_1992.hpp:84