21 #ifndef fiber_modified_helmholtz_3d_single_layer_potential_kernel_interpolated_functor_hpp
22 #define fiber_modified_helmholtz_3d_single_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;
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 sum = 0;
86 for (
int coordIndex = 0; coordIndex < coordCount; ++coordIndex)
88 CoordinateType diff = testGeomData.global(coordIndex) -
89 trialGeomData.global(coordIndex);
92 CoordinateType distance = sqrt(sum);
93 ValueType v = m_interpolator.evaluate(distance);
95 static_cast<CoordinateType>(1.0 / (4.0*M_PI)) / distance * v;
98 CoordinateType estimateRelativeScale(CoordinateType distance)
const {
100 return exp(-realPart(m_waveNumber) * distance);
105 ValueType m_waveNumber;
Traits of scalar types.
Definition: scalar_traits.hpp:40
Single-layer-potential kernel functor for the modified Helmholtz equation in 3D.
Definition: modified_helmholtz_3d_single_layer_potential_kernel_interpolated_functor.hpp:52
Definition: hermite_interpolator.hpp:15
Access to slices of geometrical data.
Definition: geometrical_data.hpp:88