BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
complexified_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_complexified_discrete_boundary_operator_hpp
24 #define bempp_complexified_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 #include <Thyra_SpmdVectorSpaceBase_decl.hpp>
35 #endif
36 
37 namespace Bempp
38 {
39 
45 template <typename RealType>
47  public DiscreteBoundaryOperator<std::complex<RealType> >
48 {
49 public:
51  typedef std::complex<RealType> ComplexType;
52  typedef ComplexType ValueType;
53 
56  const shared_ptr<const DiscreteBoundaryOperator<RealType> >& 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  virtual void applyBuiltInImpl(const TranspositionMode trans,
79  const arma::Col<ValueType>& x_in,
80  arma::Col<ValueType>& y_inout,
81  const ValueType alpha,
82  const ValueType beta) const;
83 
84 private:
86  shared_ptr<const DiscreteBoundaryOperator<RealType> > m_operator;
87 #ifdef WITH_TRILINOS
88  Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > m_domainSpace;
89  Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > m_rangeSpace;
90 #endif
91 
92 };
93 
94 } // namespace Bempp
95 
96 #endif
virtual unsigned int rowCount() const
Number of rows of the operator.
Definition: complexified_discrete_boundary_operator.cpp:42
virtual unsigned int columnCount() const
Number of columns of the operator.
Definition: complexified_discrete_boundary_operator.cpp:48
virtual arma::Mat< ValueType > asMatrix() const
Matrix representation of the operator.
Definition: complexified_discrete_boundary_operator.cpp:31
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: complexified_discrete_boundary_operator.cpp:54
TranspositionMode
Enumeration determining how a discrete boundary operator is transformed before being applied...
Definition: transposition_mode.hpp:37
Discrete boundary operator.
Definition: assembled_potential_operator.hpp:33
ComplexifiedDiscreteBoundaryOperator(const shared_ptr< const DiscreteBoundaryOperator< RealType > > &op)
Constructor.
Definition: complexified_discrete_boundary_operator.cpp:14
Complexified discrete boundary operator.
Definition: complexified_discrete_boundary_operator.hpp:46