Teko Version of the Day
Enumerations | Functions
Teko_Utilities.hpp File Reference
#include "Epetra_CrsMatrix.h"
#include "Teuchos_VerboseObject.hpp"
#include "Thyra_LinearOpBase.hpp"
#include "Thyra_PhysicallyBlockedLinearOpBase.hpp"
#include "Thyra_ProductVectorSpaceBase.hpp"
#include "Thyra_VectorSpaceBase.hpp"
#include "Thyra_ProductMultiVectorBase.hpp"
#include "Thyra_MultiVectorStdOps.hpp"
#include "Thyra_MultiVectorBase.hpp"
#include "Thyra_VectorBase.hpp"
#include "Thyra_VectorStdOps.hpp"
#include "Thyra_DefaultBlockedLinearOp.hpp"
#include "Thyra_DefaultMultipliedLinearOp.hpp"
#include "Thyra_DefaultScaledAdjointLinearOp.hpp"
#include "Thyra_DefaultAddedLinearOp.hpp"
#include "Thyra_DefaultIdentityLinearOp.hpp"
#include "Thyra_DefaultZeroLinearOp.hpp"

Go to the source code of this file.

Enumerations

enum  DiagonalType {
  Teko::Diagonal, Teko::Lumped, Teko::AbsRowSum, Teko::BlkDiag,
  Teko::NotDiag
}
 Type describing the type of diagonal to construct. More...

Functions

RCP< Epetra_CrsMatrix > Teko::buildGraphLaplacian (int dim, double *coords, const Epetra_CrsMatrix &stencil)
 Build a graph Laplacian stenciled on a Epetra_CrsMatrix.
RCP< Epetra_CrsMatrix > Teko::buildGraphLaplacian (double *x, double *y, double *z, int stride, const Epetra_CrsMatrix &stencil)
 Build a graph Laplacian stenciled on a Epetra_CrsMatrix.
const Teuchos::RCP
< Teuchos::FancyOStream > 
Teko::getOutputStream ()
 Function used internally by Teko to find the output stream.
double Teko::computeSpectralRad (const Teuchos::RCP< const Thyra::LinearOpBase< double > > &A, double tol, bool isHermitian=false, int numBlocks=5, int restart=0, int verbosity=0)
 Compute the spectral radius of a matrix.
double Teko::computeSmallestMagEig (const Teuchos::RCP< const Thyra::LinearOpBase< double > > &A, double tol, bool isHermitian=false, int numBlocks=5, int restart=0, int verbosity=0)
 Compute the smallest eigenvalue of an operator.
ModifiableLinearOp Teko::getDiagonalOp (const Teko::LinearOp &A, const DiagonalType &dt)
ModifiableLinearOp Teko::getInvDiagonalOp (const Teko::LinearOp &A, const Teko::DiagonalType &dt)
const MultiVector Teko::getDiagonal (const LinearOp &op, const DiagonalType &dt)
 Get the diagonal of a sparse linear operator.
std::string Teko::getDiagonalName (const DiagonalType &dt)
DiagonalType Teko::getDiagonalType (std::string name)
double Teko::norm_1 (const MultiVector &v, std::size_t col)
double Teko::norm_2 (const MultiVector &v, std::size_t col)
Mathematical functions
void Teko::applyOp (const LinearOp &A, const MultiVector &x, MultiVector &y, double alpha, double beta)
 Apply a linear operator to a multivector (think of this as a matrix vector multiply).
void Teko::applyOp (const LinearOp &A, const BlockedMultiVector &x, BlockedMultiVector &y, double alpha=1.0, double beta=0.0)
 Apply a linear operator to a blocked multivector (think of this as a matrix vector multiply).
void Teko::update (double alpha, const MultiVector &x, double beta, MultiVector &y)
 Update the y vector so that $y = \alpha x+\beta y$.
void Teko::update (double alpha, const BlockedMultiVector &x, double beta, BlockedMultiVector &y)
 Update for a BlockedMultiVector.
void Teko::scale (const double alpha, MultiVector &x)
 Scale a multivector by a constant.
void Teko::scale (const double alpha, BlockedMultiVector &x)
 Scale a multivector by a constant.
