BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
abstract_boundary_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_abstract_boundary_operator_hpp
22 #define bempp_abstract_boundary_operator_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "assembly_options.hpp"
27 #include "symmetry.hpp"
28 
29 #include "../common/deprecated.hpp"
30 #include "../common/scalar_traits.hpp"
31 #include "../common/shared_ptr.hpp"
32 #include "../fiber/quadrature_strategy.hpp"
33 #include "../space/space.hpp"
34 
35 #include <memory>
36 #include <string>
37 #include <vector>
38 
39 namespace arma
40 {
41 
43 template <typename eT> class Mat;
46 }
47 
48 namespace Bempp
49 {
50 
52 class AbstractBoundaryOperatorId;
53 class Grid;
54 class GeometryFactory;
55 template <typename ValueType> class DiscreteBoundaryOperator;
56 template <typename BasisFunctionType, typename ResultType> class AbstractBoundaryOperatorSum;
57 template <typename BasisFunctionType, typename ResultType> class Context;
58 template <typename BasisFunctionType, typename ResultType> class ElementaryAbstractBoundaryOperator;
59 template <typename BasisFunctionType, typename ResultType> class GridFunction;
60 template <typename BasisFunctionType, typename ResultType> class ScaledAbstractBoundaryOperator;
89 template <typename BasisFunctionType_, typename ResultType_>
91 {
92 public:
95  typedef BasisFunctionType_ BasisFunctionType;
97  typedef ResultType_ ResultType;
103 
126  const shared_ptr<const Space<BasisFunctionType> >& domain,
127  const shared_ptr<const Space<BasisFunctionType> >& range,
128  const shared_ptr<const Space<BasisFunctionType> >& dualToRange,
129  const std::string& label,
130  int symmetry);
131 
133  virtual ~AbstractBoundaryOperator();
134 
149  virtual BEMPP_DEPRECATED shared_ptr<const AbstractBoundaryOperatorId> id() const;
150 
159  shared_ptr<const Space<BasisFunctionType> > domain() const;
160 
165  shared_ptr<const Space<BasisFunctionType> > range() const;
166 
171  shared_ptr<const Space<BasisFunctionType> > dualToRange() const;
172 
178  std::string label() const;
179 
181  static std::string uniqueLabel();
182 
187  int symmetry() const;
188 
200  virtual bool isLocal() const = 0;
201 
220  shared_ptr<DiscreteBoundaryOperator<ResultType_> > assembleWeakForm(
221  const Context<BasisFunctionType_, ResultType_>& context) const;
222 
223 protected:
224 
228  const AssemblyOptions& options,
229  shared_ptr<Fiber::RawGridGeometry<CoordinateType> >& testRawGeometry,
230  shared_ptr<Fiber::RawGridGeometry<CoordinateType> >& trialRawGeometry,
231  shared_ptr<GeometryFactory>& testGeometryFactory,
232  shared_ptr<GeometryFactory>& trialGeometryFactory,
233  shared_ptr<std::vector<const Fiber::Shapeset<BasisFunctionType_>*> >&
234  testShapesets,
235  shared_ptr<std::vector<const Fiber::Shapeset<BasisFunctionType_>*> >&
236  trialShapesets,
237  shared_ptr<Fiber::OpenClHandler>& openClHandler,
238  bool& cacheSingularIntegrals) const;
239 
243  shared_ptr<Fiber::RawGridGeometry<CoordinateType> >& testRawGeometry,
244  shared_ptr<Fiber::RawGridGeometry<CoordinateType> >& trialRawGeometry,
245  shared_ptr<GeometryFactory>& testGeometryFactory,
246  shared_ptr<GeometryFactory>& trialGeometryFactory,
247  shared_ptr<std::vector<const Fiber::Shapeset<BasisFunctionType_>*> >&
248  testShapesets,
249  shared_ptr<std::vector<const Fiber::Shapeset<BasisFunctionType_>*> >&
250  trialShapesets) const;
251 
255  const AssemblyOptions& options,
256  const shared_ptr<Fiber::RawGridGeometry<CoordinateType> >& testRawGeometry,
257  const shared_ptr<Fiber::RawGridGeometry<CoordinateType> >& trialRawGeometry,
258  shared_ptr<Fiber::OpenClHandler>& openClHandler,
259  bool& cacheSingularIntegrals) const;
260 
265  virtual shared_ptr<DiscreteBoundaryOperator<ResultType> >
267 
270 private:
272  shared_ptr<const Space<BasisFunctionType> > m_domain;
273  shared_ptr<const Space<BasisFunctionType> > m_range;
274  shared_ptr<const Space<BasisFunctionType> > m_dualToRange;
275  std::string m_label;
276  int m_symmetry;
278 };
279 
280 } // namespace Bempp
281 
282 #endif
Traits of scalar types.
Definition: scalar_traits.hpp:40
virtual bool isLocal() const =0
Return whether this operator is local.
std::string label() const
Return the label of the operator.
Definition: abstract_boundary_operator.cpp:149
void collectOptionsDependentDataForAssemblerConstruction(const AssemblyOptions &options, const shared_ptr< Fiber::RawGridGeometry< CoordinateType > > &testRawGeometry, const shared_ptr< Fiber::RawGridGeometry< CoordinateType > > &trialRawGeometry, shared_ptr< Fiber::OpenClHandler > &openClHandler, bool &cacheSingularIntegrals) const
Construct those objects necessary for subsequent local assembler construction that depend on assembly...
Definition: abstract_boundary_operator.cpp:218
virtual BEMPP_DEPRECATED shared_ptr< const AbstractBoundaryOperatorId > id() const
Return the identifier of this operator.
Definition: abstract_boundary_operator.cpp:105
Base class for quadrature strategies.
Definition: quadrature_strategy.hpp:242
void collectDataForAssemblerConstruction(const AssemblyOptions &options, shared_ptr< Fiber::RawGridGeometry< CoordinateType > > &testRawGeometry, shared_ptr< Fiber::RawGridGeometry< CoordinateType > > &trialRawGeometry, shared_ptr< GeometryFactory > &testGeometryFactory, shared_ptr< GeometryFactory > &trialGeometryFactory, shared_ptr< std::vector< const Fiber::Shapeset< BasisFunctionType_ > * > > &testShapesets, shared_ptr< std::vector< const Fiber::Shapeset< BasisFunctionType_ > * > > &trialShapesets, shared_ptr< Fiber::OpenClHandler > &openClHandler, bool &cacheSingularIntegrals) const
Given an AssemblyOptions object, construct objects necessary for subsequent local assembler construct...
Definition: abstract_boundary_operator.cpp:163
shared_ptr< DiscreteBoundaryOperator< ResultType_ > > assembleWeakForm(const Context< BasisFunctionType_, ResultType_ > &context) const
Assemble and return the operator&#39;s weak form.
Definition: abstract_boundary_operator.cpp:120
Function space.
Definition: assembled_potential_operator.hpp:35
AbstractBoundaryOperator(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: abstract_boundary_operator.cpp:46
#define BEMPP_DEPRECATED
Macro used to mark deprecated functions or classes.
Definition: deprecated.hpp:41
virtual shared_ptr< DiscreteBoundaryOperator< ResultType > > assembleWeakFormImpl(const Context< BasisFunctionType, ResultType > &context) const =0
Assemble and return the operator&#39;s weak form.
void collectOptionsIndependentDataForAssemblerConstruction(shared_ptr< Fiber::RawGridGeometry< CoordinateType > > &testRawGeometry, shared_ptr< Fiber::RawGridGeometry< CoordinateType > > &trialRawGeometry, shared_ptr< GeometryFactory > &testGeometryFactory, shared_ptr< GeometryFactory > &trialGeometryFactory, shared_ptr< std::vector< const Fiber::Shapeset< BasisFunctionType_ > * > > &testShapesets, shared_ptr< std::vector< const Fiber::Shapeset< BasisFunctionType_ > * > > &trialShapesets) const
Construct those objects necessary for subsequent local assembler construction that are independent fr...
Definition: abstract_boundary_operator.cpp:187
Assembly context.
Definition: context.hpp:30
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
virtual ~AbstractBoundaryOperator()
Destructor.
Definition: abstract_boundary_operator.cpp:99
shared_ptr< const Space< BasisFunctionType > > range() const
Range.
Definition: abstract_boundary_operator.cpp:135
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
Abstract (non-discretized) boundary operator.
Definition: abstract_boundary_operator.hpp:90
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
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
Definition: default_local_assembler_for_operators_on_surfaces_utilities.hpp:35
static std::string uniqueLabel()
Generate and return a new unique label &quot;OpN&quot;, where N is a number.
Definition: abstract_boundary_operator.cpp:112
Fiber::QuadratureStrategy< BasisFunctionType, ResultType, GeometryFactory > QuadratureStrategy
Type of the appropriate instantiation of Fiber::QuadratureStrategy.
Definition: abstract_boundary_operator.hpp:102
Options determining how weak-form assembly is done.
Definition: assembly_options.hpp:43