BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
identity_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_identity_operator_hpp
22 #define bempp_identity_operator_hpp
23 
24 #include "../common/common.hpp"
25 
26 #include "elementary_local_operator.hpp"
27 
28 #include "abstract_boundary_operator_id.hpp"
29 #include <boost/scoped_ptr.hpp>
30 
31 namespace Fiber
32 {
33 
35 template <typename ResultType> class LocalAssemblerForOperators;
38 } // namespace Fiber
39 
40 namespace Bempp
41 {
42 
44 template <typename BasisFunctionType, typename ResultType> class BoundaryOperator;
45 template <typename BasisFunctionType, typename ResultType> class IdentityOperator;
48 template <typename BasisFunctionType, typename ResultType>
50 {
51 public:
53  virtual size_t hash() const;
54  virtual bool isEqual(const AbstractBoundaryOperatorId &other) const;
55 
56 private:
57  const Space<BasisFunctionType>* m_domain;
58  const Space<BasisFunctionType>* m_range;
59  const Space<BasisFunctionType>* m_dualToRange;
60 };
61 
79 template <typename BasisFunctionType_, typename ResultType_>
81  public ElementaryLocalOperator<BasisFunctionType_, ResultType_>
82 {
84 public:
88  typedef typename Base::ResultType ResultType;
101 
122  IdentityOperator(const shared_ptr<const Space<BasisFunctionType> >& domain,
123  const shared_ptr<const Space<BasisFunctionType> >& range,
124  const shared_ptr<const Space<BasisFunctionType> >& dualToRange,
125  const std::string& label = "",
126  int symmetry = AUTO_SYMMETRY);
127  virtual ~IdentityOperator();
128 
137  BEMPP_DEPRECATED virtual shared_ptr<const AbstractBoundaryOperatorId> id() const;
138 
139 private:
141  testTransformations() const;
142 
144  trialTransformations() const;
145 
146  virtual const TestTrialIntegral& integral() const;
147 
148 private:
149  shared_ptr<TestTrialIntegral> m_integral;
150  shared_ptr<const AbstractBoundaryOperatorId> m_id;
151 };
152 
179 template <typename BasisFunctionType, typename ResultType>
181 identityOperator(const shared_ptr<const Context<BasisFunctionType, ResultType> >& context,
182  const shared_ptr<const Space<BasisFunctionType> >& domain,
183  const shared_ptr<const Space<BasisFunctionType> >& range,
184  const shared_ptr<const Space<BasisFunctionType> >& dualToRange,
185  const std::string& label = "",
186  int symmetry = AUTO_SYMMETRY);
187 
188 } // namespace Bempp
189 
190 #endif
Base::QuadratureStrategy QuadratureStrategy
Type of the appropriate instantiation of Fiber::QuadratureStrategy.
Definition: identity_operator.hpp:92
std::string label() const
Return the label of the operator.
Definition: abstract_boundary_operator.cpp:149
Base::CollectionOfShapesetTransformations CollectionOfShapesetTransformations
Type of the appropriate instantiation of Fiber::CollectionOfShapesetTransformations.
Definition: identity_operator.hpp:95
Base::ResultType ResultType
Type used to represent elements of the weak form of the operator.
Definition: identity_operator.hpp:88
Base class for quadrature strategies.
Definition: quadrature_strategy.hpp:242
Function space.
Definition: assembled_potential_operator.hpp:35
Fiber::CollectionOfShapesetTransformations< CoordinateType > CollectionOfBasisTransformations
Type of the appropriate instantiation of Fiber::CollectionOfBasisTransformations. ...
Definition: elementary_local_operator.hpp:77
Base::TestTrialIntegral TestTrialIntegral
Type of the appropriate instantiation of Fiber::TestTrialIntegral.
Definition: identity_operator.hpp:100
#define BEMPP_DEPRECATED
Macro used to mark deprecated functions or classes.
Definition: deprecated.hpp:41
virtual const CollectionOfShapesetTransformations & testTransformations() const
Return the collection of test function transformations occurring in the weak form of this operator...
Definition: identity_operator.cpp:117
virtual const TestTrialIntegral & integral() const
Return an object representing the integral that is the weak form of this operator.
Definition: identity_operator.cpp:131
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
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
Base::CollectionOfBasisTransformations CollectionOfBasisTransformations
Type of the appropriate instantiation of Fiber::CollectionOfBasisTransformations. ...
Definition: identity_operator.hpp:98
Operator acting on functions defined on a surface.
Definition: boundary_operator.hpp:63
Abstract (non-discretized) boundary operator.
Definition: abstract_boundary_operator.hpp:90
Identity operator.
Definition: identity_operator.hpp:80
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
Definition: identity_operator.hpp:49
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
Fiber::TestTrialIntegral< BasisFunctionType, ResultType > TestTrialIntegral
Type of the appropriate instantiation of Fiber::TestTrialIntegral.
Definition: elementary_local_operator.hpp:80
Base::BasisFunctionType BasisFunctionType
Type of the values of the (components of the) basis functions into which functions acted upon by the ...
Definition: identity_operator.hpp:86
virtual BEMPP_DEPRECATED shared_ptr< const AbstractBoundaryOperatorId > id() const
Return the identifier of this operator.
Definition: identity_operator.cpp:110
Definition: test_trial_integral.hpp:38
Base::CoordinateType CoordinateType
Type used to represent coordinates.
Definition: identity_operator.hpp:90
Abstract base class of local elementary operators.
Definition: elementary_local_operator.hpp:56
Fiber::CollectionOfShapesetTransformations< CoordinateType > CollectionOfShapesetTransformations
Type of the appropriate instantiation of Fiber::CollectionOfShapesetTransformations.
Definition: elementary_local_operator.hpp:71
virtual const CollectionOfShapesetTransformations & trialTransformations() const
Return the collection of trial function transformations occurring in the weak form of this operator...
Definition: identity_operator.cpp:124
Base class for identifiers of an abstract boundary operator.
Definition: abstract_boundary_operator_id.hpp:21
IdentityOperator(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=AUTO_SYMMETRY)
Constructor.
Definition: identity_operator.cpp:80