21 #ifndef fiber_modified_helmholtz_3d_double_layer_potential_kernel_interpolated_functor_hpp
22 #define fiber_modified_helmholtz_3d_double_layer_potential_kernel_interpolated_functor_hpp
24 #include "../common/common.hpp"
26 #include "geometrical_data.hpp"
27 #include "hermite_interpolator.hpp"
28 #include "initialize_interpolator_for_modified_helmholtz_3d_kernels.hpp"
29 #include "scalar_traits.hpp"
31 #include "../common/complex_aux.hpp"
51 template <
typename ValueType_>
55 typedef ValueType_ ValueType;
60 CoordinateType maxDist,
int interpPtsPerWavelength) :
61 m_waveNumber(waveNumber)
63 initializeInterpolatorForModifiedHelmholtz3dKernels(
64 waveNumber, maxDist, interpPtsPerWavelength, m_interpolator);
67 int kernelCount()
const {
return 1; }
68 int kernelRowCount(
int )
const {
return 1; }
69 int kernelColCount(
int )
const {
return 1; }
71 void addGeometricalDependencies(
size_t& testGeomDeps,
size_t& trialGeomDeps)
const {
72 testGeomDeps |= GLOBALS;
73 trialGeomDeps |= GLOBALS | NORMALS;
76 ValueType waveNumber()
const {
return m_waveNumber; }
78 template <
template <
typename T>
class CollectionOf2dSlicesOfNdArrays>
82 CollectionOf2dSlicesOfNdArrays<ValueType>& result)
const {
83 const int coordCount = 3;
85 CoordinateType numeratorSum = 0., distSq = 0.;
86 for (
int coordIndex = 0; coordIndex < coordCount; ++coordIndex)
88 CoordinateType diff = trialGeomData.global(coordIndex) -
89 testGeomData.global(coordIndex);
90 distSq += diff * diff;
91 numeratorSum += diff * trialGeomData.normal(coordIndex);
93 CoordinateType dist = sqrt(distSq);
94 ValueType v = m_interpolator.evaluate(dist);
95 result[0](0, 0) = numeratorSum /
96 (static_cast<CoordinateType>(-4.0 * M_PI) * distSq * dist) *
97 (m_waveNumber * dist + static_cast<CoordinateType>(1.0)) * v;
100 CoordinateType estimateRelativeScale(CoordinateType distance)
const {
102 return exp(-realPart(m_waveNumber) * distance);
107 ValueType m_waveNumber;
Traits of scalar types.
Definition: scalar_traits.hpp:40
Definition: hermite_interpolator.hpp:15
Double-layer-potential kernel functor for the modified Helmholtz equation in 3D.
Definition: modified_helmholtz_3d_double_layer_potential_kernel_interpolated_functor.hpp:52
Access to slices of geometrical data.
Definition: geometrical_data.hpp:88