MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

#include <MueLu_UtilitiesBase_fwd.hpp>

Inheritance diagram for MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >:
MueLu::Utilities< Scalar, LocalOrdinal, GlobalOrdinal, Node >

Public Types

typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
Magnitude
 

Static Public Member Functions

static RCP< MatrixCrs2Op (RCP< CrsMatrix > Op)
 
static Teuchos::ArrayRCP< ScalarGetMatrixDiagonal (const Matrix &A)
 Extract Matrix Diagonal. More...
 
static RCP< VectorGetMatrixDiagonalInverse (const Matrix &A, Magnitude tol=Teuchos::ScalarTraits< Scalar >::eps()*100)
 Extract Matrix Diagonal. More...
 
static Teuchos::ArrayRCP< ScalarGetLumpedMatrixDiagonal (const Matrix &A)
 Extract Matrix Diagonal of lumped matrix. More...
 
static Teuchos::RCP< VectorGetLumpedMatrixDiagonal (Teuchos::RCP< const Matrix > rcpA)
 Extract Matrix Diagonal of lumped matrix. More...
 
static Teuchos::RCP< VectorGetInverse (Teuchos::RCP< const Vector > v, Magnitude tol=Teuchos::ScalarTraits< Scalar >::eps()*100, Scalar tolReplacement=Teuchos::ScalarTraits< Scalar >::zero())
 Return vector containing inverse of input vector. More...
 
static RCP< VectorGetMatrixOverlappedDiagonal (const Matrix &A)
 Extract Overlapped Matrix Diagonal. More...
 
static RCP< VectorGetMatrixOverlappedDeletedRowsum (const Matrix &A)
 Extract Overlapped Matrix Deleted Rowsum. More...
 
static RCP< Xpetra::Vector
< Magnitude, LocalOrdinal,
GlobalOrdinal, Node > > 
GetMatrixOverlappedAbsDeletedRowsum (const Matrix &A)
 
static Teuchos::Array< MagnitudeResidualNorm (const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Op, const MultiVector &X, const MultiVector &RHS)
 
static Teuchos::Array< MagnitudeResidualNorm (const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Op, const MultiVector &X, const MultiVector &RHS, MultiVector &Resid)
 
static RCP< MultiVectorResidual (const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Op, const MultiVector &X, const MultiVector &RHS)
 
static void Residual (const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Op, const MultiVector &X, const MultiVector &RHS, MultiVector &Resid)
 
static void PauseForDebugger ()
 
static Scalar PowerMethod (const Matrix &A, bool scaleByDiag=true, LocalOrdinal niters=10, Magnitude tolerance=1e-2, bool verbose=false, unsigned int seed=123)
 Simple transpose for Tpetra::CrsMatrix types. More...
 
static RCP< Teuchos::FancyOStreamMakeFancy (std::ostream &os)
 
static Teuchos::ScalarTraits
< Scalar >::magnitudeType 
Distance2 (const Teuchos::Array< Teuchos::ArrayRCP< const Scalar >> &v, LocalOrdinal i0, LocalOrdinal i1)
 Squared distance between two rows in a multivector. More...
 
static Teuchos::ArrayRCP
< const bool > 
DetectDirichletRows (const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Magnitude &tol=Teuchos::ScalarTraits< Scalar >::zero(), bool count_twos_as_dirichlet=false)
 Detect Dirichlet rows. More...
 
static Teuchos::ArrayRCP
< const bool > 
DetectDirichletRowsExt (const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, bool &bHasZeroDiagonal, const Magnitude &tol=Teuchos::ScalarTraits< Scalar >::zero())
 Detect Dirichlet rows (extended version) More...
 
static Teuchos::ArrayRCP
< const bool > 
DetectDirichletCols (const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayRCP< const bool > &dirichletRows)
 Detect Dirichlet columns based on Dirichlet rows. More...
 
static Scalar Frobenius (const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B)
 Frobenius inner product of two matrices. More...
 
static void SetRandomSeed (const Teuchos::Comm< int > &comm)
 Set seed for random number generator. More...
 
static void FindDirichletRows (Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, std::vector< LocalOrdinal > &dirichletRows, bool count_twos_as_dirichlet=false)
 
static void ApplyOAZToMatrixRows (Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, const std::vector< LocalOrdinal > &dirichletRows)
 
static void ApplyOAZToMatrixRows (Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, const Teuchos::ArrayRCP< const bool > &dirichletRows)
 
static void ZeroDirichletRows (Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, const std::vector< LocalOrdinal > &dirichletRows, Scalar replaceWith=Teuchos::ScalarTraits< Scalar >::zero())
 
