BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
typical_test_scalar_kernel_trial_integral.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_typical_test_scalar_kernel_trial_integral_hpp
22 #define fiber_typical_test_scalar_kernel_trial_integral_hpp
23 
24 #include "test_kernel_trial_integral.hpp"
25 
26 #include "default_test_kernel_trial_integral.hpp"
27 #include "test_scalar_kernel_trial_integrand_functor.hpp"
28 
29 #include <tbb/enumerable_thread_specific.h>
30 
31 namespace Fiber
32 {
33 
34 template <typename BasisFunctionType_, typename KernelType_, typename ResultType_>
36  public TestKernelTrialIntegral<BasisFunctionType_, KernelType_, ResultType_>
37 {
39 public:
40  typedef typename Base::CoordinateType CoordinateType;
41  typedef typename Base::BasisFunctionType BasisFunctionType;
42  typedef typename Base::KernelType KernelType;
43  typedef typename Base::ResultType ResultType;
44 
45  virtual void addGeometricalDependencies(
46  size_t& testGeomDeps, size_t& trialGeomDeps) const;
47 };
48 
70 template <typename BasisFunctionType_, typename KernelType_, typename ResultType_>
73  BasisFunctionType_, KernelType_, ResultType_>
74 {
75  // should never be instantiated -- only the specializations (below) should
76 private:
78 };
79 
80 template <typename BasisFunctionType_, typename ResultType_>
82  BasisFunctionType_, BasisFunctionType_, ResultType_> :
84  BasisFunctionType_, BasisFunctionType_, ResultType_>
85 {
87  BasisFunctionType_, BasisFunctionType_, ResultType_> Base;
88 public:
89  typedef typename Base::CoordinateType CoordinateType;
90  typedef typename Base::BasisFunctionType BasisFunctionType;
91  typedef typename Base::KernelType KernelType;
92  typedef typename Base::ResultType ResultType;
93 
95 
97  const GeometricalData<CoordinateType>& testGeomData,
98  const GeometricalData<CoordinateType>& trialGeomData,
100  const CollectionOf3dArrays<BasisFunctionType>& trialValues,
101  const CollectionOf4dArrays<KernelType>& kernelValues,
102  const std::vector<CoordinateType>& testQuadWeights,
103  const std::vector<CoordinateType>& trialQuadWeights,
104  arma::Mat<ResultType>& result) const;
105 
107  const GeometricalData<CoordinateType>& testGeomData,
108  const GeometricalData<CoordinateType>& trialGeomData,
109  const CollectionOf3dArrays<BasisFunctionType>& testValues,
110  const CollectionOf3dArrays<BasisFunctionType>& trialValues,
111  const CollectionOf3dArrays<KernelType>& kernelValues,
112  const std::vector<CoordinateType>& quadWeights,
113  arma::Mat<ResultType>& result) const;
114 };
115 
116 template <typename CoordinateType_>
118  std::complex<CoordinateType_>, std::complex<CoordinateType_> > :
119  public TypicalTestScalarKernelTrialIntegralBase<CoordinateType_,
120  std::complex<CoordinateType_>, std::complex<CoordinateType_> >
121 {
122  typedef TypicalTestScalarKernelTrialIntegralBase<CoordinateType_,
123  std::complex<CoordinateType_>, std::complex<CoordinateType_> > Base;
124 public:
125  typedef typename Base::CoordinateType CoordinateType;
126  typedef typename Base::BasisFunctionType BasisFunctionType;
127  typedef typename Base::KernelType KernelType;
128  typedef typename Base::ResultType ResultType;
129 
131 
133  const GeometricalData<CoordinateType>& testGeomData,
134  const GeometricalData<CoordinateType>& trialGeomData,
135  const CollectionOf3dArrays<BasisFunctionType>& testValues,
136  const CollectionOf3dArrays<BasisFunctionType>& trialValues,
137  const CollectionOf4dArrays<KernelType>& kernelValues,
138  const std::vector<CoordinateType>& testQuadWeights,
139  const std::vector<CoordinateType>& trialQuadWeights,
140  arma::Mat<ResultType>& result) const;
141 
143  const GeometricalData<CoordinateType>& testGeomData,
144  const GeometricalData<CoordinateType>& trialGeomData,
145  const CollectionOf3dArrays<BasisFunctionType>& testValues,
146  const CollectionOf3dArrays<BasisFunctionType>& trialValues,
147  const CollectionOf3dArrays<KernelType>& kernelValues,
148  const std::vector<CoordinateType>& quadWeights,
149  arma::Mat<ResultType>& result) const;
150 };
151 
152 template <typename CoordinateType_>
153 class TypicalTestScalarKernelTrialIntegral<std::complex<CoordinateType_>,
154  CoordinateType_, std::complex<CoordinateType_> > :
156  std::complex<CoordinateType_>, CoordinateType_, std::complex<CoordinateType_> >
157 {
159  std::complex<CoordinateType_>, CoordinateType_, std::complex<CoordinateType_> >
160  Base;
161 public:
162  typedef typename Base::CoordinateType CoordinateType;
163  typedef typename Base::BasisFunctionType BasisFunctionType;
164  typedef typename Base::KernelType KernelType;
165  typedef typename Base::ResultType ResultType;
166 
168 
169  // This is the "standard" (non-BLAS-based) implementation
171  const GeometricalData<CoordinateType>& testGeomData,
172  const GeometricalData<CoordinateType>& trialGeomData,
173  const CollectionOf3dArrays<BasisFunctionType>& testValues,
174  const CollectionOf3dArrays<BasisFunctionType>& trialValues,
175  const CollectionOf4dArrays<KernelType>& kernelValues,
176  const std::vector<CoordinateType>& testQuadWeights,
177  const std::vector<CoordinateType>& trialQuadWeights,
178  arma::Mat<ResultType>& result) const;
179 
181  const GeometricalData<CoordinateType>& testGeomData,
182  const GeometricalData<CoordinateType>& trialGeomData,
183  const CollectionOf3dArrays<BasisFunctionType>& testValues,
184  const CollectionOf3dArrays<BasisFunctionType>& trialValues,
185  const CollectionOf3dArrays<KernelType>& kernelValues,
186  const std::vector<CoordinateType>& quadWeights,
187  arma::Mat<ResultType>& result) const;
188 
189 private:
190  DefaultTestKernelTrialIntegral<
192  BasisFunctionType, KernelType, ResultType> > m_standardIntegral;
193 };
194 
195 } // namespace Fiber
196 
197 #endif
An integral representing the weak form of an integral operator.
Definition: test_kernel_trial_integral.hpp:70
virtual void evaluateWithNontensorQuadratureRule(const GeometricalData< CoordinateType > &testGeomData, const GeometricalData< CoordinateType > &trialGeomData, const CollectionOf3dArrays< BasisFunctionType > &testTransformations, const CollectionOf3dArrays< BasisFunctionType > &trialTransformations, const CollectionOf3dArrays< KernelType > &kernels, const std::vector< CoordinateType > &quadWeights, arma::Mat< ResultType > &result) const =0
Evaluate the integral using a non-tensor-product quadrature rule.
Storage of geometrical data.
Definition: geometrical_data.hpp:54
Definition: collection_of_3d_arrays.hpp:39
virtual void addGeometricalDependencies(size_t &testGeomDeps, size_t &trialGeomDeps) const
Retrieve types of geometrical data on which the integrand of this integral depends explicitly...
Definition: typical_test_scalar_kernel_trial_integral.cpp:376
Functor evaluating the integrand of most standard boundary integral operators.
Definition: test_scalar_kernel_trial_integrand_functor.hpp:43
Implementation of the TestKernelTrialIntegral interface for &quot;typical&quot; integrals, taking advantage of ...
Definition: typical_test_scalar_kernel_trial_integral.hpp:71
virtual void evaluateWithTensorQuadratureRule(const GeometricalData< CoordinateType > &testGeomData, const GeometricalData< CoordinateType > &trialGeomData, const CollectionOf3dArrays< BasisFunctionType > &testTransformations, const CollectionOf3dArrays< BasisFunctionType > &trialTransformations, const CollectionOf4dArrays< KernelType > &kernels, const std::vector< CoordinateType > &testQuadWeights, const std::vector< CoordinateType > &trialQuadWeights, arma::Mat< ResultType > &result) const =0
Evaluate the integral using a tensor-product quadrature rule.
Definition: typical_test_scalar_kernel_trial_integral.hpp:35
Definition: collection_of_4d_arrays.hpp:41