LinearOp Teko::scale (const double alpha, ModifiableLinearOp &a)
 Scale a modifiable linear op by a constant.
LinearOp Teko::adjoint (ModifiableLinearOp &a)
 Construct an implicit adjoint of the linear operators.
Epetra_Operator specific functions
const ModifiableLinearOp Teko::getDiagonalOp (const LinearOp &op)
 Get the diaonal of a linear operator.
const MultiVector Teko::getDiagonal (const LinearOp &op)
 Get the diagonal of a linear operator.
const ModifiableLinearOp Teko::getInvDiagonalOp (const LinearOp &op)
 Get the diaonal of a linear operator.
const LinearOp Teko::explicitMultiply (const LinearOp &opl, const LinearOp &opm, const LinearOp &opr)
 Multiply three linear operators.
const ModifiableLinearOp Teko::explicitMultiply (const LinearOp &opl, const LinearOp &opm, const LinearOp &opr, const ModifiableLinearOp &destOp)
 Multiply three linear operators.
const LinearOp Teko::explicitMultiply (const LinearOp &opl, const LinearOp &opr)
 Multiply two linear operators.
const ModifiableLinearOp Teko::explicitMultiply (const LinearOp &opl, const LinearOp &opr, const ModifiableLinearOp &destOp)
 Multiply two linear operators.
const LinearOp Teko::explicitAdd (const LinearOp &opl, const LinearOp &opr)
 Add two linear operators.
const ModifiableLinearOp Teko::explicitAdd (const LinearOp &opl, const LinearOp &opr, const ModifiableLinearOp &destOp)
 Add two linear operators.
const ModifiableLinearOp Teko::explicitSum (const LinearOp &op, const ModifiableLinearOp &destOp)
 Sum an operator.
const LinearOp Teko::explicitTranspose (const LinearOp &op)
const LinearOp Teko::buildDiagonal (const MultiVector &v, const std::string &lbl="ANYM")
 Take the first column of a multivector and build a diagonal linear operator.
const LinearOp Teko::buildInvDiagonal (const MultiVector &v, const std::string &lbl="ANYM")
 Using the first column of a multivector, take the elementwise build a inverse and build the inverse diagonal operator.

MultiVector utilities

typedef Teuchos::RCP
< Thyra::ProductMultiVectorBase
< double > > 
Teko::BlockedMultiVector
typedef Teuchos::RCP
< Thyra::MultiVectorBase
< double > > 
Teko::MultiVector
MultiVector Teko::toMultiVector (BlockedMultiVector &bmv)
 Convert to a MultiVector from a BlockedMultiVector.
const MultiVector Teko::toMultiVector (const BlockedMultiVector &bmv)
 Convert to a MultiVector from a BlockedMultiVector.
const BlockedMultiVector Teko::toBlockedMultiVector (const MultiVector &bmv)
 Convert to a BlockedMultiVector from a MultiVector.
int Teko::blockCount (const BlockedMultiVector &bmv)
 Get the column count in a block linear operator.
MultiVector Teko::getBlock (int i, const BlockedMultiVector &bmv)
 Get the ith block from a BlockedMultiVector object.
MultiVector Teko::deepcopy (const MultiVector &v)
 Perform a deep copy of the vector.
MultiVector Teko::copyAndInit (const MultiVector &v, double scalar)
 Perform a deep copy of the vector.
BlockedMultiVector Teko::deepcopy (const BlockedMultiVector &v)
 Perform a deep copy of the blocked vector.
MultiVector Teko::datacopy (const MultiVector &src, MultiVector &dst)
 Copy the contents of a multivector to a destination vector.
BlockedMultiVector Teko::datacopy (const BlockedMultiVector &src, BlockedMultiVector &dst)
 Copy the contents of a blocked multivector to a destination vector.
BlockedMultiVector Teko::buildBlockedMultiVector (const std::vector< MultiVector > &mvv)
 build a BlockedMultiVector from a vector of MultiVectors
Teuchos::RCP
< Thyra::VectorBase< double > > 
Teko::indicatorVector (const std::vector< int > &indices, const VectorSpace &vs, double onValue, double offValue)

LinearOp utilities

