BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
discrete_null_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_discrete_null_boundary_operator_hpp
24 #define bempp_discrete_null_boundary_operator_hpp
25 
26 #include "../common/common.hpp"
27 
28 #include "discrete_boundary_operator.hpp"
29 
30 #ifdef WITH_TRILINOS
31 #include <Teuchos_RCP.hpp>
32 #include <Thyra_SpmdVectorSpaceBase_decl.hpp>
33 #endif
34 
35 namespace Bempp
36 {
37 
40 template <typename ValueType>
42  public DiscreteBoundaryOperator<ValueType>
43 {
44 public:
49  DiscreteNullBoundaryOperator(size_t rowCount_, size_t columnCount_);
50 
51  virtual void dump() const;
52 
53  virtual arma::Mat<ValueType> asMatrix() const;
54 
55  virtual unsigned int rowCount() const;
56  virtual unsigned int columnCount() const;
57 
58  virtual void addBlock(const std::vector<int>& rows,
59  const std::vector<int>& cols,
60  const ValueType alpha,
61  arma::Mat<ValueType>& block) const;
62 
63 #ifdef WITH_TRILINOS
64 public:
65  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > domain() const;
66  virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > range() const;
67 
68 protected:
69  virtual bool opSupportedImpl(Thyra::EOpTransp M_trans) const;
70 #endif
71 
72 private:
73  virtual void applyBuiltInImpl(const TranspositionMode trans,
74  const arma::Col<ValueType>& x_in,
75  arma::Col<ValueType>& y_inout,
76  const ValueType alpha,
77  const ValueType beta) const;
78 
79 private:
81 #ifdef WITH_TRILINOS
82  Teuchos::RCP<const Thyra::SpmdVectorSpaceBase<ValueType> > m_domainSpace;
83  Teuchos::RCP<const Thyra::SpmdVectorSpaceBase<ValueType> > m_rangeSpace;
84 #else
85  size_t m_rowCount, m_columnCount;
86 #endif
87 
88 };
89 
90 } // namespace Bempp
91 
92 #endif
virtual arma::Mat< ValueType > asMatrix() const
Matrix representation of the operator.
Definition: discrete_null_boundary_operator.cpp:55
virtual unsigned int columnCount() const
Number of columns of the operator.
Definition: discrete_null_boundary_operator.cpp:71
DiscreteNullBoundaryOperator(size_t rowCount_, size_t columnCount_)
Constructor.
Definition: discrete_null_boundary_operator.cpp:38
virtual void dump() const
Write a textual representation of the operator to standard output.
Definition: discrete_null_boundary_operator.cpp:49
virtual unsigned int rowCount() const
Number of rows of the operator.
Definition: discrete_null_boundary_operator.cpp:61
TranspositionMode
Enumeration determining how a discrete boundary operator is transformed before being applied...
Definition: transposition_mode.hpp:37
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_null_boundary_operator.cpp:81
Discrete boundary operator.
Definition: assembled_potential_operator.hpp:33
Null (zero-valued) discrete boundary operator.
Definition: discrete_null_boundary_operator.hpp:41