static void ZeroDirichletRows (Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, const Teuchos::ArrayRCP< const bool > &dirichletRows, Scalar replaceWith=Teuchos::ScalarTraits< Scalar >::zero())
 
static void ZeroDirichletRows (Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &X, const Teuchos::ArrayRCP< const bool > &dirichletRows, Scalar replaceWith=Teuchos::ScalarTraits< Scalar >::zero())
 
static void ZeroDirichletCols (Teuchos::RCP< Matrix > &A, const Teuchos::ArrayRCP< const bool > &dirichletCols, Scalar replaceWith=Teuchos::ScalarTraits< Scalar >::zero())
 
static void FindDirichletRowsAndPropagateToCols (Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, Teuchos::RCP< Xpetra::Vector< int, LocalOrdinal, GlobalOrdinal, Node > > &isDirichletRow, Teuchos::RCP< Xpetra::Vector< int, LocalOrdinal, GlobalOrdinal, Node > > &isDirichletCol)
 
static RCP< const
Xpetra::BlockedMap
< LocalOrdinal, GlobalOrdinal,
Node > > 
GeneratedBlockedTargetMap (const Xpetra::BlockedMap< LocalOrdinal, GlobalOrdinal, Node > &sourceBlockedMap, const Xpetra::Import< LocalOrdinal, GlobalOrdinal, Node > &Importer)
 

Private Types

typedef Xpetra::CrsMatrixWrap
< Scalar, LocalOrdinal,
GlobalOrdinal, Node
CrsMatrixWrap
 
typedef Xpetra::CrsMatrix
< Scalar, LocalOrdinal,
GlobalOrdinal, Node
CrsMatrix
 
typedef Xpetra::Matrix< Scalar,
LocalOrdinal, GlobalOrdinal,
Node
Matrix
 
typedef Xpetra::Vector< Scalar,
LocalOrdinal, GlobalOrdinal,
Node
Vector
 
typedef Xpetra::BlockedVector
< Scalar, LocalOrdinal,
GlobalOrdinal, Node
BlockedVector
 
typedef Xpetra::MultiVector
< Scalar, LocalOrdinal,
GlobalOrdinal, Node
MultiVector
 
typedef
Xpetra::BlockedMultiVector
< Scalar, LocalOrdinal,
GlobalOrdinal, Node
BlockedMultiVector
 
typedef Xpetra::BlockedMap
< LocalOrdinal, GlobalOrdinal,
Node
BlockedMap
 
typedef Xpetra::Map
< LocalOrdinal, GlobalOrdinal,
Node
Map
 

Detailed Description

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
class MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >

Definition at line 54 of file MueLu_UtilitiesBase_fwd.hpp.

Member Typedef Documentation

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::CrsMatrixWrap<Scalar,LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::CrsMatrixWrap
private

Definition at line 113 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::CrsMatrix
private

Definition at line 114 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::Matrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Matrix
private

Definition at line 115 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Vector
private

Definition at line 116 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::BlockedVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::BlockedVector
private

Definition at line 117 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::MultiVector
private

Definition at line 118 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::BlockedMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::BlockedMultiVector
private

Definition at line 119 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::BlockedMap<LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::BlockedMap
private

Definition at line 120 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Map
private

Definition at line 121 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Magnitude

Definition at line 123 of file MueLu_UtilitiesBase_decl.hpp.

Member Function Documentation

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static RCP<Matrix> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Crs2Op ( RCP< CrsMatrix Op)
inlinestatic

Definition at line 126 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::ArrayRCP<Scalar> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetMatrixDiagonal ( const Matrix A)
inlinestatic

Extract Matrix Diagonal.

Returns Matrix diagonal in ArrayRCP.

NOTE – it's assumed that A has been fillComplete'd.

Definition at line 138 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static RCP<Vector> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetMatrixDiagonalInverse ( const Matrix A,
Magnitude  tol = Teuchos::ScalarTraits<Scalar>::eps()*100 
)
inlinestatic

Extract Matrix Diagonal.

Returns inverse of the Matrix diagonal in ArrayRCP.

NOTE – it's assumed that A has been fillComplete'd.

Definition at line 166 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::ArrayRCP<Scalar> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetLumpedMatrixDiagonal ( const Matrix A)
inlinestatic

Extract Matrix Diagonal of lumped matrix.

Returns Matrix diagonal of lumped matrix in ArrayRCP.

NOTE – it's assumed that A has been fillComplete'd.

