21 #ifndef fiber_laplace_3d_adjoint_double_layer_potential_kernel_functor_hpp
22 #define fiber_laplace_3d_adjoint_double_layer_potential_kernel_functor_hpp
24 #include "../common/common.hpp"
26 #include "geometrical_data.hpp"
27 #include "scalar_traits.hpp"
43 template <
typename ValueType_>
47 typedef ValueType_ ValueType;
50 int kernelCount()
const {
return 1; }
51 int kernelRowCount(
int )
const {
return 1; }
52 int kernelColCount(
int )
const {
return 1; }
54 void addGeometricalDependencies(
size_t& testGeomDeps,
size_t& trialGeomDeps)
const {
55 testGeomDeps |= GLOBALS | NORMALS;
56 trialGeomDeps |= GLOBALS;
59 template <
template <
typename T>
class CollectionOf2dSlicesOfNdArrays>
63 CollectionOf2dSlicesOfNdArrays<ValueType>& result)
const {
64 const int coordCount = 3;
65 assert(testGeomData.dimWorld() == coordCount);
66 assert(result.size() == 1);
68 CoordinateType numeratorSum = 0., distanceSq = 0.;
69 for (
int coordIndex = 0; coordIndex < coordCount; ++coordIndex)
71 CoordinateType diff = testGeomData.global(coordIndex) -
72 trialGeomData.global(coordIndex);
73 distanceSq += diff * diff;
74 numeratorSum += diff * testGeomData.normal(coordIndex);
76 CoordinateType distance = sqrt(distanceSq);
77 result[0](0, 0) = -numeratorSum /
78 (static_cast<CoordinateType>(4. * M_PI) * distanceSq * distance);
Traits of scalar types.
Definition: scalar_traits.hpp:40
Adjoint double-layer-potential kernel functor for the Laplace equation in 3D.
Definition: laplace_3d_adjoint_double_layer_potential_kernel_functor.hpp:44
Access to slices of geometrical data.
Definition: geometrical_data.hpp:88