BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
abstract_boundary_operator_pseudoinverse.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_operator_pseudoinverse_hpp
22 #define bempp_abstract_operator_pseudoinverse_hpp
23 
24 #include "abstract_boundary_operator.hpp"
25 #include "abstract_boundary_operator_id.hpp"
26 #include "boundary_operator.hpp"
27 
28 namespace Bempp
29 {
30 
32 template <typename ResultType> class DiscreteDenseBoundaryOperator;
33 template <typename ResultType> class DiscreteSparseBoundaryOperator;
34 template <typename BasisFunctionType> class Space;
37 template <typename BasisFunctionType, typename ResultType>
40 {
41 public:
44  virtual size_t hash() const;
45  virtual void dump() const;
46  virtual bool isEqual(const AbstractBoundaryOperatorId &other) const;
47 
48 private:
49  shared_ptr<const AbstractBoundaryOperatorId> m_operatorToInvertId;
50 };
51 
55 template <typename BasisFunctionType_, typename ResultType_>
57  public AbstractBoundaryOperator<BasisFunctionType_, ResultType_>
58 {
60 public:
64  typedef typename Base::ResultType ResultType;
69 
75  const shared_ptr<const Space<BasisFunctionType> >& dualToRange);
76 
77  virtual bool isLocal() const;
78 
79  BEMPP_DEPRECATED virtual shared_ptr<const AbstractBoundaryOperatorId> id() const;
80 
81 protected:
82  virtual shared_ptr<DiscreteBoundaryOperator<ResultType_> >
84  const Context<BasisFunctionType, ResultType>& context) const;
85 
86 private:
87  shared_ptr<DiscreteBoundaryOperator<ResultType_> >
88  assembleWeakFormForSparseOperator(
90  const shared_ptr<const DiscreteSparseBoundaryOperator<ResultType> >&
91  wrappedDiscreteOp) const;
92  shared_ptr<DiscreteBoundaryOperator<ResultType_> >
93  assembleWeakFormForDenseOperator(
95  const shared_ptr<const DiscreteDenseBoundaryOperator<ResultType> >&
96  wrappedDiscreteOp) const;
97 
98 private:
100  shared_ptr<const AbstractBoundaryOperatorId> m_id;
101 };
102 
111 template <typename BasisFunctionType, typename ResultType>
113 pseudoinverse(const BoundaryOperator<BasisFunctionType, ResultType>& boundaryOp);
114 
119 template <typename BasisFunctionType, typename ResultType>
121 pseudoinverse(const BoundaryOperator<BasisFunctionType, ResultType>& boundaryOp,
122  const shared_ptr<const Space<BasisFunctionType> >& dualToRange);
123 
124 
125 } // namespace Bempp
126 
127 #endif
Discrete boundary operator stored as a sparse matrix.
Definition: discrete_sparse_boundary_operator.hpp:56
Discrete boundary operator stored as a dense matrix.
Definition: discrete_dense_boundary_operator.hpp:43
Base::BasisFunctionType BasisFunctionType
Type of the values of the (components of the) basis functions into which functions acted upon by the ...
Definition: abstract_boundary_operator_pseudoinverse.hpp:62
Base class for quadrature strategies.
Definition: quadrature_strategy.hpp:242
Function space.
Definition: assembled_potential_operator.hpp:35
#define BEMPP_DEPRECATED
Macro used to mark deprecated functions or classes.
Definition: deprecated.hpp:41
Base::ResultType ResultType
Type used to represent elements of the weak form of the operator.
Definition: abstract_boundary_operator_pseudoinverse.hpp:64
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
Definition: abstract_boundary_operator_pseudoinverse.hpp:38
Operator acting on functions defined on a surface.
Definition: boundary_operator.hpp:63
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
Inverse or pseudoinverse of an abstract boundary operator.
Definition: abstract_boundary_operator_pseudoinverse.hpp:56
shared_ptr< const Space< BasisFunctionType > > dualToRange() const
Dual to range.
Definition: abstract_boundary_operator.cpp:142
virtual BEMPP_DEPRECATED shared_ptr< const AbstractBoundaryOperatorId > id() const
Return the identifier of this operator.
Definition: abstract_boundary_operator_pseudoinverse.cpp:117
ResultType_ ResultType
Type used to represent elements of the weak form of the operator.
Definition: abstract_boundary_operator.hpp:97
AbstractBoundaryOperatorPseudoinverse(const BoundaryOperator< BasisFunctionType, ResultType > &boundaryOp)
Construct a (pseudo)inverse of boundaryOp.
Definition: abstract_boundary_operator_pseudoinverse.cpp:54
Base::CoordinateType CoordinateType
Type used to represent coordinates.
Definition: abstract_boundary_operator_pseudoinverse.hpp:66
virtual shared_ptr< DiscreteBoundaryOperator< ResultType_ > > assembleWeakFormImpl(const Context< BasisFunctionType, ResultType > &context) const
Assemble and return the operator&#39;s weak form.
Definition: abstract_boundary_operator_pseudoinverse.cpp:125
virtual bool isLocal() const
Return whether this operator is local.
Definition: abstract_boundary_operator_pseudoinverse.cpp:110
Base class for identifiers of an abstract boundary operator.
Definition: abstract_boundary_operator_id.hpp:21
Base::QuadratureStrategy QuadratureStrategy
Type of the appropriate instantiation of Fiber::QuadratureStrategy.
Definition: abstract_boundary_operator_pseudoinverse.hpp:68