Definition at line 189 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::RCP<Vector> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetLumpedMatrixDiagonal ( Teuchos::RCP< const Matrix rcpA)
inlinestatic

Extract Matrix Diagonal of lumped matrix.

Returns Matrix diagonal of lumped matrix in ArrayRCP.

NOTE – it's assumed that A has been fillComplete'd.

Definition at line 211 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::RCP<Vector> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetInverse ( Teuchos::RCP< const Vector v,
Magnitude  tol = Teuchos::ScalarTraits<Scalar>::eps()*100,
Scalar  tolReplacement = Teuchos::ScalarTraits<Scalar>::zero() 
)
inlinestatic

Return vector containing inverse of input vector.

Parameters
[in]v,:input vector
[in]tol,:tolerance. If entries of input vector are smaller than tolerance they are replaced by tolReplacement (see below). The default value for tol is 100*eps (machine precision)
[in]tolReplacement,:Value put in for undefined entries in output vector (default: 0.0) : vector containing inverse values of input vector v

Definition at line 263 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static RCP<Vector> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetMatrixOverlappedDiagonal ( const Matrix A)
inlinestatic

Extract Overlapped Matrix Diagonal.

Returns overlapped Matrix diagonal in ArrayRCP.

The local overlapped diagonal has an entry for each index in A's column map. NOTE – it's assumed that A has been fillComplete'd.

Definition at line 301 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static RCP<Vector> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetMatrixOverlappedDeletedRowsum ( const Matrix A)
inlinestatic

Extract Overlapped Matrix Deleted Rowsum.

Returns overlapped Matrix deleted Rowsum in ArrayRCP.

The local overlapped deleted Rowsum has an entry for each index in A's column map. NOTE – it's assumed that A has been fillComplete'd.

Definition at line 344 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static RCP<Xpetra::Vector<Magnitude,LocalOrdinal,GlobalOrdinal,Node> > MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetMatrixOverlappedAbsDeletedRowsum ( const Matrix A)
inlinestatic

Definition at line 387 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::Array<Magnitude> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ResidualNorm ( const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Op,
const MultiVector X,
const MultiVector RHS 
)
inlinestatic

Definition at line 436 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::Array<Magnitude> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ResidualNorm ( const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Op,
const MultiVector X,
const MultiVector RHS,
MultiVector Resid 
)
inlinestatic

Definition at line 445 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static RCP<MultiVector> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Residual ( const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Op,
const MultiVector X,
const MultiVector RHS 
)
inlinestatic

Definition at line 454 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Residual ( const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Op,
const MultiVector X,
const MultiVector RHS,
MultiVector Resid 
)
inlinestatic

Definition at line 464 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::PauseForDebugger ( )
inlinestatic

Definition at line 472 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Scalar MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::PowerMethod ( const Matrix A,
bool  scaleByDiag = true,
LocalOrdinal  niters = 10,
Magnitude  tolerance = 1e-2,
bool  verbose = false,
unsigned int  seed = 123 
)
inlinestatic

Simple transpose for Tpetra::CrsMatrix types.

Note: This is very inefficient, as it inserts one entry at a time.

Power method.

Parameters
Amatrix
scaleByDiagif true, estimate the largest eigenvalue of \( D^; A \).
nitersmaximum number of iterations
tolerancestopping tolerance if true, print iteration information

(Shamelessly grabbed from tpetra/examples.)

Definition at line 514 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static RCP<Teuchos::FancyOStream> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::MakeFancy ( std::ostream &  os)
inlinestatic

Definition at line 572 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::ScalarTraits<Scalar>::magnitudeType MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Distance2 ( const Teuchos::Array< Teuchos::ArrayRCP< const Scalar >> &  v,
LocalOrdinal  i0,
LocalOrdinal  i1 
)
inlinestatic

Squared distance between two rows in a multivector.

Used for coordinate vectors.

Definition at line 581 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::ArrayRCP<const bool> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::DetectDirichletRows ( const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  A,
const Magnitude tol = Teuchos::ScalarTraits<Scalar>::zero(),
bool  count_twos_as_dirichlet = false 
)
inlinestatic

Detect Dirichlet rows.

The routine assumes, that if there is only one nonzero per row, it is on the diagonal and therefore a DBC. This is safe for most of our applications, but one should be aware of that.

There is an alternative routine (see DetectDirichletRowsExt)

Parameters
[in]Amatrix
[in]tolIf a row entry's magnitude is less than or equal to this tolerance, the entry is treated as zero.
Returns
boolean array. The ith entry is true iff row i is a Dirichlet row.

