21 #ifndef fiber_modified_maxwell_3d_double_layer_operators_kernel_functor_hpp
22 #define fiber_modified_maxwell_3d_double_layer_operators_kernel_functor_hpp
24 #include "../common/common.hpp"
25 #include "../common/complex_aux.hpp"
27 #include "geometrical_data.hpp"
28 #include "scalar_traits.hpp"
30 #include "modified_helmholtz_3d_single_layer_potential_kernel_functor.hpp"
51 template <
typename ValueType_>
55 typedef ValueType_ ValueType;
59 ValueType waveNumber) :
60 m_waveNumber(waveNumber)
63 int kernelCount()
const {
return 1; }
64 int kernelRowCount(
int )
const {
return 3; }
65 int kernelColCount(
int )
const {
return 1; }
67 void addGeometricalDependencies(
size_t& testGeomDeps,
size_t& trialGeomDeps)
const {
68 testGeomDeps |= GLOBALS;
69 trialGeomDeps |= GLOBALS;
72 ValueType waveNumber()
const {
return m_waveNumber; }
74 template <
template <
typename T>
class CollectionOf2dSlicesOfNdArrays>
78 CollectionOf2dSlicesOfNdArrays<ValueType>& result)
const {
79 const int coordCount = 3;
81 CoordinateType distanceSq = 0;
82 for (
int coordIndex = 0; coordIndex < coordCount; ++coordIndex) {
83 CoordinateType diff = testGeomData.global(coordIndex) -
84 trialGeomData.global(coordIndex);
85 distanceSq += diff * diff;
87 const CoordinateType distance = sqrt(distanceSq);
88 const ValueType commonFactor =
89 static_cast<CoordinateType
>(-1. / (4. * M_PI)) *
90 (
static_cast<CoordinateType
>(1.) + m_waveNumber * distance) /
91 (distance * distanceSq) *
92 exp(-m_waveNumber * distance);
93 for (
int coordIndex = 0; coordIndex < coordCount; ++coordIndex)
94 result[0](coordIndex, 0) = commonFactor *
95 (testGeomData.global(coordIndex) -
96 trialGeomData.global(coordIndex));
99 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
Kernel collection functor for the DLP of the modified Maxwell equations in 3D.
Definition: modified_maxwell_3d_double_layer_operators_kernel_functor.hpp:52
Access to slices of geometrical data.
Definition: geometrical_data.hpp:88