BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
collection_of_kernels.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_collection_of_kernels_hpp
22 #define fiber_collection_of_kernels_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "scalar_traits.hpp"
27 
28 #include <utility>
29 
30 namespace Fiber
31 {
32 
34 template <typename T> class CollectionOf3dArrays;
35 template <typename T> class CollectionOf4dArrays;
36 template <typename CoordinateType> class GeometricalData;
58 template <typename ValueType_>
60 {
61 public:
62  typedef ValueType_ ValueType;
63  typedef typename ScalarTraits<ValueType>::RealType CoordinateType;
64 
67  {}
68 
84  virtual void addGeometricalDependencies(
85  size_t& testGeomDeps, size_t& trialGeomDeps) const = 0;
86 
111  virtual void evaluateAtPointPairs(
112  const GeometricalData<CoordinateType>& testGeomData,
113  const GeometricalData<CoordinateType>& trialGeomData,
114  CollectionOf3dArrays<ValueType>& result) const = 0;
115 
141  virtual void evaluateOnGrid(
142  const GeometricalData<CoordinateType>& testGeomData,
143  const GeometricalData<CoordinateType>& trialGeomData,
144  CollectionOf4dArrays<ValueType>& result) const = 0;
145 
147  virtual std::pair<const char*, int> evaluateClCode() const {
148  throw std::runtime_error("CollectionOfKernels::evaluateClCode(): "
149  "not implemented");
150  }
151 
152  virtual CoordinateType estimateRelativeScale(CoordinateType distance) const = 0;
153 };
154 
155 } // namespace Fiber
156 
157 #endif
Traits of scalar types.
Definition: scalar_traits.hpp:40
virtual void evaluateAtPointPairs(const GeometricalData< CoordinateType > &testGeomData, const GeometricalData< CoordinateType > &trialGeomData, CollectionOf3dArrays< ValueType > &result) const =0
Evaluate the kernels at a list of (test point, trial point) pairs.
Collection of kernels.
Definition: collection_of_kernels.hpp:59
Storage of geometrical data.
Definition: geometrical_data.hpp:54
virtual void addGeometricalDependencies(size_t &testGeomDeps, size_t &trialGeomDeps) const =0
Retrieve types of geometrical data on which the kernels depend.
Definition: collection_of_3d_arrays.hpp:39
virtual ~CollectionOfKernels()
Destructor.
Definition: collection_of_kernels.hpp:66
virtual void evaluateOnGrid(const GeometricalData< CoordinateType > &testGeomData, const GeometricalData< CoordinateType > &trialGeomData, CollectionOf4dArrays< ValueType > &result) const =0
Evaluate the kernels on a tensor grid of test and trial points.
Definition: collection_of_4d_arrays.hpp:41
virtual std::pair< const char *, int > evaluateClCode() const
Currently unused.
Definition: collection_of_kernels.hpp:147