NiHu  2.0
helmholtz_3d_hf_shift.h
1 #ifndef NIHU_HELMHOLTZ_3D_HF_SHIFT_H_INCLUDED
2 #define NIHU_HELMHOLTZ_3D_HF_SHIFT_H_INCLUDED
3 
5 
6 #define L2L_SHIFT_FIRST 1
7 
8 namespace NiHu
9 {
10 namespace fmm
11 {
12 
19 {
20  using cvector_t = Eigen::Matrix<std::complex<double>, Eigen::Dynamic, 1>;
21 
22 public:
24  : m_level_data(nullptr)
25  {
26  }
27 
28  helmholtz_3d_hf_fmm_upshift(cvector_t const &shift, helmholtz_3d_hf_level_data const &ld)
29  : m_shift(shift), m_level_data(&ld)
30  {
31  }
32 
35  cvector_t operator*(cvector_t const &rhs) const
36  {
37  return m_shift.array() * m_level_data->interp_up(rhs).array();
38  }
39 
40 private:
41  cvector_t m_shift;
42  helmholtz_3d_hf_level_data const *m_level_data;
43 };
44 
51 {
52  using cvector_t = Eigen::Matrix<std::complex<double>, Eigen::Dynamic, 1>;
53 
54 public:
56  : m_level_data(nullptr)
57  {
58  }
59 
60  helmholtz_3d_hf_fmm_downshift(cvector_t const &shift, helmholtz_3d_hf_level_data const &ld)
61  : m_shift(shift), m_level_data(&ld)
62  {
63  }
64 
67  cvector_t operator*(cvector_t const &rhs) const
68  {
69 #if L2L_SHIFT_FIRST
70  return m_level_data->interp_down(m_shift.array() * rhs.array());
71 #else
72  return m_shift.array() * m_level_data->interp_down(rhs).array();
73 #endif
74  }
75 
76 private:
77  cvector_t m_shift;
78  helmholtz_3d_hf_level_data const *m_level_data;
79 };
80 
81 }
82 }
83 
84 #endif // NIHU_HELMHOLTZ_3D_HF_SHIFT_H_INCLUDED
NiHu::fmm::helmholtz_3d_hf_level_data::interp_down
const cvector_t & interp_down(cvector_t const &x) const
interpolate a function on the unit sphere down to this level
Definition: helmholtz_3d_hf_level_data.cpp:45
helmholtz_3d_hf_level_data.h
level data of the the helmholtz 3d high frequency fmm
NiHu::fmm::helmholtz_3d_hf_fmm_upshift
Class for shifting up Multipole contributions This class is the result of the M2M operation....
Definition: helmholtz_3d_hf_shift.h:18
NiHu::fmm::helmholtz_3d_hf_level_data::interp_up
const cvector_t & interp_up(cvector_t const &x) const
interpolate a function on the unit sphere up to this level
Definition: helmholtz_3d_hf_level_data.cpp:38
NiHu::fmm::helmholtz_3d_hf_fmm_downshift
Class for shifting down Local contributions This class is the result of the L2L operation....
Definition: helmholtz_3d_hf_shift.h:50
NiHu::fmm::helmholtz_3d_hf_fmm_downshift::operator*
cvector_t operator*(cvector_t const &rhs) const
multiply the updownshift matrix with a multipole / local
Definition: helmholtz_3d_hf_shift.h:67
NiHu::fmm::helmholtz_3d_hf_fmm_upshift::operator*
cvector_t operator*(cvector_t const &rhs) const
multiply the updownshift matrix with a multipole / local
Definition: helmholtz_3d_hf_shift.h:35
NiHu::fmm::helmholtz_3d_hf_level_data
level data of the helmholtz 3d hf fmm
Definition: helmholtz_3d_hf_level_data.h:23