BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
null_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 
22 #ifndef bempp_null_operator_hpp
23 #define bempp_null_operator_hpp
24 
25 #include "../common/common.hpp"
26 
27 #include "abstract_boundary_operator.hpp"
28 
29 #include "abstract_boundary_operator_id.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 NullOperator;
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 
73 template <typename BasisFunctionType_, typename ResultType_>
74 class NullOperator :
75  public AbstractBoundaryOperator<BasisFunctionType_, ResultType_>
76 {
78 public:
82  typedef typename Base::ResultType ResultType;
87 
106  NullOperator(const shared_ptr<const Space<BasisFunctionType> >& domain,
107  const shared_ptr<const Space<BasisFunctionType> >& range,
108  const shared_ptr<const Space<BasisFunctionType> >& dualToRange,
109  const std::string& label = "",
110  int symmetry = AUTO_SYMMETRY);
111  NullOperator(const NullOperator& other);
112  virtual ~NullOperator();
113 
121  BEMPP_DEPRECATED virtual shared_ptr<const AbstractBoundaryOperatorId> id() const;
122 
124  virtual bool isLocal() const;
125 
126 protected:
127  virtual shared_ptr<DiscreteBoundaryOperator<ResultType_> >
129  const Context<BasisFunctionType, ResultType>& context) const;
130 
131  shared_ptr<DiscreteBoundaryOperator<ResultType_> >
132  reallyAssembleWeakForm() const;
133 
134 private:
135  shared_ptr<const AbstractBoundaryOperatorId> m_id;
136 };
137 
162 template <typename BasisFunctionType, typename ResultType>
164 nullOperator(const shared_ptr<const Context<BasisFunctionType, ResultType> >& context,
165  const shared_ptr<const Space<BasisFunctionType> >& domain,
166  const shared_ptr<const Space<BasisFunctionType> >& range,
167  const shared_ptr<const Space<BasisFunctionType> >& dualToRange,
168  const std::string& label = "",
169  int symmetry = AUTO_SYMMETRY);
170 
171 } // namespace Bempp
172 
173 #endif
virtual shared_ptr< DiscreteBoundaryOperator< ResultType_ > > assembleWeakFormImpl(const Context< BasisFunctionType, ResultType > &context) const
Assemble and return the operator&#39;s weak form.
Definition: null_operator.cpp:117
Definition: null_operator.hpp:49
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
Function space.
Definition: assembled_potential_operator.hpp:35
virtual bool isLocal() const
Return true.
Definition: null_operator.cpp:110
#define BEMPP_DEPRECATED
Macro used to mark deprecated functions or classes.
Definition: deprecated.hpp:41
virtual BEMPP_DEPRECATED shared_ptr< const AbstractBoundaryOperatorId > id() const
Return the identifier of this operator.
Definition: null_operator.cpp:104
Base::QuadratureStrategy QuadratureStrategy
Type of the appropriate instantiation of Fiber::QuadratureStrategy.
Definition: null_operator.hpp:86
Assembly context.
Definition: context.hpp:30
Base::CoordinateType CoordinateType
Type used to represent coordinates.
Definition: null_operator.hpp:84
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
Base::BasisFunctionType BasisFunctionType
Type of the values of the (components of the) basis functions into which functions acted upon by the ...
Definition: null_operator.hpp:80
int symmetry() const
Return the symmetry properties of the operator.
Definition: abstract_boundary_operator.cpp:156
NullOperator(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: null_operator.cpp:80
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
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
Null operator.
Definition: null_operator.hpp:74
Base::ResultType ResultType
Type used to represent elements of the weak form of the operator.
Definition: null_operator.hpp:82
Base class for identifiers of an abstract boundary operator.
Definition: abstract_boundary_operator_id.hpp:21