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

Xpetra utility class for common matrix-related routines. More...

#include <Xpetra_MatrixUtils_fwd.hpp>

Static Public Member Functions

static Teuchos::RCP
< Xpetra::MultiVector< Scalar,
LocalOrdinal, GlobalOrdinal,
Node > > 
xpetraGidNumbering2ThyraGidNumbering (const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &input)
 
static Teuchos::RCP
< Xpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > 
findColumnSubMap (const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &input, const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &domainMap)
 
static Teuchos::RCP
< Xpetra::BlockedCrsMatrix
< Scalar, LocalOrdinal,
GlobalOrdinal, Node > > 
SplitMatrix (const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &input, Teuchos::RCP< const Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node >> rangeMapExtractor, Teuchos::RCP< const Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node >> domainMapExtractor, Teuchos::RCP< const Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node >> columnMapExtractor=Teuchos::null, bool bThyraMode=false)
 
static void CheckRepairMainDiagonal (RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >> &Ac, bool const &repairZeroDiagonals, Teuchos::FancyOStream &fos, const typename Teuchos::ScalarTraits< Scalar >::magnitudeType threshold=Teuchos::ScalarTraits< typename Teuchos::ScalarTraits< Scalar >::magnitudeType >::zero(), const Scalar replacementValue=Teuchos::ScalarTraits< Scalar >::one())
 
static void RelativeDiagonalBoost (RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >> &A, const Teuchos::ArrayView< const double > &relativeThreshold, Teuchos::FancyOStream &fos)
 
static void extractBlockDiagonal (const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diagonal)
 
static void inverseScaleBlockDiagonal (Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &blockDiagonal, bool doTranspose, Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &toBeScaled)
 
static void checkLocalRowMapMatchesColMap (const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
 
static void convertMatrixToStridedMaps (Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >> matrix, std::vector< size_t > &rangeStridingInfo, std::vector< size_t > &domainStridingInfo)
 

Detailed Description

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
class Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >

Xpetra utility class for common matrix-related routines.

The routines should be independent from Epetra/Tpetra and be purely implemented in Xpetra. Other matrix-related routines are out-sourced into other helper classes (e.g. MatrixMatrix for MM multiplication and addition).

Definition at line 15 of file Xpetra_MatrixUtils_fwd.hpp.

Member Function Documentation

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::xpetraGidNumbering2ThyraGidNumbering ( const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  input)
static

Definition at line 38 of file Xpetra_MatrixUtils_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::findColumnSubMap ( const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  input,
const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &  domainMap 
)
static

Definition at line 53 of file Xpetra_MatrixUtils_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
Teuchos::RCP< Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::SplitMatrix ( const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  input,
Teuchos::RCP< const Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node >>  rangeMapExtractor,
Teuchos::RCP< const Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node >>  domainMapExtractor,
Teuchos::RCP< const Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node >>  columnMapExtractor = Teuchos::null,
bool  bThyraMode = false 
)
static

Given a matrix A split it into a nxm blocked matrix using the map extractors.

Parameters
inputInput matrix, must already have had 'FillComplete()' called.
rangeMapExtractorMapExtractor object describing the splitting of rows of the output block matrix
domainMapExtractorMapExtractor object describing the splitting of columns of the output block matrix
columnMapExtractor(not fully clear whether we need that. is always Teuchos::null)
bThyraModeIf true, build a n x n blocked operator using Thyra GIDs
Returns
Fill-completed block version of intput matrix

Definition at line 133 of file Xpetra_MatrixUtils_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::CheckRepairMainDiagonal ( RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >> &  Ac,
bool const &  repairZeroDiagonals,
Teuchos::FancyOStream &  fos,
const typename Teuchos::ScalarTraits< Scalar >::magnitudeType  threshold = Teuchos::ScalarTraits<typename Teuchos::ScalarTraits<Scalar>::magnitudeType>::zero(),
const Scalar  replacementValue = Teuchos::ScalarTraits<Scalar>::one() 
)
static

Given a matrix A, detect too small diagonals and replace any found with ones.

Definition at line 374 of file Xpetra_MatrixUtils_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::RelativeDiagonalBoost ( RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >> &  A,
const Teuchos::ArrayView< const double > &  relativeThreshold,
Teuchos::FancyOStream &  fos 
)
static

Given a matrix A, boost the diagonal to a relative floor. Multiple PDEs will be scaled differently. Each PDE can be given its own relative threshold, or a single threshold can be used for all PDEs NOTE: This is not Kokkos-ized Precondition: A->GetFixedBlockSize() == relativeThreshold.size() OR relativeThreshold.size() == 1

Definition at line 574 of file Xpetra_MatrixUtils_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::extractBlockDiagonal ( const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  A,
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  diagonal 
)
static

Definition at line 629 of file Xpetra_MatrixUtils_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::inverseScaleBlockDiagonal ( Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  blockDiagonal,
bool  doTranspose,
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  toBeScaled 
)
static

Definition at line 647 of file Xpetra_MatrixUtils_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::checkLocalRowMapMatchesColMap ( const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  A)
static

Definition at line 666 of file Xpetra_MatrixUtils_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void Xpetra::MatrixUtils< Scalar, LocalOrdinal, GlobalOrdinal, Node >::convertMatrixToStridedMaps ( Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >>  matrix,
std::vector< size_t > &  rangeStridingInfo,
std::vector< size_t > &  domainStridingInfo 
)
static

@brief Convert matrix to strided row and column maps

Parameters
matrixMatrix to be converted
rangeStridingInfoStriding information for row/range map
domainStridingInfoStriding information for column/domain map

Definition at line 692 of file Xpetra_MatrixUtils_def.hpp.


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