BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
modified_helmholtz_3d_hypersingular_kernel_interpolated_functor.hpp
1 // Copyright (C) 2011-2012 by the BEM++ Authors
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 // THE SOFTWARE.
20 
21 #ifndef fiber_modified_helmholtz_3d_hypersingular_kernel_interpolated_functor_hpp
22 #define fiber_modified_helmholtz_3d_hypersingular_kernel_interpolated_functor_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "geometrical_data.hpp"
27 #include "scalar_traits.hpp"
28 
29 #include "modified_helmholtz_3d_single_layer_potential_kernel_interpolated_functor.hpp"
30 
31 namespace Fiber
32 {
33 
52 template <typename ValueType_>
54 {
55 public:
56  typedef ValueType_ ValueType;
57  typedef typename ScalarTraits<ValueType>::RealType CoordinateType;
58 
60  ValueType waveNumber,
61  CoordinateType maxDist, int interpPtsPerWavelength) :
62  m_slpKernel(waveNumber, maxDist, interpPtsPerWavelength)
63  {}
64 
65  int kernelCount() const { return 2; }
66  int kernelRowCount(int /* kernelIndex */) const { return 1; }
67  int kernelColCount(int /* kernelIndex */) const { return 1; }
68 
69  void addGeometricalDependencies(size_t& testGeomDeps, size_t& trialGeomDeps) const {
70  m_slpKernel.addGeometricalDependencies(testGeomDeps, trialGeomDeps);
71  }
72 
73  ValueType waveNumber() const { return m_slpKernel.waveNumber(); }
74 
75  template <template <typename T> class CollectionOf2dSlicesOfNdArrays>
76  void evaluate(
78  const ConstGeometricalDataSlice<CoordinateType>& trialGeomData,
79  CollectionOf2dSlicesOfNdArrays<ValueType>& result) const {
80  // This will put the value of the SLP kernel in result[0](0, 0)
81  m_slpKernel.evaluate(testGeomData, trialGeomData, result);
82  result[1](0, 0) = result[0](0, 0) *
83  m_slpKernel.waveNumber() * m_slpKernel.waveNumber();
84  }
85 
86  CoordinateType estimateRelativeScale(CoordinateType distance) const {
87  return m_slpKernel.estimateRelativeScale(distance);
88  }
89 
90 private:
93  m_slpKernel;
95 };
96 
97 } // namespace Fiber
98 
99 #endif
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
Hypersingular kernel collection functor for the modified Helmholtz equation in 3D.
Definition: modified_helmholtz_3d_hypersingular_kernel_interpolated_functor.hpp:53
Access to slices of geometrical data.
Definition: geometrical_data.hpp:88