BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
default_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_default_collection_of_kernels_hpp
22 #define fiber_default_collection_of_kernels_hpp
23 
24 #include "collection_of_kernels.hpp"
25 
26 namespace Fiber
27 {
28 
86 template <typename Functor>
88  public CollectionOfKernels<typename Functor::ValueType>
89 {
91 public:
92  typedef typename Base::ValueType ValueType;
93  typedef typename Base::CoordinateType CoordinateType;
94 
95  explicit DefaultCollectionOfKernels(const Functor& functor) :
96  m_functor(functor)
97  {}
98 
99  const Functor& functor() const {
100  return m_functor;
101  }
102 
103  Functor& functor() {
104  return m_functor;
105  }
106 
107  virtual void addGeometricalDependencies(
108  size_t& testGeomDeps, size_t& trialGeomDeps) const;
109 
110  virtual void evaluateAtPointPairs(
111  const GeometricalData<CoordinateType>& testGeomData,
112  const GeometricalData<CoordinateType>& trialGeomData,
113  CollectionOf3dArrays<ValueType>& result) const;
114 
115  virtual void evaluateOnGrid(
116  const GeometricalData<CoordinateType>& testGeomData,
117  const GeometricalData<CoordinateType>& trialGeomData,
118  CollectionOf4dArrays<ValueType>& result) const;
119 
120  virtual std::pair<const char*, int> evaluateClCode() const;
121 
122  virtual CoordinateType estimateRelativeScale(CoordinateType distance) const;
123 
124 private:
125  Functor m_functor;
126 };
127 
128 } // namespace Fiber
129 
130 #include "default_collection_of_kernels_imp.hpp"
131 
132 #endif
Collection of kernels.
Definition: collection_of_kernels.hpp:59
virtual std::pair< const char *, int > evaluateClCode() const
Currently unused.
Definition: default_collection_of_kernels_imp.hpp:169
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 kernels depend.
Definition: default_collection_of_kernels_imp.hpp:115
Default implementation of a collection of kernels.
Definition: default_collection_of_kernels.hpp:87
Definition: collection_of_4d_arrays.hpp:41