BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
discrete_boundary_operator_sum.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_discrete_boundary_operator_sum_hpp
22 #define bempp_discrete_boundary_operator_sum_hpp
23 
24 #include "bempp/common/config_ahmed.hpp"
25 #include "bempp/common/config_trilinos.hpp"
26 
27 #include "../common/common.hpp"
28 
29 #include "discrete_boundary_operator.hpp"
30 
31 #include "../common/shared_ptr.hpp"
32 
33 #ifdef WITH_TRILINOS
34 #include <Teuchos_RCP.hpp>
35 #endif
36 
37 namespace Bempp
38 {
39 
43 template <typename ValueType>
45 {
46 public:
48 
56  DiscreteBoundaryOperatorSum(const shared_ptr<const Base>& term1,
57  const shared_ptr<const Base>& term2);
58 
59  virtual arma::Mat<ValueType> asMatrix() const;
60 
61  virtual unsigned int rowCount() const;
62  virtual unsigned int columnCount() const;
63 
64  virtual void addBlock(const std::vector<int>& rows,
65  const std::vector<int>& cols,
66  const ValueType alpha,
67  arma::Mat<ValueType>& block) const;
68 
69 #ifdef WITH_AHMED
70  virtual shared_ptr<const DiscreteBoundaryOperator<ValueType> >
71  asDiscreteAcaBoundaryOperator(double eps=-1, int maximumRank=-1,
72  bool interleave=false) const;
73 #endif
74 
75 #ifdef WITH_TRILINOS
76 public:
77  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > domain() const;
78  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > range() const;
79 
80 protected:
81  virtual bool opSupportedImpl(Thyra::EOpTransp M_trans) const;
82 #endif
83 
84 private:
85  virtual void applyBuiltInImpl(const TranspositionMode trans,
86  const arma::Col<ValueType>& x_in,
87  arma::Col<ValueType>& y_inout,
88  const ValueType alpha,
89  const ValueType beta) const;
90 private:
92  shared_ptr<const Base> m_term1, m_term2;
94 };
95 
96 } // namespace Bempp
97 
98 #endif
virtual unsigned int columnCount() const
Number of columns of the operator.
Definition: discrete_boundary_operator_sum.cpp:66
virtual shared_ptr< const DiscreteBoundaryOperator< ValueType > > asDiscreteAcaBoundaryOperator(double eps=-1, int maximumRank=-1, bool interleave=false) const
Return a representation that can be cast to a DiscreteAcaBoundaryOperator.
Definition: discrete_boundary_operator_sum.cpp:85
Sum of discrete linear operators stored separately.
Definition: discrete_boundary_operator_sum.hpp:44
TranspositionMode
Enumeration determining how a discrete boundary operator is transformed before being applied...
Definition: transposition_mode.hpp:37
virtual arma::Mat< ValueType > asMatrix() const
Matrix representation of the operator.
Definition: discrete_boundary_operator_sum.cpp:50
Discrete boundary operator.
Definition: assembled_potential_operator.hpp:33
DiscreteBoundaryOperatorSum(const shared_ptr< const Base > &term1, const shared_ptr< const Base > &term2)
Constructor.
Definition: discrete_boundary_operator_sum.cpp:32
virtual unsigned int rowCount() const
Number of rows of the operator.
Definition: discrete_boundary_operator_sum.cpp:59
virtual void addBlock(const std::vector< int > &rows, const std::vector< int > &cols, const ValueType alpha, arma::Mat< ValueType > &block) const
Add a subblock of this operator to a matrix.
Definition: discrete_boundary_operator_sum.cpp:72