BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
elementary_integral_operator.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 bempp_elementary_integral_operator_hpp
22 #define bempp_elementary_integral_operator_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "elementary_integral_operator_base.hpp"
27 #include "../common/multidimensional_arrays.hpp"
28 #include "../common/types.hpp"
29 #include "../fiber/types.hpp"
30 
31 #include <vector>
32 #include "../common/armadillo_fwd.hpp"
33 
34 namespace Fiber
35 {
36 
38 template <typename CoordinateType> class CollectionOfShapesetTransformations;
39 template <typename KernelType> class CollectionOfKernels;
40 template <typename BasisFunctionType, typename KernelType, typename ResultType>
41 class TestKernelTrialIntegral;
42 template <typename ResultType> class LocalAssemblerForOperators;
45 } // namespace Fiber
46 
47 namespace Bempp
48 {
49 
51 class EvaluationOptions;
52 template <typename BasisFunctionType, typename ResultType> class GridFunction;
53 template <typename ValueType> class InterpolatedFunction;
98 template <typename BasisFunctionType_, typename KernelType_, typename ResultType_>
100  public ElementaryIntegralOperatorBase<BasisFunctionType_, ResultType_>
101 {
103 public:
107  typedef typename Base::ResultType ResultType;
115  typedef KernelType_ KernelType;
130 
133  const shared_ptr<const Space<BasisFunctionType> >& domain,
134  const shared_ptr<const Space<BasisFunctionType> >& range,
135  const shared_ptr<const Space<BasisFunctionType> >& dualToRange,
136  const std::string& label,
137  int symmetry);
138 
140  virtual bool isLocal() const;
141 
144  virtual bool isRegular() const = 0;
145 
146 protected:
147  virtual shared_ptr<DiscreteBoundaryOperator<ResultType_> >
149  const Context<BasisFunctionType, ResultType>& context) const;
150 
151 private:
154  virtual const CollectionOfKernels& kernels() const = 0;
155 
159  testTransformations() const = 0;
160 
164  trialTransformations() const = 0;
165 
174  virtual const TestKernelTrialIntegral& integral() const = 0;
175 
176  virtual std::auto_ptr<LocalAssembler> makeAssemblerImpl(
177  const QuadratureStrategy& quadStrategy,
178  const shared_ptr<const GeometryFactory>& testGeometryFactory,
179  const shared_ptr<const GeometryFactory>& trialGeometryFactory,
180  const shared_ptr<const Fiber::RawGridGeometry<CoordinateType> >& testRawGeometry,
181  const shared_ptr<const Fiber::RawGridGeometry<CoordinateType> >& trialRawGeometry,
182  const shared_ptr<const std::vector<const Fiber::Shapeset<BasisFunctionType>*> >& testShapesets,
183  const shared_ptr<const std::vector<const Fiber::Shapeset<BasisFunctionType>*> >& trialShapesets,
184  const shared_ptr<const Fiber::OpenClHandler>& openClHandler,
185  const ParallelizationOptions& parallelizationOptions,
186  VerbosityLevel::Level verbosityLevel,
187  bool cacheSingularIntegrals) const;
188 
189  virtual shared_ptr<DiscreteBoundaryOperator<ResultType_> >
191  LocalAssembler& assembler,
192  const Context<BasisFunctionType, ResultType>& context) const;
193 
196  std::auto_ptr<DiscreteBoundaryOperator<ResultType_> >
197  assembleWeakFormInDenseMode(
198  LocalAssembler& assembler,
199  const Context<BasisFunctionType, ResultType>& context) const;
200  std::auto_ptr<DiscreteBoundaryOperator<ResultType_> >
201  assembleWeakFormInAcaMode(
202  LocalAssembler& assembler,
203  const Context<BasisFunctionType, ResultType>& context) const;
204 
206 };
207 
208 } // namespace Bempp
209 
210 #endif
std::string label() const
Return the label of the operator.
Definition: abstract_boundary_operator.cpp:149
Base::LocalAssembler LocalAssembler
Type of the appropriate instantiation of Fiber::LocalAssemblerForOperators.
Definition: elementary_integral_operator.hpp:113
Base class for quadrature strategies.
Definition: quadrature_strategy.hpp:242
virtual bool isRegular() const =0
Return whether applying this operator to a regular function yields a regular integral.
Parallel operation settings.
Definition: parallelization_options.hpp:32
virtual const TestKernelTrialIntegral & integral() const =0
Return an object representing the integral that is the weak form of this operator.
Base::BasisFunctionType BasisFunctionType
Definition: elementary_integral_operator_base.hpp:59
Base::ResultType ResultType
Definition: elementary_integral_operator_base.hpp:61
Function space.
Definition: assembled_potential_operator.hpp:35
Base::QuadratureStrategy QuadratureStrategy
Type of the appropriate instantiation of Fiber::QuadratureStrategy.
Definition: elementary_integral_operator.hpp:111
Assembly context.
Definition: context.hpp:30
ElementaryIntegralOperator(const shared_ptr< const Space< BasisFunctionType > > &domain, const shared_ptr< const Space< BasisFunctionType > > &range, const shared_ptr< const Space< BasisFunctionType > > &dualToRange, const std::string &label, int symmetry)
Constructor.
Definition: elementary_integral_operator.cpp:47
Elementary integral boundary operator.
Definition: elementary_integral_operator.hpp:99
Base class of ElementaryIntegralOperator, containing functionality independent from KernelType...
Definition: elementary_integral_operator_base.hpp:53
KernelType_ KernelType
Type of the values of the (components of the) kernel functions.
Definition: elementary_integral_operator.hpp:115
shared_ptr< const Space< BasisFunctionType > > range() const
Range.
Definition: abstract_boundary_operator.cpp:135
virtual const CollectionOfKernels & kernels() const =0
Return the collection of kernel functions occurring in the weak form of this operator.
int symmetry() const
Return the symmetry properties of the operator.
Definition: abstract_boundary_operator.cpp:156
Base::BasisFunctionType BasisFunctionType
Type of the values of the (components of the) basis functions into which functions acted upon by the ...
Definition: elementary_integral_operator.hpp:105
Collection of shape functions defined on a reference element.
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:34
Abstract interface of a local assembler for integral operators.
Definition: local_assembler_for_integral_operators.hpp:48
Fiber::TestKernelTrialIntegral< BasisFunctionType, KernelType, ResultType > TestKernelTrialIntegral
Type of the appropriate instantiation of Fiber::TestKernelTrialIntegral.
Definition: elementary_integral_operator.hpp:129
Base::CoordinateType CoordinateType
Type used to represent coordinates.
Definition: elementary_integral_operator.hpp:109
virtual bool isLocal() const
Return false.
Definition: elementary_integral_operator.cpp:58
shared_ptr< const Space< BasisFunctionType > > dualToRange() const
Dual to range.
Definition: abstract_boundary_operator.cpp:142
virtual shared_ptr< DiscreteBoundaryOperator< ResultType_ > > assembleWeakFormImpl(const Context< BasisFunctionType, ResultType > &context) const
Assemble and return the operator&#39;s weak form.
Definition: elementary_integral_operator.cpp:95
Base::ResultType ResultType
Type used to represent elements of the weak form of the operator.
Definition: elementary_integral_operator.hpp:107
shared_ptr< const Space< BasisFunctionType > > domain() const
Domain.
Definition: abstract_boundary_operator.cpp:128
virtual const CollectionOfShapesetTransformations & testTransformations() const =0
Return the collection of test function transformations occurring in the weak form of this operator...
Fiber::CollectionOfKernels< KernelType > CollectionOfKernels
Type of the appropriate instantiation of Fiber::CollectionOfKernels.
Definition: elementary_integral_operator.hpp:126
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:35
virtual std::auto_ptr< LocalAssembler > makeAssemblerImpl(const QuadratureStrategy &quadStrategy, const shared_ptr< const GeometryFactory > &testGeometryFactory, const shared_ptr< const GeometryFactory > &trialGeometryFactory, const shared_ptr< const Fiber::RawGridGeometry< CoordinateType > > &testRawGeometry, const shared_ptr< const Fiber::RawGridGeometry< CoordinateType > > &trialRawGeometry, const shared_ptr< const std::vector< const Fiber::Shapeset< BasisFunctionType > * > > &testShapesets, const shared_ptr< const std::vector< const Fiber::Shapeset< BasisFunctionType > * > > &trialShapesets, const shared_ptr< const Fiber::OpenClHandler > &openClHandler, const ParallelizationOptions &parallelizationOptions, VerbosityLevel::Level verbosityLevel, bool cacheSingularIntegrals) const
Construct a local assembler suitable for this operator.
Definition: elementary_integral_operator.cpp:67
virtual const CollectionOfShapesetTransformations & trialTransformations() const =0
Return the collection of trial function transformations occurring in the weak form of this operator...
Fiber::CollectionOfShapesetTransformations< CoordinateType > CollectionOfBasisTransformations
Type of the appropriate instantiation of Fiber::CollectionOfBasisTransformations. ...
Definition: elementary_integral_operator.hpp:124
Fiber::CollectionOfShapesetTransformations< CoordinateType > CollectionOfShapesetTransformations
Type of the appropriate instantiation of Fiber::CollectionOfShapesetTransformations.
Definition: elementary_integral_operator.hpp:118
Base::CoordinateType CoordinateType
Definition: elementary_integral_operator_base.hpp:63
virtual shared_ptr< DiscreteBoundaryOperator< ResultType_ > > assembleWeakFormInternalImpl2(LocalAssembler &assembler, const Context< BasisFunctionType, ResultType > &context) const
Assemble the operator&#39;s weak form using a specified local assembler.
Definition: elementary_integral_operator.cpp:120