Definition at line 603 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::ArrayRCP<const bool> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::DetectDirichletRowsExt ( const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  A,
bool &  bHasZeroDiagonal,
const Magnitude tol = Teuchos::ScalarTraits<Scalar>::zero() 
)
inlinestatic

Detect Dirichlet rows (extended version)

Look at each matrix row and mark it as Dirichlet if there is only one "not small" nonzero on the diagonal. In determining whether a nonzero is "not small" use abs(A(i,j)) / sqrt(abs(diag[i]*diag[j])) > tol

Parameters
[in]Amatrix
in/out]bHasZeroDiagonal Reference to boolean variable. Returns true if there is a zero on the diagonal in the local part of the Matrix. Otherwise it is false. Different processors might return a different value. There is no global reduction!
[in]tolIf a row entry's magnitude is less than or equal to this tolerance, the entry is treated as zero.
Returns
boolean array. The ith entry is true iff row i is a Dirichlet row.

Definition at line 655 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Teuchos::ArrayRCP<const bool> MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::DetectDirichletCols ( const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  A,
const Teuchos::ArrayRCP< const bool > &  dirichletRows 
)
inlinestatic

Detect Dirichlet columns based on Dirichlet rows.

The routine finds all column indices that are in Dirichlet rows, where Dirichlet rows are described by dirichletRows, as returned by DetectDirichletRows.

Parameters
[in]Amatrix
[in]dirichletRowsarray of Dirichlet rows.
Returns
boolean array. The ith entry is true iff row i is a Dirichlet column.

Definition at line 697 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static Scalar MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Frobenius ( const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  A,
const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  B 
)
inlinestatic

Frobenius inner product of two matrices.

Used in energy minimization algorithms

Definition at line 737 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::SetRandomSeed ( const Teuchos::Comm< int > &  comm)
inlinestatic

Set seed for random number generator.

Distribute the seeds evenly in [1,INT_MAX-1]. This guarantees nothing about where random number streams on difference processes will intersect. This does avoid overflow situations in parallel when multiplying by a PID. It also avoids the pathological case of having the same random number stream on each process.

Definition at line 804 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::FindDirichletRows ( Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  A,
std::vector< LocalOrdinal > &  dirichletRows,
bool  count_twos_as_dirichlet = false 
)
inlinestatic

Definition at line 831 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ApplyOAZToMatrixRows ( Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  A,
const std::vector< LocalOrdinal > &  dirichletRows 
)
inlinestatic

Definition at line 853 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ApplyOAZToMatrixRows ( Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  A,
const Teuchos::ArrayRCP< const bool > &  dirichletRows 
)
inlinestatic

Definition at line 879 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ZeroDirichletRows ( Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  A,
const std::vector< LocalOrdinal > &  dirichletRows,
Scalar  replaceWith = Teuchos::ScalarTraits<Scalar>::zero() 
)
inlinestatic

Definition at line 913 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ZeroDirichletRows ( Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  A,
const Teuchos::ArrayRCP< const bool > &  dirichletRows,
Scalar  replaceWith = Teuchos::ScalarTraits<Scalar>::zero() 
)
inlinestatic

Definition at line 929 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ZeroDirichletRows ( Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  X,
const Teuchos::ArrayRCP< const bool > &  dirichletRows,
Scalar  replaceWith = Teuchos::ScalarTraits<Scalar>::zero() 
)
inlinestatic

Definition at line 948 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ZeroDirichletCols ( Teuchos::RCP< Matrix > &  A,
const Teuchos::ArrayRCP< const bool > &  dirichletCols,
Scalar  replaceWith = Teuchos::ScalarTraits<Scalar>::zero() 
)
inlinestatic

Definition at line 962 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static void MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::FindDirichletRowsAndPropagateToCols ( Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  A,
Teuchos::RCP< Xpetra::Vector< int, LocalOrdinal, GlobalOrdinal, Node > > &  isDirichletRow,
Teuchos::RCP< Xpetra::Vector< int, LocalOrdinal, GlobalOrdinal, Node > > &  isDirichletCol 
)
inlinestatic

Definition at line 979 of file MueLu_UtilitiesBase_decl.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
static RCP<const Xpetra::BlockedMap<LocalOrdinal,GlobalOrdinal,Node> > MueLu::UtilitiesBase< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GeneratedBlockedTargetMap ( const Xpetra::BlockedMap< LocalOrdinal, GlobalOrdinal, Node > &  sourceBlockedMap,
const Xpetra::Import< LocalOrdinal, GlobalOrdinal, Node > &  Importer 
)
inlinestatic

Definition at line 1022 of file MueLu_UtilitiesBase_decl.hpp.


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