BEM++
2.0
|
Discrete boundary operator stored as a sparse matrix. More...
#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/assembly/discrete_sparse_boundary_operator.hpp>
Public Member Functions | |
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. More... | |
virtual void | dump () const |
Write a textual representation of the operator to standard output. More... | |
virtual arma::Mat< ValueType > | asMatrix () const |
Matrix representation of the operator. More... | |
virtual unsigned int | rowCount () const |
Number of rows of the operator. | |
virtual unsigned int | columnCount () const |
Number of columns of the operator. | |
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. More... | |
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. More... | |
shared_ptr< const Epetra_CrsMatrix > | epetraMatrix () const |
Return a shared pointer to the sparse matrix stored within this operator. More... | |
TranspositionMode | transpositionMode () const |
Return the active sparse matrix transformation. More... | |
int | symmetryMode () const |
Return the symmetry type of the sparse matrix. | |
virtual Teuchos::RCP< const Thyra::VectorSpaceBase < ValueType > > | domain () const |
virtual Teuchos::RCP< const Thyra::VectorSpaceBase < ValueType > > | range () const |
![]() | |
virtual | ~DiscreteBoundaryOperator () |
Destructor. | |
void | apply (const Thyra::EOpTransp M_trans, const Thyra::MultiVectorBase< ValueType > &x_in, const Thyra::Ptr< Thyra::MultiVectorBase< ValueType > > &y_inout, const ValueType alpha, const ValueType beta) const |
Apply the linear operator to a multivector. More... | |
void | apply (const TranspositionMode trans, const arma::Mat< ValueType > &x_in, arma::Mat< ValueType > &y_inout, const ValueType alpha, const ValueType beta) const |
Apply the operator to a vector. More... | |
Static Public Member Functions | |
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 DiscreteSparseBoundaryOperator. More... | |
Protected Member Functions | |
virtual bool | opSupportedImpl (Thyra::EOpTransp M_trans) const |
![]() | |
virtual void | applyImpl (const Thyra::EOpTransp M_trans, const Thyra::MultiVectorBase< ValueType > &X_in, const Teuchos::Ptr< Thyra::MultiVectorBase< ValueType > > &Y_inout, const ValueType alpha, const ValueType beta) const |
Private Types | |
typedef Fiber::ScalarTraits < ValueType >::RealType | CoordinateType |
typedef AhmedDofWrapper < CoordinateType > | AhmedDofType |
typedef bbxbemblcluster < AhmedDofType, AhmedDofType > | AhmedBemBlcluster |
typedef mblock< typename AhmedTypeTraits< ValueType > ::Type > | AhmedMblock |
Related Functions | |
(Note that these are not member functions.) | |
shared_ptr< Epetra_CrsMatrix > | sparseCholesky (const Epetra_CrsMatrix &mat) |
Return the first factor of the Cholesky factorisation of matrix mat . More... | |
shared_ptr< Epetra_CrsMatrix > | sparseInverse (const Epetra_CrsMatrix &mat) |
Return the inverse of a block-diagonal sparse matrix mat . More... | |
![]() | |
template<typename ValueType > | |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | operator+ (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
Unary plus: return a copy of the argument. | |
template<typename ValueType > | |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | operator- (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
Return a shared pointer to a DiscreteBoundaryOperator representing the operand multiplied by -1. More... | |
template<typename ValueType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | operator+ (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op1, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op2) |
Return a shared pointer to a DiscreteBoundaryOperator representing the sum of the operands. More... | |
template<typename ValueType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | operator- (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op1, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op2) |
Return a shared pointer to a DiscreteBoundaryOperator representing the difference of the operands. More... | |
template<typename ValueType , typename ScalarType > | |
boost::enable_if< typename boost::mpl::has_key < boost::mpl::set< float, double, std::complex< float > , std::complex< double > >, ScalarType >, shared_ptr < DiscreteBoundaryOperator < ValueType > > >::type | operator* (ScalarType scalar, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
Return a shared pointer to a DiscreteBoundaryOperator representing the operator *op multiplied by scalar . More... | |
template<typename ValueType , typename ScalarType > | |
boost::enable_if< typename boost::mpl::has_key < boost::mpl::set< float, double, std::complex< float > , std::complex< double > >, ScalarType >, shared_ptr < DiscreteBoundaryOperator < ValueType > > >::type | operator* (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op, ScalarType scalar) |
Return a shared pointer to a DiscreteBoundaryOperator representing the operator *op multiplied by scalar . More... | |
template<typename ValueType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | operator* (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op1, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op2) |
Return a shared pointer to a DiscreteBoundaryOperator representing a composition of operators, (*op1) * (*op2) . More... | |
template<typename ValueType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | mul (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op1, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op2) |
Return a shared pointer to a DiscreteBoundaryOperator representing a composition of operators, (*op1) * (*op2) . More... | |
template<typename ValueType , typename ScalarType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | operator/ (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op, ScalarType scalar) |
Return a shared pointer to a DiscreteBoundaryOperator representing the operator *op divided by scalar . More... | |
template<typename ValueType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | transpose (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
Return a shared pointer to a DiscreteBoundaryOperator representing the transposed operator *op . More... | |
template<typename ValueType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | conjugate (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
Return a shared pointer to a DiscreteBoundaryOperator representing the conjugated operator *op . More... | |
template<typename ValueType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | conjugateTranspose (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
Return a shared pointer to a DiscreteBoundaryOperator representing the conjugate-transposed operator *op . More... | |
template<typename ValueType > | |
shared_ptr < DiscreteBoundaryOperator < ValueType > > | transpose (TranspositionMode trans, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
Return a shared pointer to a DiscreteBoundaryOperator representing the transposed and/or conjugated (depending on the value of the argument trans ) operator *op . More... | |
template<typename RealType > | |
shared_ptr < DiscreteBoundaryOperator < std::complex< RealType > > > | complexify (const shared_ptr< const DiscreteBoundaryOperator< RealType > > &op) |
Return a shared pointer to a DiscreteBoundaryOperator representing the "complexified" operator *op . More... | |
Discrete boundary operator stored as a sparse matrix.
Bempp::DiscreteSparseBoundaryOperator< ValueType >::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.
[in] | mat | Sparse matrix that will be represented by the newly constructed operator. Must not be null. |
[in] | symmetry | Symmetry of the matrix. May be any combination of flags defined in the Symmetry enumeration type. |
[in] | trans | If different from NO_TRANSPOSE, the discrete operator will represent a transposed and/or complex-conjugated matrix mat . |
|
virtual |
Add a subblock of this operator to a matrix.
Perform the operation block += alpha * L[rows, cols]
, where block
is a matrix, alpha
a scalar and L[rows, cols]
a subblock of this discrete linear operator.
[in] | rows | Vector of row indices. |
[in] | cols | Vector of column indices. |
[in] | alpha | Multiplier. |
[in,out] | block | On entry, matrix of size (rows.size() , cols.size() ). On exit, each element (i, j) of this matrix will be augmented by the element (rows[i] , cols[j] ) of this operator, multiplied by alpha . |
Row and column indices may be unsorted.
This method need not be supported by all subclasses. It is mainly intended for internal use during weak-form assembly.
Implements Bempp::DiscreteBoundaryOperator< ValueType >.
|
virtual |
Return a representation that can be cast to a DiscreteAcaBoundaryOperator.
The conversion only succeeds if all members of the DiscreteBoundaryOperator itself can be cast to a DiscreteAcaBoundaryOperator or if it is a linear combination of DiscreteOperators that can be cast to type DiscreteAcaBoundaryOperator. Operator compositions are not yet supported by this function.
[in] | eps | The ![]() eps is negative (default), it is set to the smaller of the values of ![]() |
[in] | maximumRank | Maximum rank of blocks to be considered low rank when adding two H-Matrices. If maximumRank is negative, it is set to the larger of the maximum ranks specified during the creation of the two H-matrices to be added. |
Reimplemented from Bempp::DiscreteBoundaryOperator< ValueType >.
|
virtual |
Matrix representation of the operator.
The default implementation is slow and should be overridden where possible.
Reimplemented from Bempp::DiscreteBoundaryOperator< ValueType >.
|
static |
Downcast a shared pointer to a DiscreteBoundaryOperator object to a shared pointer to a DiscreteSparseBoundaryOperator.
If the object referenced by discreteOperator
is not in fact a DiscreteSparseBoundaryOperator, a std::bad_cast exception is thrown.
Referenced by Bempp::DiscreteInverseSparseBoundaryOperator< ValueType >::discreteSparseInverse().
|
virtual |
Write a textual representation of the operator to standard output.
The default implementation prints the matrix returned by asMatrix().
Reimplemented from Bempp::DiscreteBoundaryOperator< ValueType >.
shared_ptr< const Epetra_CrsMatrix > Bempp::DiscreteSparseBoundaryOperator< ValueType >::epetraMatrix | ( | ) | const |
Return a shared pointer to the sparse matrix stored within this operator.
TranspositionMode Bempp::DiscreteSparseBoundaryOperator< ValueType >::transpositionMode | ( | ) | const |
Return the active sparse matrix transformation.
Indicates whether this operator represents the unmodified sparse matrix passed in the constructor or its transformation (transposition and/or conjugation).
|
related |
Return the first factor of the Cholesky factorisation of matrix mat
.
The matrix mat
is assumed to be symmetric, positive-definite and block-diagonal (effectively it should be the mass matrix of a space of discontinuous functions). The routine returns a shared pointer to a matrix L such that
where is the matrix represented by
mat
.
|
related |
Return the inverse of a block-diagonal sparse matrix mat
.
In practice, mat
might be the mass matrix of a space of discontinuous functions.
Be aware that explicit inversion of is usually not the most accurate way to solve the equation
.