typedef Teuchos::RCP
< Thyra::PhysicallyBlockedLinearOpBase
< double > > 
Teko::BlockedLinearOp
typedef Teuchos::RCP< const
Thyra::LinearOpBase< double > > 
Teko::LinearOp
typedef Teuchos::RCP
< Thyra::LinearOpBase< double > > 
Teko::InverseLinearOp
typedef Teuchos::RCP
< Thyra::LinearOpBase< double > > 
Teko::ModifiableLinearOp
LinearOp Teko::zero (const VectorSpace &vs)
 Build a square zero operator from a single vector space.
void Teko::putScalar (const ModifiableLinearOp &op, double scalar)
 Replace nonzeros with a scalar value, used to zero out an operator.
VectorSpace Teko::rangeSpace (const LinearOp &lo)
 Get the range space of a linear operator.
VectorSpace Teko::domainSpace (const LinearOp &lo)
 Get the domain space of a linear operator.
BlockedLinearOp Teko::toBlockedLinearOp (LinearOp &clo)
 Converts a LinearOp to a BlockedLinearOp.
const BlockedLinearOp Teko::toBlockedLinearOp (const LinearOp &clo)
 Converts a LinearOp to a BlockedLinearOp.
LinearOp Teko::toLinearOp (BlockedLinearOp &blo)
 Convert to a LinearOp from a BlockedLinearOp.
const LinearOp Teko::toLinearOp (const BlockedLinearOp &blo)
 Convert to a LinearOp from a BlockedLinearOp.
LinearOp Teko::toLinearOp (ModifiableLinearOp &blo)
 Convert to a LinearOp from a BlockedLinearOp.
const LinearOp Teko::toLinearOp (const ModifiableLinearOp &blo)
 Convert to a LinearOp from a BlockedLinearOp.
int Teko::blockRowCount (const BlockedLinearOp &blo)
 Get the row count in a block linear operator.
int Teko::blockColCount (const BlockedLinearOp &blo)
 Get the column count in a block linear operator.
LinearOp Teko::getBlock (int i, int j, const BlockedLinearOp &blo)
 Get the i,j block in a BlockedLinearOp object.
void Teko::setBlock (int i, int j, BlockedLinearOp &blo, const LinearOp &lo)
 Set the i,j block in a BlockedLinearOp object.
BlockedLinearOp Teko::createBlockedOp ()
 Build a new blocked linear operator.
void Teko::beginBlockFill (BlockedLinearOp &blo, int rowCnt, int colCnt)
 Let the blocked operator know that you are going to set the sub blocks.
void Teko::beginBlockFill (BlockedLinearOp &blo)
 Let the blocked operator know that you are going to set the sub blocks.
void Teko::endBlockFill (BlockedLinearOp &blo)
 Notify the blocked operator that the fill stage is completed.
BlockedLinearOp Teko::getUpperTriBlocks (const BlockedLinearOp &blo, bool callEndBlockFill)
 Get the strictly upper triangular portion of the matrix.
BlockedLinearOp Teko::getLowerTriBlocks (const BlockedLinearOp &blo, bool callEndBlockFill)
 Get the strictly lower triangular portion of the matrix.
BlockedLinearOp Teko::zeroBlockedOp (const BlockedLinearOp &blo)
 Build a zero operator mimicing the block structure of the passed in matrix.
bool Teko::isZeroOp (const LinearOp op)
 Figure out if this operator is the zero operator (or null!)
ModifiableLinearOp Teko::getAbsRowSumMatrix (const LinearOp &op)
 Compute absolute row sum matrix.
ModifiableLinearOp Teko::getAbsRowSumInvMatrix (const LinearOp &op)
 Compute inverse of the absolute row sum matrix.
ModifiableLinearOp Teko::getLumpedMatrix (const LinearOp &op)
 Compute the lumped version of this matrix.
ModifiableLinearOp Teko::getInvLumpedMatrix (const LinearOp &op)
 Compute the inverse of the lumped version of this matrix.

Detailed Description

This file contains a number of useful functions and classes used in Teko. They are distinct from the core functionality of the preconditioner factory, however, the functions are critical to construction of the preconditioners themselves.

Definition in file Teko_Utilities.hpp.

 All Classes Files Functions Variables