BEM++
2.0
|
Discrete linear operator stored as a H-matrix. More...
#include </home/wojtek/Projects/BEM/bempp-sven/bempp/lib/assembly/discrete_aca_boundary_operator.hpp>
Public Types | |
typedef Fiber::ScalarTraits < ValueType >::RealType | CoordinateType |
typedef AhmedDofWrapper < CoordinateType > | AhmedDofType |
typedef bbxbemblcluster < AhmedDofType, AhmedDofType > | AhmedBemBlcluster |
typedef mblock< typename AhmedTypeTraits< ValueType > ::Type > | AhmedMblock |
typedef boost::shared_array < AhmedMblock * > | AhmedMblockArray |
typedef boost::shared_array < AhmedMblock * > | AhmedConstMblockArray |
Public Member Functions | |
DiscreteAcaBoundaryOperator (unsigned int rowCount, unsigned int columnCount, double epsUsedInAssembly, int maximumRankUsedInAssembly, int symmetry, const shared_ptr< const AhmedBemBlcluster > &blockCluster_, const AhmedMblockArray &blocks_, const IndexPermutation &domainPermutation_, const IndexPermutation &rangePermutation_, const ParallelizationOptions ¶llelizationOptions_, const std::vector< AhmedConstMblockArray > &sharedBlocks_=std::vector< AhmedConstMblockArray >()) | |
Constructor. More... | |
DiscreteAcaBoundaryOperator (unsigned int rowCount, unsigned int columnCount, int maximumRankUsedInAssembly, int symmetry, std::auto_ptr< const AhmedBemBlcluster > blockCluster_, AhmedMblockArray blocks_, const IndexPermutation &domainPermutation_, const IndexPermutation &rangePermutation_, const ParallelizationOptions ¶llelizationOptions_, const std::vector< AhmedConstMblockArray > &sharedBlocks_=std::vector< AhmedConstMblockArray >()) BEMPP_DEPRECATED | |
Constructor. More... | |
BEMPP_DEPRECATED | DiscreteAcaBoundaryOperator (unsigned int rowCount, unsigned int columnCount, int maximumRankUsedInAssembly, int symmetry, const shared_ptr< const AhmedBemBlcluster > &blockCluster_, const AhmedMblockArray &blocks_, const IndexPermutation &domainPermutation_, const IndexPermutation &rangePermutation_, const ParallelizationOptions ¶llelizationOptions_, const std::vector< AhmedConstMblockArray > &sharedBlocks_=std::vector< AhmedConstMblockArray >()) |
Constructor. 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... | |
void | makeAllMblocksDense () |
Uncompress all blocks of the H-matrix and store them as dense matrices. More... | |
int | maximumRank () const |
Return the upper bound for the rank of low-rank mblocks specified during H-matrix construction. | |
double | eps () const |
Return the value of the epsilon parameter specified during H-matrix construction. | |
int | actualMaximumRank () const |
Return the actual maximum rank of low-rank mblocks. | |
int | symmetry () const |
Return a flag describing the symmetry of this operator. | |
shared_ptr< const AhmedBemBlcluster > | blockCluster () const |
Return the block cluster. | |
AhmedMblockArray | blocks () const |
Return the mblocks making up the H-matrix represented by this operator. More... | |
size_t | blockCount () const |
Return the number of mblocks making up this operator. | |
const IndexPermutation & | domainPermutation () const |
Return the domain index permutation. | |
const IndexPermutation & | rangePermutation () const |
Return the range index permutation. | |
const ParallelizationOptions & | parallelizationOptions () const |
Return the parallelization options used in the matrix-vector multiply. | |
std::vector < AhmedConstMblockArray > | sharedBlocks () const |
Return the vector of mblock arrays that this operator implicitly depends on. | |
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... | |
virtual void | dump () const |
Write a textual representation of the operator to standard output. More... | |
Static Public Member Functions | |
static const DiscreteAcaBoundaryOperator < ValueType > & | castToAca (const DiscreteBoundaryOperator< ValueType > &discreteOperator) |
Downcast a reference to a DiscreteBoundaryOperator object to DiscreteAcaBoundaryOperator. More... | |
static shared_ptr< const DiscreteAcaBoundaryOperator < ValueType > > | castToAca (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &discreteOperator) |
Downcast a shared pointer to a DiscreteBoundaryOperator object to a shared pointer to a DiscreteAcaBoundaryOperator. 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 Member Functions | |
virtual void | applyBuiltInImpl (const TranspositionMode trans, const arma::Col< ValueType > &x_in, arma::Col< ValueType > &y_inout, const ValueType alpha, const ValueType beta) const |
Friends | |
class | AcaApproximateLuInverse< ValueType > |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | acaOperatorSum (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op1, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op2, double eps, int maximumRank) |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | scaledAcaOperator (const ValueType &multiplier, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | scaledAcaOperator (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op, const ValueType &multiplier) |
Related Functions | |
(Note that these are not member functions.) | |
template<typename ValueType > | |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | acaOperatorSum (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op1, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op2, double eps, int maximumRank) |
Add two discrete boundary operators stored as H-matrices. More... | |
template<typename ValueType > | |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | scaledAcaOperator (const ValueType &multiplier, const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op) |
Multiply the H-matrix representation of a discrete boundary operator by a scalar and wrap the result in a new discrete boundary operator. More... | |
template<typename ValueType > | |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | scaledAcaOperator (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op, const ValueType &multiplier) |
Multiply the H-matrix representation of a discrete boundary operator by a scalar and wrap the result in a new discrete boundary operator. More... | |
template<typename ValueType > | |
shared_ptr< const DiscreteBoundaryOperator < ValueType > > | acaOperatorApproximateLuInverse (const shared_ptr< const DiscreteBoundaryOperator< ValueType > > &op, double delta) |
LU inverse of a discrete boundary operator stored as a H-matrix. 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 linear operator stored as a H-matrix.
Bempp::DiscreteAcaBoundaryOperator< ValueType >::DiscreteAcaBoundaryOperator | ( | unsigned int | rowCount, |
unsigned int | columnCount, | ||
double | epsUsedInAssembly, | ||
int | maximumRankUsedInAssembly, | ||
int | symmetry, | ||
const shared_ptr< const AhmedBemBlcluster > & | blockCluster_, | ||
const AhmedMblockArray & | blocks_, | ||
const IndexPermutation & | domainPermutation_, | ||
const IndexPermutation & | rangePermutation_, | ||
const ParallelizationOptions & | parallelizationOptions_, | ||
const std::vector< AhmedConstMblockArray > & | sharedBlocks_ = std::vector<AhmedConstMblockArray>() |
||
) |
Constructor.
[in] | rowCount | Number of rows. |
[in] | columnCount | Number of columns. |
[in] | epsUsedInAssembly | The epsilon parameter used during assembly of the H-matrix. |
[in] | maximumRankUsedInAssembly | The limit on block rank used during assembly of the H-matrix. This is used in particular when generating the approximate H-matrix LU. |
[in] | symmetry | H-matrix symmetry. Can be any combination of the flags defined in the Symmetry enumeration type. |
[in] | blockCluster_ | Block cluster defining the structure of the H-matrix. |
[in] | blocks_ | Array containing the H-matrix blocks. |
[in] | domainPermutation_ | Mapping from original to permuted column indices. |
[in] | rangePermutation_ | Mapping from original to permuted row indices. |
[in] | parallelizationOptions_ | Options determining the maximum number of threads used in the apply() routine for the H-matrix-vector product. |
[in] | sharedBlocks_ | Vector of arrays of mblocks on which this operator implicitly depends and which therefore must stay alive for the lifetime of this operator. Useful for constructing ACA operators that combine mblocks of several other operators. |
Bempp::DiscreteAcaBoundaryOperator< ValueType >::DiscreteAcaBoundaryOperator | ( | unsigned int | rowCount, |
unsigned int | columnCount, | ||
int | maximumRankUsedInAssembly, | ||
int | symmetry, | ||
std::auto_ptr< const AhmedBemBlcluster > | blockCluster_, | ||
AhmedMblockArray | blocks_, | ||
const IndexPermutation & | domainPermutation_, | ||
const IndexPermutation & | rangePermutation_, | ||
const ParallelizationOptions & | parallelizationOptions_, | ||
const std::vector< AhmedConstMblockArray > & | sharedBlocks_ = std::vector<AhmedConstMblockArray>() |
||
) |
Constructor.
[in] | rowCount | Number of rows. |
[in] | columnCount | Number of columns. |
[in] | maximumRankUsedInAssembly | The limit on block rank used during assembly of the H-matrix. This is used in particular when generating the approximate H-matrix LU. |
[in] | symmetry | H-matrix symmetry. Can be any combination of the flags defined in the Symmetry enumeration type. |
[in] | blockCluster_ | Block cluster defining the structure of the H-matrix. |
[in] | blocks_ | Array containing the H-matrix blocks. |
[in] | domainPermutation_ | Mapping from original to permuted column indices. |
[in] | rangePermutation_ | Mapping from original to permuted row indices. |
[in] | parallelizationOptions_ | Options determining the maximum number of threads used in the apply() routine for the H-matrix-vector product. |
[in] | sharedBlocks_ | Vector of arrays of mblocks on which this operator implicitly depends and which therefore must stay alive for the lifetime of this operator. Useful for constructing ACA operators that combine mblocks of several other operators. |
Bempp::DiscreteAcaBoundaryOperator< ValueType >::DiscreteAcaBoundaryOperator | ( | unsigned int | rowCount, |
unsigned int | columnCount, | ||
int | maximumRankUsedInAssembly, | ||
int | symmetry, | ||
const shared_ptr< const AhmedBemBlcluster > & | blockCluster_, | ||
const AhmedMblockArray & | blocks_, | ||
const IndexPermutation & | domainPermutation_, | ||
const IndexPermutation & | rangePermutation_, | ||
const ParallelizationOptions & | parallelizationOptions_, | ||
const std::vector< AhmedConstMblockArray > & | sharedBlocks_ = std::vector<AhmedConstMblockArray>() |
||
) |
Constructor.
[in] | rowCount | Number of rows. |
[in] | columnCount | Number of columns. |
[in] | maximumRankUsedInAssembly | The limit on block rank used during assembly of the H-matrix. This is used in particular when generating the approximate H-matrix LU. |
[in] | symmetry | H-matrix symmetry. Can be any combination of the flags defined in the Symmetry enumeration type. |
[in] | blockCluster_ | Block cluster defining the structure of the H-matrix. |
[in] | blocks_ | Array containing the H-matrix blocks. |
[in] | domainPermutation_ | Mapping from original to permuted column indices. |
[in] | rangePermutation_ | Mapping from original to permuted row indices. |
[in] | parallelizationOptions_ | Options determining the maximum number of threads used in the apply() routine for the H-matrix-vector product. |
[in] | sharedBlocks_ | Vector of arrays of mblocks on which this operator implicitly depends and which therefore must stay alive for the lifetime of this operator. Useful for constructing ACA operators that combine mblocks of several other operators. |
|
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 >.
DiscreteAcaBoundaryOperator< ValueType >::AhmedMblockArray Bempp::DiscreteAcaBoundaryOperator< ValueType >::blocks | ( | ) | const |
Return the mblocks making up the H-matrix represented by this operator.
|
static |
Downcast a reference to a DiscreteBoundaryOperator object to DiscreteAcaBoundaryOperator.
If the object referenced by discreteOperator
is not in fact a DiscreteAcaBoundaryOperator, a std::bad_cast exception is thrown.
Referenced by Bempp::DiscreteAcaBoundaryOperator< ValueType >::acaOperatorApproximateLuInverse(), Bempp::DiscreteAcaBoundaryOperator< ValueType >::acaOperatorSum(), and Bempp::DiscreteAcaBoundaryOperator< ValueType >::scaledAcaOperator().
|
static |
Downcast a shared pointer to a DiscreteBoundaryOperator object to a shared pointer to a DiscreteAcaBoundaryOperator.
If the object referenced by discreteOperator
is not in fact a DiscreteAcaBoundaryOperator, a std::bad_cast exception is thrown.
void Bempp::DiscreteAcaBoundaryOperator< ValueType >::makeAllMblocksDense | ( | ) |
Uncompress all blocks of the H-matrix and store them as dense matrices.
Sometimes useful for debugging.
|
related |
LU inverse of a discrete boundary operator stored as a H-matrix.
[in] | op | Discrete boundary operator for which to compute the LU inverse. |
[in] | delta | Approximation accuracy of the inverse. |
op
and stored as an (approximate) LU decomposition of op
. References Bempp::DiscreteAcaBoundaryOperator< ValueType >::castToAca().
|
related |
Add two discrete boundary operators stored as H-matrices.
A std::bad_cast exception is thrown if the input operators can not be cast to DiscreteAcaBoundaryOperator.
[in] | op1 | First operand. |
[in] | op2 | Second operand. |
[in] | eps | ??? |
[in] | maximumRank | Maximum rank of blocks that should be considered low-rank in the H-matrix to be constructed. |
op1
and op2
stored as a single H-matrix. References Bempp::DiscreteAcaBoundaryOperator< ValueType >::castToAca().
|
related |
Multiply the H-matrix representation of a discrete boundary operator by a scalar and wrap the result in a new discrete boundary operator.
A std::bad_cast exception is thrown if the input operator can not be cast to DiscreteAcaBoundaryOperator
[in] | multiplier | Scalar multiplier. |
[in] | op | Discrete boundary operator to be multiplied. |
op
multiplied by multiplier
and stored as a H-matrix. References Bempp::DiscreteAcaBoundaryOperator< ValueType >::castToAca().
|
related |
Multiply the H-matrix representation of a discrete boundary operator by a scalar and wrap the result in a new discrete boundary operator.
A std::bad_cast exception is thrown if the input operator can not be cast to DiscreteAcaBoundaryOperator
[in] | op | Discrete boundary operator to be multiplied. |
[in] | multiplier | Scalar multiplier. |
op
multiplied by multiplier
and stored as a H-matrix.