21 #ifndef bempp_discrete_sparse_boundary_operator_hpp
22 #define bempp_discrete_sparse_boundary_operator_hpp
24 #include "../common/common.hpp"
25 #include "bempp/common/config_ahmed.hpp"
26 #include "bempp/common/config_trilinos.hpp"
28 #include "discrete_boundary_operator.hpp"
30 #include "ahmed_aux_fwd.hpp"
31 #include "symmetry.hpp"
32 #include "transposition_mode.hpp"
34 #include "../common/shared_ptr.hpp"
35 #include "../common/boost_shared_array_fwd.hpp"
36 #include "../fiber/scalar_traits.hpp"
39 #include <Teuchos_RCP.hpp>
40 #include <Thyra_SpmdVectorSpaceBase_decl.hpp>
42 class Epetra_CrsMatrix;
49 class IndexPermutation;
55 template <
typename ValueType>
61 typedef bbxbemblcluster<AhmedDofType, AhmedDofType> AhmedBemBlcluster;
62 typedef mblock<typename AhmedTypeTraits<ValueType>::Type> AhmedMblock;
78 const shared_ptr<const Epetra_CrsMatrix>& mat,
79 int symmetry = NO_SYMMETRY,
81 const shared_ptr<AhmedBemBlcluster>& blockCluster =
82 shared_ptr<AhmedBemBlcluster>(),
83 const shared_ptr<IndexPermutation>& domainPermutation =
84 shared_ptr<IndexPermutation>(),
85 const shared_ptr<IndexPermutation>& rangePermutation =
86 shared_ptr<IndexPermutation>());
94 virtual void dump()
const;
96 virtual arma::Mat<ValueType>
asMatrix()
const;
98 virtual unsigned int rowCount()
const;
101 virtual void addBlock(
const std::vector<int>& rows,
102 const std::vector<int>& cols,
103 const ValueType alpha,
104 arma::Mat<ValueType>& block)
const;
107 virtual shared_ptr<const DiscreteBoundaryOperator<ValueType> >
109 bool interleave=
false)
const;
117 static shared_ptr<const DiscreteSparseBoundaryOperator<ValueType> >
castToSparse(
128 shared_ptr<const Epetra_CrsMatrix>
epetraMatrix()
const;
145 virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > domain()
const;
146 virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > range()
const;
149 virtual bool opSupportedImpl(Thyra::EOpTransp M_trans)
const;
155 const arma::Col<ValueType>& x_in,
156 arma::Col<ValueType>& y_inout,
157 const ValueType alpha,
158 const ValueType beta)
const;
159 bool isTransposed()
const;
174 shared_ptr<const Epetra_CrsMatrix> m_mat;
177 shared_ptr<AhmedBemBlcluster> m_blockCluster;
179 shared_ptr<IndexPermutation> m_domainPermutation, m_rangePermutation;
180 Teuchos::RCP<const Thyra::SpmdVectorSpaceBase<ValueType> > m_domainSpace;
181 Teuchos::RCP<const Thyra::SpmdVectorSpaceBase<ValueType> > m_rangeSpace;
Traits of scalar types.
Definition: scalar_traits.hpp:40
Discrete boundary operator stored as a sparse matrix.
Definition: discrete_sparse_boundary_operator.hpp:56
virtual arma::Mat< ValueType > asMatrix() const
Matrix representation of the operator.
Definition: discrete_sparse_boundary_operator.cpp:233
virtual unsigned int columnCount() const
Number of columns of the operator.
Definition: discrete_sparse_boundary_operator.cpp:272
virtual unsigned int rowCount() const
Number of rows of the operator.
Definition: discrete_sparse_boundary_operator.cpp:266
TranspositionMode transpositionMode() const
Return the active sparse matrix transformation.
Definition: discrete_sparse_boundary_operator.cpp:408
shared_ptr< const Epetra_CrsMatrix > epetraMatrix() const
Return a shared pointer to the sparse matrix stored within this operator.
Definition: discrete_sparse_boundary_operator.cpp:401
DiscreteSparseBoundaryOperator(const shared_ptr< const Epetra_CrsMatrix > &mat, int symmetry=NO_SYMMETRY, TranspositionMode trans=NO_TRANSPOSE, const shared_ptr< AhmedBemBlcluster > &blockCluster=shared_ptr< AhmedBemBlcluster >(), const shared_ptr< IndexPermutation > &domainPermutation=shared_ptr< IndexPermutation >(), const shared_ptr< IndexPermutation > &rangePermutation=shared_ptr< IndexPermutation >())
Constructor.
Definition: discrete_sparse_boundary_operator.cpp:205
TranspositionMode
Enumeration determining how a discrete boundary operator is transformed before being applied...
Definition: transposition_mode.hpp:37
static shared_ptr< const DiscreteSparseBoundaryOperator< ValueType > > castToSparse(const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &discreteOperator)
Downcast a shared pointer to a DiscreteBoundaryOperator object to a shared pointer to a DiscreteSpars...
Definition: discrete_sparse_boundary_operator.cpp:387
Discrete boundary operator.
Definition: assembled_potential_operator.hpp:33
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_sparse_boundary_operator.cpp:278
An Ahmed-compatible degree-of-freedom type.
Definition: ahmed_aux.hpp:89
Use the non-transposed operator.
Definition: transposition_mode.hpp:41
int symmetryMode() const
Return the symmetry type of the sparse matrix.
Definition: discrete_sparse_boundary_operator.hpp:139
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_sparse_boundary_operator.cpp:331
virtual void dump() const
Write a textual representation of the operator to standard output.
Definition: discrete_sparse_boundary_operator.cpp:223