BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
elementary_integral_operator_base.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_base_hpp
22 #define bempp_elementary_integral_operator_base_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "abstract_boundary_operator.hpp"
27 
28 #include "../common/shared_ptr.hpp"
29 
30 #include <stdexcept>
31 #include <vector>
32 
33 namespace Fiber
34 {
35 
37 template <typename ResultType> class LocalAssemblerForIntegralOperators;
38 template <typename CoordinateType> class RawGridGeometry;
39 template <typename ValueType> class Basis;
40 class OpenClHandler;
43 } // namespace Fiber
44 
45 namespace Bempp
46 {
47 
52 template <typename BasisFunctionType_, typename ResultType_>
54  public AbstractBoundaryOperator<BasisFunctionType_, ResultType_>
55 {
57 public:
61  typedef typename Base::ResultType ResultType;
68 
71  const shared_ptr<const Space<BasisFunctionType> >& domain,
72  const shared_ptr<const Space<BasisFunctionType> >& range,
73  const shared_ptr<const Space<BasisFunctionType> >& dualToRange,
74  const std::string& label,
75  int symmetry);
76 
79 
86  std::auto_ptr<LocalAssembler> makeAssembler(
87  const QuadratureStrategy& quadStrategy,
88  const shared_ptr<const GeometryFactory>& testGeometryFactory,
89  const shared_ptr<const GeometryFactory>& trialGeometryFactory,
90  const shared_ptr<const Fiber::RawGridGeometry<CoordinateType> >& testRawGeometry,
91  const shared_ptr<const Fiber::RawGridGeometry<CoordinateType> >& trialRawGeometry,
92  const shared_ptr<const std::vector<const Fiber::Shapeset<BasisFunctionType>*> >& testShapesets,
93  const shared_ptr<const std::vector<const Fiber::Shapeset<BasisFunctionType>*> >& trialShapesets,
94  const shared_ptr<const Fiber::OpenClHandler>& openClHandler,
95  const ParallelizationOptions& parallelizationOptions,
96  VerbosityLevel::Level verbosityLevel,
97  bool cacheSingularIntegrals) const;
98 
109  std::auto_ptr<LocalAssembler> makeAssembler(
110  const QuadratureStrategy& quadStrategy,
111  const AssemblyOptions& options) const;
112 
118  shared_ptr<DiscreteBoundaryOperator<ResultType_> >
120  LocalAssembler& assembler,
121  const Context<BasisFunctionType, ResultType>& context) const;
122 
123 private:
128  virtual std::auto_ptr<LocalAssembler> makeAssemblerImpl(
129  const QuadratureStrategy& quadStrategy,
130  const shared_ptr<const GeometryFactory>& testGeometryFactory,
131  const shared_ptr<const GeometryFactory>& trialGeometryFactory,
132  const shared_ptr<const Fiber::RawGridGeometry<CoordinateType> >& testRawGeometry,
133  const shared_ptr<const Fiber::RawGridGeometry<CoordinateType> >& trialRawGeometry,
134  const shared_ptr<const std::vector<const Fiber::Shapeset<BasisFunctionType>*> >& testShapesets,
135  const shared_ptr<const std::vector<const Fiber::Shapeset<BasisFunctionType>*> >& trialShapesets,
136  const shared_ptr<const Fiber::OpenClHandler>& openClHandler,
137  const ParallelizationOptions& parallelizationOptions,
138  VerbosityLevel::Level verbosityLevel,
139  bool cacheSingularIntegrals) const = 0;
140 
145  virtual shared_ptr<DiscreteBoundaryOperator<ResultType_> >
147  LocalAssembler& assembler,
148  const Context<BasisFunctionType_, ResultType_>& options) const = 0;
149 };
150 
151 } // namespace Bempp
152 
153 #endif
std::string label() const
Return the label of the operator.
Definition: abstract_boundary_operator.cpp:149
Base class for quadrature strategies.
Definition: quadrature_strategy.hpp:242
Parallel operation settings.
Definition: parallelization_options.hpp:32
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_base.hpp:59
Base::ResultType ResultType
Type used to represent elements of the weak form of the operator.
Definition: elementary_integral_operator_base.hpp:61
Function space.
Definition: assembled_potential_operator.hpp:35
virtual shared_ptr< DiscreteBoundaryOperator< ResultType_ > > assembleWeakFormInternalImpl2(LocalAssembler &assembler, const Context< BasisFunctionType_, ResultType_ > &options) const =0
Assemble the operator&#39;s weak form using a specified local assembler.
Assembly context.
Definition: context.hpp:30
Fiber::LocalAssemblerForIntegralOperators< ResultType > LocalAssembler
Type of the appropriate instantiation of Fiber::LocalAssemblerForOperators.
Definition: elementary_integral_operator_base.hpp:67
BasisFunctionType BasisFunctionType
Type of the values of the (components of the) basis functions into which functions acted upon by the ...
Definition: abstract_boundary_operator.hpp:95
Base class of ElementaryIntegralOperator, containing functionality independent from KernelType...
Definition: elementary_integral_operator_base.hpp:53
shared_ptr< const Space< BasisFunctionType > > range() const
Range.
Definition: abstract_boundary_operator.cpp:135
Base::QuadratureStrategy QuadratureStrategy
Type of the appropriate instantiation of Fiber::QuadratureStrategy.
Definition: elementary_integral_operator_base.hpp:65
int symmetry() const
Return the symmetry properties of the operator.
Definition: abstract_boundary_operator.cpp:156
Collection of shape functions defined on a reference element.
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:34
ElementaryIntegralOperatorBase(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_base.cpp:35
Abstract (non-discretized) boundary operator.
Definition: abstract_boundary_operator.hpp:90
Abstract interface of a local assembler for integral operators.
Definition: local_assembler_for_integral_operators.hpp:48
~ElementaryIntegralOperatorBase()
Destructor.
Definition: elementary_integral_operator_base.cpp:47
ScalarTraits< ResultType >::RealType CoordinateType
Type used to represent coordinates.
Definition: abstract_boundary_operator.hpp:99
shared_ptr< const Space< BasisFunctionType > > dualToRange() const
Dual to range.
Definition: abstract_boundary_operator.cpp:142
std::auto_ptr< LocalAssembler > makeAssembler(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_base.cpp:63
shared_ptr< const Space< BasisFunctionType > > domain() const
Domain.
Definition: abstract_boundary_operator.cpp:128
ResultType ResultType
Type used to represent elements of the weak form of the operator.
Definition: abstract_boundary_operator.hpp:97
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 =0
Construct a local assembler suitable for this operator.
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:35
shared_ptr< DiscreteBoundaryOperator< ResultType_ > > assembleWeakFormInternal(LocalAssembler &assembler, const Context< BasisFunctionType, ResultType > &context) const
Assemble the operator&#39;s weak form using a specified local assembler.
Definition: elementary_integral_operator_base.cpp:54
Options determining how weak-form assembly is done.
Definition: assembly_options.hpp:43
Base::CoordinateType CoordinateType
Type used to represent coordinates.
Definition: elementary_integral_operator_base.hpp:63