21 #include "bempp/common/config_trilinos.hpp"
22 #include "bempp/common/config_ahmed.hpp"
26 #ifndef bempp_discrete_aca_boundary_operator_hpp
27 #define bempp_discrete_aca_boundary_operator_hpp
29 #include "../common/common.hpp"
31 #include "discrete_boundary_operator.hpp"
32 #include "ahmed_aux_fwd.hpp"
33 #include "assembly_options.hpp"
34 #include "index_permutation.hpp"
35 #include "symmetry.hpp"
36 #include "../fiber/scalar_traits.hpp"
39 #include "../common/boost_shared_array_fwd.hpp"
42 #include <Teuchos_RCP.hpp>
43 #include <Thyra_SpmdVectorSpaceBase_decl.hpp>
49 void dumpblcluster(
const blcluster* bl,
const std::string& indent);
54 template <
typename ValueType>
class AcaApproximateLuInverse;
55 template <
typename ValueType>
class DiscreteAcaBoundaryOperator;
75 template <
typename ValueType>
76 shared_ptr<const DiscreteBoundaryOperator<ValueType> > acaOperatorSum(
77 const shared_ptr<
const DiscreteBoundaryOperator<ValueType> >& op1,
78 const shared_ptr<
const DiscreteBoundaryOperator<ValueType> >& op2,
79 double eps,
int maximumRank);
94 template <
typename ValueType>
95 shared_ptr<const DiscreteBoundaryOperator<ValueType> > scaledAcaOperator(
96 const ValueType& multiplier,
97 const shared_ptr<
const DiscreteBoundaryOperator<ValueType> >& op);
112 template <
typename ValueType>
113 shared_ptr<const DiscreteBoundaryOperator<ValueType> > scaledAcaOperator(
114 const shared_ptr<
const DiscreteBoundaryOperator<ValueType> >& op,
115 const ValueType& multiplier);
133 template <
typename ValueType>
134 shared_ptr<const DiscreteBoundaryOperator<ValueType> > acaOperatorApproximateLuInverse(
135 const shared_ptr<
const DiscreteBoundaryOperator<ValueType> >& op,
143 template <
typename ValueType>
148 friend shared_ptr<const DiscreteBoundaryOperator<ValueType> > acaOperatorSum<>(
149 const shared_ptr<const DiscreteBoundaryOperator<ValueType> >& op1,
150 const shared_ptr<const DiscreteBoundaryOperator<ValueType> >& op2,
153 friend shared_ptr<const DiscreteBoundaryOperator<ValueType> > scaledAcaOperator<>(
154 const ValueType& multiplier,
155 const shared_ptr<const DiscreteBoundaryOperator<ValueType> >& op);
157 friend shared_ptr<const DiscreteBoundaryOperator<ValueType> > scaledAcaOperator<>(
158 const shared_ptr<const DiscreteBoundaryOperator<ValueType> >& op,
159 const ValueType& multiplier);
164 typedef bbxbemblcluster<AhmedDofType, AhmedDofType> AhmedBemBlcluster;
165 typedef mblock<typename AhmedTypeTraits<ValueType>::Type> AhmedMblock;
166 typedef boost::shared_array<AhmedMblock*> AhmedMblockArray;
171 typedef boost::shared_array<AhmedMblock*> AhmedConstMblockArray;
210 double epsUsedInAssembly,
211 int maximumRankUsedInAssembly,
213 const shared_ptr<const AhmedBemBlcluster>& blockCluster_,
214 const AhmedMblockArray& blocks_,
218 const std::vector<AhmedConstMblockArray>& sharedBlocks_ =
219 std::vector<AhmedConstMblockArray>());
257 unsigned int rowCount,
unsigned int columnCount,
258 int maximumRankUsedInAssembly,
260 std::auto_ptr<const AhmedBemBlcluster> blockCluster_,
261 AhmedMblockArray blocks_,
265 const std::vector<AhmedConstMblockArray>& sharedBlocks_ =
306 unsigned int rowCount,
unsigned int columnCount,
307 int maximumRankUsedInAssembly,
309 const shared_ptr<const AhmedBemBlcluster>& blockCluster_,
310 const AhmedMblockArray& blocks_,
314 const std::vector<AhmedConstMblockArray>& sharedBlocks_ =
315 std::vector<AhmedConstMblockArray>());
317 virtual arma::Mat<ValueType>
asMatrix()
const;
319 virtual unsigned int rowCount()
const;
322 virtual void addBlock(
const std::vector<int>& rows,
323 const std::vector<int>& cols,
324 const ValueType alpha,
325 arma::Mat<ValueType>& block)
const;
327 virtual shared_ptr<const DiscreteBoundaryOperator<ValueType> >
329 bool interleave=
false)
const;
350 static shared_ptr<const DiscreteAcaBoundaryOperator<ValueType> >
castToAca(
369 shared_ptr<const AhmedBemBlcluster>
blockCluster()
const;
377 AhmedMblockArray
blocks()
const;
394 std::vector<AhmedConstMblockArray>
sharedBlocks()
const;
398 virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > domain()
const;
399 virtual Teuchos::RCP<const Thyra::VectorSpaceBase<ValueType> > range()
const;
402 virtual bool opSupportedImpl(Thyra::EOpTransp M_trans)
const;
407 const arma::Col<ValueType>& x_in,
408 arma::Col<ValueType>& y_inout,
409 const ValueType alpha,
410 const ValueType beta)
const;
415 Teuchos::RCP<const Thyra::SpmdVectorSpaceBase<ValueType> > m_domainSpace;
416 Teuchos::RCP<const Thyra::SpmdVectorSpaceBase<ValueType> > m_rangeSpace;
418 unsigned int m_rowCount;
419 unsigned int m_columnCount;
425 shared_ptr<const AhmedBemBlcluster> m_blockCluster;
426 AhmedMblockArray m_blocks;
431 std::vector<AhmedConstMblockArray> m_sharedBlocks;
Traits of scalar types.
Definition: scalar_traits.hpp:40
void makeAllMblocksDense()
Uncompress all blocks of the H-matrix and store them as dense matrices.
Definition: discrete_aca_boundary_operator.cpp:583
int actualMaximumRank() const
Return the actual maximum rank of low-rank mblocks.
Definition: discrete_aca_boundary_operator.cpp:606
Permutation of indices.
Definition: index_permutation.hpp:39
Parallel operation settings.
Definition: parallelization_options.hpp:32
Approximate LU decomposition of a H-matrix.
Definition: aca_approximate_lu_inverse.hpp:52
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_aca_boundary_operator.cpp:390
size_t blockCount() const
Return the number of mblocks making up this operator.
Definition: discrete_aca_boundary_operator.cpp:636
#define BEMPP_DEPRECATED
Macro used to mark deprecated functions or classes.
Definition: deprecated.hpp:41
const IndexPermutation & rangePermutation() const
Return the range index permutation.
Definition: discrete_aca_boundary_operator.cpp:650
TranspositionMode
Enumeration determining how a discrete boundary operator is transformed before being applied...
Definition: transposition_mode.hpp:37
Discrete linear operator stored as a H-matrix.
Definition: discrete_aca_boundary_operator.hpp:144
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_aca_boundary_operator.cpp:401
Discrete boundary operator.
Definition: assembled_potential_operator.hpp:33
An Ahmed-compatible degree-of-freedom type.
Definition: ahmed_aux.hpp:89
int maximumRank() const
Return the upper bound for the rank of low-rank mblocks specified during H-matrix construction...
Definition: discrete_aca_boundary_operator.cpp:599
virtual unsigned int columnCount() const
Number of columns of the operator.
Definition: discrete_aca_boundary_operator.cpp:378
std::vector< AhmedConstMblockArray > sharedBlocks() const
Return the vector of mblock arrays that this operator implicitly depends on.
Definition: discrete_aca_boundary_operator.cpp:664
const IndexPermutation & domainPermutation() const
Return the domain index permutation.
Definition: discrete_aca_boundary_operator.cpp:643
shared_ptr< const AhmedBemBlcluster > blockCluster() const
Return the block cluster.
Definition: discrete_aca_boundary_operator.cpp:622
virtual arma::Mat< ValueType > asMatrix() const
Matrix representation of the operator.
Definition: discrete_aca_boundary_operator.cpp:322
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.
Definition: discrete_aca_boundary_operator.cpp:225
double eps() const
Return the value of the epsilon parameter specified during H-matrix construction. ...
Definition: discrete_aca_boundary_operator.cpp:592
int symmetry() const
Return a flag describing the symmetry of this operator.
Definition: discrete_aca_boundary_operator.cpp:615
virtual unsigned int rowCount() const
Number of rows of the operator.
Definition: discrete_aca_boundary_operator.cpp:366
const ParallelizationOptions & parallelizationOptions() const
Return the parallelization options used in the matrix-vector multiply.
Definition: discrete_aca_boundary_operator.cpp:657
static const DiscreteAcaBoundaryOperator< ValueType > & castToAca(const DiscreteBoundaryOperator< ValueType > &discreteOperator)
Downcast a reference to a DiscreteBoundaryOperator object to DiscreteAcaBoundaryOperator.
Definition: discrete_aca_boundary_operator.cpp:409
AhmedMblockArray blocks() const
Return the mblocks making up the H-matrix represented by this operator.
Definition: discrete_aca_boundary_operator.cpp:629