BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
default_evaluator_for_integral_operators.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_evaluator_for_integral_operators_hpp
22 #define fiber_default_evaluator_for_integral_operators_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "evaluator_for_integral_operators.hpp"
27 
28 #include "collection_of_2d_arrays.hpp"
29 #include "parallelization_options.hpp"
30 #include "quadrature_options.hpp"
31 
32 #include "../common/armadillo_fwd.hpp"
33 #include <vector>
34 
35 namespace Fiber
36 {
37 
39 struct QuadratureOptions;
40 template <typename ValueType> class Shapeset;
41 template <typename CoordinateType> class CollectionOfShapesetTransformations;
42 template <typename ValueType> class CollectionOfKernels;
43 template <typename BasisFunctionType, typename KernelType, typename ResultType>
44 class KernelTrialIntegral;
45 template <typename CoordinateType> class RawGridGeometry;
46 class OpenClHandler;
47 template <typename BasisFunctionType>
48 class QuadratureDescriptorSelectorForPotentialOperators;
49 template <typename CoordinateType> class SingleQuadratureRuleFamily;
52 template <typename BasisFunctionType, typename KernelType,
53  typename ResultType, typename GeometryFactory>
55  public EvaluatorForIntegralOperators<ResultType>
56 {
57 public:
59  typedef typename Base::CoordinateType CoordinateType;
60  typedef typename Base::Region Region;
61 
63  const shared_ptr<const GeometryFactory >& geometryFactory,
64  const shared_ptr<const RawGridGeometry<CoordinateType> >& rawGeometry,
65  const shared_ptr<const std::vector<const Shapeset<BasisFunctionType>*> >& trialShapesets,
66  const shared_ptr<const CollectionOfKernels<KernelType> >& kernels,
67  const shared_ptr<const CollectionOfShapesetTransformations<CoordinateType> >& trialTransformations,
68  const shared_ptr<const KernelTrialIntegral<BasisFunctionType, KernelType, ResultType> >& integral,
69  const shared_ptr<const std::vector<std::vector<ResultType> > >& argumentLocalCoefficients,
70  const shared_ptr<const OpenClHandler>& openClHandler,
71  const ParallelizationOptions& parallelizationOptions,
73  BasisFunctionType> >& quadDescSelector,
74  const shared_ptr<const SingleQuadratureRuleFamily<
75  CoordinateType> >& quadRuleFamily);
76 
77  virtual void evaluate(Region region,
78  const arma::Mat<CoordinateType>& points,
79  arma::Mat<ResultType>& result) const;
80 
81 private:
82  void cacheTrialData();
83  void calcTrialData(
84  Region region,
85  int kernelTrialGeomDeps,
86  GeometricalData<CoordinateType>& trialGeomData,
87  CollectionOf2dArrays<ResultType>& trialExprValues,
88  std::vector<CoordinateType>& weights) const;
89 
90 private:
91  const shared_ptr<const GeometryFactory> m_geometryFactory;
92  const shared_ptr<const RawGridGeometry<CoordinateType> > m_rawGeometry;
93  const shared_ptr<const std::vector<const Shapeset<BasisFunctionType>*> > m_trialShapesets;
94  const shared_ptr<const CollectionOfKernels<KernelType> > m_kernels;
95  const shared_ptr<const CollectionOfShapesetTransformations<CoordinateType> > m_trialTransformations;
96  const shared_ptr<const KernelTrialIntegral<BasisFunctionType, KernelType, ResultType> > m_integral;
97  const shared_ptr<const std::vector<std::vector<ResultType> > > m_argumentLocalCoefficients;
98  const shared_ptr<const OpenClHandler> m_openClHandler;
99  const ParallelizationOptions m_parallelizationOptions;
101  BasisFunctionType> > m_quadDescSelector;
102  const shared_ptr<const SingleQuadratureRuleFamily<CoordinateType> > m_quadRuleFamily;
103 
104  Fiber::GeometricalData<CoordinateType> m_nearFieldTrialGeomData;
105  Fiber::GeometricalData<CoordinateType> m_farFieldTrialGeomData;
106  CollectionOf2dArrays<ResultType> m_nearFieldTrialTransfValues;
107  CollectionOf2dArrays<ResultType> m_farFieldTrialTransfValues;
108  std::vector<CoordinateType> m_nearFieldWeights;
109  std::vector<CoordinateType> m_farFieldWeights;
110 };
111 
112 } // namespace Fiber
113 
114 #include "default_evaluator_for_integral_operators_imp.hpp"
115 
116 #endif
Definition: default_evaluator_for_integral_operators.hpp:54
Parallel operation settings.
Definition: parallelization_options.hpp:32
Storage of geometrical data.
Definition: geometrical_data.hpp:54
Collection of shape functions defined on a reference element.
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:34
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:35
Family of quadrature rules over single elements.
Definition: numerical_quadrature_strategy.hpp:35
Definition: kernel_trial_integral.hpp:42
Definition: evaluator_for_integral_operators.hpp:33
Quadrature descriptor selector used during the evaluation on potentials.
Definition: quadrature_descriptor_selector_factory.hpp:39