BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
transposed_discrete_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 #include "bempp/common/config_trilinos.hpp"
22 
23 #ifndef bempp_transposed_discrete_boundary_operator_hpp
24 #define bempp_transposed_discrete_boundary_operator_hpp
25 
26 #include "../common/common.hpp"
27 
28 #include "discrete_boundary_operator.hpp"
29 
30 #include "../common/shared_ptr.hpp"
31 
32 #ifdef WITH_TRILINOS
33 #include <Teuchos_RCP.hpp>
34 #endif
35 
36 namespace Bempp
37 {
38 
44 template <typename ValueType>
46  public DiscreteBoundaryOperator<ValueType>
47 {
48 public:
50 
56  const shared_ptr<const Base>& op);
57 
58  virtual arma::Mat<ValueType> asMatrix() const;
59 
60  virtual unsigned int rowCount() const;
61  virtual unsigned int columnCount() const;
62 
63  virtual void addBlock(const std::vector<int>& rows,
64  const std::vector<int>& cols,
65  const ValueType alpha,
66  arma::Mat<ValueType>& block) const;
67 
68 #ifdef WITH_TRILINOS
69 public:
70  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > domain() const;
71  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > range() const;
72 
73 protected:
74  virtual bool opSupportedImpl(Thyra::EOpTransp M_trans) const;
75 #endif
76 
77 private:
78  bool isTransposed() const;
79 
80  virtual void applyBuiltInImpl(const TranspositionMode trans,
81  const arma::Col<ValueType>& x_in,
82  arma::Col<ValueType>& y_inout,
83  const ValueType alpha,
84  const ValueType beta) const;
85 
86 private:
87  TranspositionMode m_trans;
88  shared_ptr<const Base> m_operator;
89 };
90 
91 } // namespace Bempp
92 
93 #endif
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: transposed_discrete_boundary_operator.cpp:63
virtual unsigned int columnCount() const
Number of columns of the operator.
Definition: transposed_discrete_boundary_operator.cpp:57
TranspositionMode
Enumeration determining how a discrete boundary operator is transformed before being applied...
Definition: transposition_mode.hpp:37
TransposedDiscreteBoundaryOperator(TranspositionMode trans, const shared_ptr< const Base > &op)
Constructor.
Definition: transposed_discrete_boundary_operator.cpp:10
Discrete boundary operator.
Definition: assembled_potential_operator.hpp:33
Transposed and/or conjugated discrete boundary operator.
Definition: transposed_discrete_boundary_operator.hpp:45
virtual unsigned int rowCount() const
Number of rows of the operator.
Definition: transposed_discrete_boundary_operator.cpp:51
virtual arma::Mat< ValueType > asMatrix() const
Matrix representation of the operator.
Definition: transposed_discrete_boundary_operator.cpp:26