BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Related Functions | List of all members
Bempp::DiscreteSparseBoundaryOperator< ValueType > Class Template Reference

Discrete boundary operator stored as a sparse matrix. More...

#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/assembly/discrete_sparse_boundary_operator.hpp>

Inheritance diagram for Bempp::DiscreteSparseBoundaryOperator< ValueType >:
Bempp::DiscreteBoundaryOperator< ValueType >

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
 
- Public Member Functions inherited from Bempp::DiscreteBoundaryOperator< ValueType >
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
 
- Protected Member Functions inherited from Bempp::DiscreteBoundaryOperator< ValueType >
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...
 

Detailed Description

template<typename ValueType>
class Bempp::DiscreteSparseBoundaryOperator< ValueType >

Discrete boundary operator stored as a sparse matrix.

Constructor & Destructor Documentation

template<typename ValueType >
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.

Parameters
[in]matSparse matrix that will be represented by the newly constructed operator. Must not be null.
[in]symmetrySymmetry of the matrix. May be any combination of flags defined in the Symmetry enumeration type.
[in]transIf different from NO_TRANSPOSE, the discrete operator will represent a transposed and/or complex-conjugated matrix mat.

Member Function Documentation

template<typename ValueType >
void Bempp::DiscreteSparseBoundaryOperator< ValueType >::addBlock ( const std::vector< int > &  rows,
const std::vector< int > &  cols,
const ValueType  alpha,
arma::Mat< ValueType > &  block 
) const
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.

Parameters
[in]rowsVector of row indices.
[in]colsVector of column indices.
[in]alphaMultiplier.
[in,out]blockOn 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 >.

template<typename ValueType >
shared_ptr< const DiscreteBoundaryOperator< ValueType > > Bempp::DiscreteSparseBoundaryOperator< ValueType >::asDiscreteAcaBoundaryOperator ( double  eps = -1,
int  maximumRank = -1,
bool  interleave = false 
) const
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.

Parameters
[in]epsThe $\epsilon$ parameter controlling the accuracy of H-matrix addition in case this operation is needed to construct the H-matrix representation of the operator. If eps is negative (default), it is set to the smaller of the values of $\epsilon$ specified during the creation of the two H-matrices to be added.
[in]maximumRankMaximum 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.
Returns
A pointer to a DiscreteBoundaryOperator object castable to DiscreteAcaBoundaryOperator.
Note
This function throws an exception if BEM++ has been compiled without AHMED.

Reimplemented from Bempp::DiscreteBoundaryOperator< ValueType >.

template<typename ValueType >
arma::Mat< ValueType > Bempp::DiscreteSparseBoundaryOperator< ValueType >::asMatrix ( ) const
virtual

Matrix representation of the operator.

The default implementation is slow and should be overridden where possible.

Reimplemented from Bempp::DiscreteBoundaryOperator< ValueType >.

template<typename ValueType >
shared_ptr< const DiscreteSparseBoundaryOperator< ValueType > > Bempp::DiscreteSparseBoundaryOperator< ValueType >::castToSparse ( const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &  discreteOperator)
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().

template<typename ValueType >
void Bempp::DiscreteSparseBoundaryOperator< ValueType >::dump ( ) const
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 >.

template<typename ValueType >
shared_ptr< const Epetra_CrsMatrix > Bempp::DiscreteSparseBoundaryOperator< ValueType >::epetraMatrix ( ) const

Return a shared pointer to the sparse matrix stored within this operator.

Note
The discrete operator represents the matrix returned by this function and possibly transposed and/or complex-conjugated, depending on the value returned by transpositionMode().
template<typename ValueType >
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).

Friends And Related Function Documentation

template<typename ValueType >
shared_ptr< Epetra_CrsMatrix > sparseCholesky ( const Epetra_CrsMatrix &  mat)
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

\[ A = L L^T, \]

where $A$ is the matrix represented by mat.

template<typename ValueType >
shared_ptr< Epetra_CrsMatrix > sparseInverse ( const Epetra_CrsMatrix &  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 $A$ is usually not the most accurate way to solve the equation $A^{-1} X = B$.


The documentation for this class was generated from the following files: