EpetraExt Package Browser (Single Doxygen Collection)  Development
Public Member Functions | Private Member Functions | Private Attributes | List of all members
EpetraExt_BlockDiagMatrix Class Reference

EpetraExt_BlockDiagMatrix: A class for storing distributed block matrices. More...

#include <EpetraExt_BlockDiagMatrix.h>

Inherits Epetra_Operator, Epetra_DistObject, and Epetra_BLAS.

Public Member Functions

 EpetraExt_BlockDiagMatrix (const Epetra_BlockMap &Map, bool zero_out=true)
 Constructor - This map is the map of the vector this can be applied to. More...
 
 EpetraExt_BlockDiagMatrix (const EpetraExt_BlockDiagMatrix &Source)
 Copy constructor. More...
 
virtual ~EpetraExt_BlockDiagMatrix ()
 Destructor. More...
 
EpetraExt_BlockDiagMatrixoperator= (const EpetraExt_BlockDiagMatrix &Source)
 = Operator. More...
 
double * operator[] (int index)
 Block access function. More...
 
const double * operator[] (int index) const
 Block access function. More...
 

Private Member Functions

void Allocate ()
 
int DoCopy (const EpetraExt_BlockDiagMatrix &Source)
 
int CheckSizes (const Epetra_SrcDistObject &Source)
 
int CopyAndPermute (const Epetra_SrcDistObject &Source, int NumSameIDs, int NumPermuteIDs, int *PermuteToLIDs, int *PermuteFromLIDs, const Epetra_OffsetIndex *Indexor, Epetra_CombineMode CombineMode=Zero)
 
int PackAndPrepare (const Epetra_SrcDistObject &Source, int NumExportIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &SizeOfPacket, int *Sizes, bool &VarSizes, Epetra_Distributor &Distor)
 
int UnpackAndCombine (const Epetra_SrcDistObject &Source, int NumImportIDs, int *ImportLIDs, int LenImports, char *Imports, int &SizeOfPacket, Epetra_Distributor &Distor, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor)
 

Private Attributes

Epetra_LAPACK LAPACK
 
Teuchos::ParameterList List_
 
bool HasComputed_
 Has Computed? Needed for Inverse/Factorization modes. More...
 
int ApplyMode_
 Which Apply Mode to use. More...
 
Epetra_BlockMap * DataMap_
 Map for the data. More...
 
double * Values_
 Actual Data values. More...
 
int * Pivots_
 Pivots for factorization. More...
 

Attribute set methods

virtual int SetUseTranspose (bool)
 SetUseTranspose - not implemented. More...
 
virtual int SetParameters (Teuchos::ParameterList &List)
 SetParameters. More...
 
virtual int Compute ()
 Computes the inverse / factorization if such is set on the list. More...
 

Attribute access functions

virtual const char * Label () const
 Returns a character std::string describing the operator. More...
 
virtual bool UseTranspose () const
 Returns the current UseTranspose setting. More...
 
virtual bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise. More...
 
virtual const Epetra_Comm & Comm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator. More...
 
virtual const Epetra_Map & OperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator. More...
 
virtual const Epetra_Map & OperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator. More...
 
virtual const Epetra_BlockMap & BlockMap () const
 Returns the Epetra_BlockMap object associated with the range of this operator. More...
 
double * Values () const
 Returns a pointer to the array containing the blocks. More...
 
int BlockSize (int LID) const
 Returns the size of the given block. More...
 
int DataSize (int LID) const
 Returns the size of the data in the given block. More...
 
bool ConstantBlockSize () const
 Returns true if the element size is constant. More...
 
int NumMyBlocks () const
 Returns the number of local blocks. More...
 
int NumGlobalBlocks () const
 Returns the number of global blocks. More...
 
long long NumGlobalBlocks64 () const
 
int NumMyUnknowns () const
 Returns the number of local unknowns. More...
 
int NumGlobalUnknowns () const
 Returns the number of global unknowns. More...
 
long long NumGlobalUnknowns64 () const
 
int NumData () const
 Returns the size of the total Data block. More...
 
int GetApplyMode ()
 Gets apply mode info. More...
 
virtual void Print (std::ostream &os) const
 Print method. More...
 

Mathematical functions

virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y. More...
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y. More...
 
virtual double NormInf () const
 NormInf - Not Implemented. More...
 
void PutScalar (double value)
 PutScalar function. More...
 
virtual const Epetra_BlockMap & DataMap () const
 Returns the Epetra_BlockMap object with the distribution of underlying values. More...
 

Detailed Description

EpetraExt_BlockDiagMatrix: A class for storing distributed block matrices.

A dense-block block-diagonal matrix with inversion/factorization capabilities.

This class has a rigid map structure — the Domain and Range maps must be the same.

Definition at line 66 of file EpetraExt_BlockDiagMatrix.h.

Constructor & Destructor Documentation

◆ EpetraExt_BlockDiagMatrix() [1/2]

EpetraExt_BlockDiagMatrix::EpetraExt_BlockDiagMatrix ( const Epetra_BlockMap &  Map,
bool  zero_out = true 
)

Constructor - This map is the map of the vector this can be applied to.

Definition at line 56 of file EpetraExt_BlockDiagMatrix.cpp.

◆ EpetraExt_BlockDiagMatrix() [2/2]

EpetraExt_BlockDiagMatrix::EpetraExt_BlockDiagMatrix ( const EpetraExt_BlockDiagMatrix Source)

Copy constructor.

Definition at line 80 of file EpetraExt_BlockDiagMatrix.cpp.

◆ ~EpetraExt_BlockDiagMatrix()

EpetraExt_BlockDiagMatrix::~EpetraExt_BlockDiagMatrix ( )
virtual

Destructor.

Definition at line 71 of file EpetraExt_BlockDiagMatrix.cpp.

Member Function Documentation

◆ operator=()

EpetraExt_BlockDiagMatrix & EpetraExt_BlockDiagMatrix::operator= ( const EpetraExt_BlockDiagMatrix Source)

= Operator.

Parameters
InA - EpetraExt_BlockDiagMatrix to copy.
Returns
EpetraExt_BlockDiagMatrix.

Definition at line 150 of file EpetraExt_BlockDiagMatrix.cpp.

◆ operator[]() [1/2]

double* EpetraExt_BlockDiagMatrix::operator[] ( int  index)
inline

Block access function.

Returns
the pointer V[Index].

Definition at line 92 of file EpetraExt_BlockDiagMatrix.h.

◆ operator[]() [2/2]

const double* EpetraExt_BlockDiagMatrix::operator[] ( int  index) const
inline

Block access function.

Returns
the pointer V[Index].

Definition at line 97 of file EpetraExt_BlockDiagMatrix.h.

◆ SetUseTranspose()

virtual int EpetraExt_BlockDiagMatrix::SetUseTranspose ( bool  )
inlinevirtual

SetUseTranspose - not implemented.

Definition at line 105 of file EpetraExt_BlockDiagMatrix.h.

◆ SetParameters()

int EpetraExt_BlockDiagMatrix::SetParameters ( Teuchos::ParameterList &  List)
virtual

SetParameters.

Definition at line 127 of file EpetraExt_BlockDiagMatrix.cpp.

◆ Compute()

int EpetraExt_BlockDiagMatrix::Compute ( )
virtual

Computes the inverse / factorization if such is set on the list.

Definition at line 175 of file EpetraExt_BlockDiagMatrix.cpp.

◆ Label()

virtual const char* EpetraExt_BlockDiagMatrix::Label ( ) const
inlinevirtual

Returns a character std::string describing the operator.

Definition at line 120 of file EpetraExt_BlockDiagMatrix.h.

◆ UseTranspose()

virtual bool EpetraExt_BlockDiagMatrix::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Definition at line 123 of file EpetraExt_BlockDiagMatrix.h.

◆ HasNormInf()

virtual bool EpetraExt_BlockDiagMatrix::HasNormInf ( ) const
inlinevirtual

Returns true if the this object can provide an approximate Inf-norm, false otherwise.

Definition at line 126 of file EpetraExt_BlockDiagMatrix.h.

◆ Comm()

virtual const Epetra_Comm& EpetraExt_BlockDiagMatrix::Comm ( ) const
inlinevirtual

Returns a pointer to the Epetra_Comm communicator associated with this operator.

Definition at line 129 of file EpetraExt_BlockDiagMatrix.h.

◆ OperatorDomainMap()

virtual const Epetra_Map& EpetraExt_BlockDiagMatrix::OperatorDomainMap ( ) const
inlinevirtual

Returns the Epetra_Map object associated with the domain of this operator.

Definition at line 132 of file EpetraExt_BlockDiagMatrix.h.

◆ OperatorRangeMap()

virtual const Epetra_Map& EpetraExt_BlockDiagMatrix::OperatorRangeMap ( ) const
inlinevirtual

Returns the Epetra_Map object associated with the range of this operator.

Definition at line 135 of file EpetraExt_BlockDiagMatrix.h.

◆ BlockMap()

virtual const Epetra_BlockMap& EpetraExt_BlockDiagMatrix::BlockMap ( ) const
inlinevirtual

Returns the Epetra_BlockMap object associated with the range of this operator.

Definition at line 138 of file EpetraExt_BlockDiagMatrix.h.

◆ Values()

double* EpetraExt_BlockDiagMatrix::Values ( ) const
inline

Returns a pointer to the array containing the blocks.

Definition at line 141 of file EpetraExt_BlockDiagMatrix.h.

◆ BlockSize()

int EpetraExt_BlockDiagMatrix::BlockSize ( int  LID) const
inline

Returns the size of the given block.

Definition at line 144 of file EpetraExt_BlockDiagMatrix.h.

◆ DataSize()

int EpetraExt_BlockDiagMatrix::DataSize ( int  LID) const
inline

Returns the size of the data in the given block.

Definition at line 147 of file EpetraExt_BlockDiagMatrix.h.

◆ ConstantBlockSize()

bool EpetraExt_BlockDiagMatrix::ConstantBlockSize ( ) const
inline

Returns true if the element size is constant.

Definition at line 150 of file EpetraExt_BlockDiagMatrix.h.

◆ NumMyBlocks()

int EpetraExt_BlockDiagMatrix::NumMyBlocks ( ) const
inline

Returns the number of local blocks.

Definition at line 153 of file EpetraExt_BlockDiagMatrix.h.

◆ NumGlobalBlocks()

int EpetraExt_BlockDiagMatrix::NumGlobalBlocks ( ) const
inline

Returns the number of global blocks.

Definition at line 157 of file EpetraExt_BlockDiagMatrix.h.

◆ NumGlobalBlocks64()

long long EpetraExt_BlockDiagMatrix::NumGlobalBlocks64 ( ) const
inline

Definition at line 159 of file EpetraExt_BlockDiagMatrix.h.

◆ NumMyUnknowns()

int EpetraExt_BlockDiagMatrix::NumMyUnknowns ( ) const
inline

Returns the number of local unknowns.

Definition at line 162 of file EpetraExt_BlockDiagMatrix.h.

◆ NumGlobalUnknowns()

int EpetraExt_BlockDiagMatrix::NumGlobalUnknowns ( ) const
inline

Returns the number of global unknowns.

Definition at line 166 of file EpetraExt_BlockDiagMatrix.h.

◆ NumGlobalUnknowns64()

long long EpetraExt_BlockDiagMatrix::NumGlobalUnknowns64 ( ) const
inline

Definition at line 168 of file EpetraExt_BlockDiagMatrix.h.

◆ NumData()

int EpetraExt_BlockDiagMatrix::NumData ( ) const
inline

Returns the size of the total Data block.

Definition at line 171 of file EpetraExt_BlockDiagMatrix.h.

◆ GetApplyMode()

int EpetraExt_BlockDiagMatrix::GetApplyMode ( )
inline

Gets apply mode info.

Definition at line 174 of file EpetraExt_BlockDiagMatrix.h.

◆ Print()

void EpetraExt_BlockDiagMatrix::Print ( std::ostream &  os) const
virtual

Print method.

Definition at line 307 of file EpetraExt_BlockDiagMatrix.cpp.

◆ Apply()

virtual int EpetraExt_BlockDiagMatrix::Apply ( const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const
inlinevirtual

Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.

Parameters
InX - A Epetra_MultiVector of dimension NumVectors to multiply with matrix.
OutY -A Epetra_MultiVector of dimension NumVectors containing result.
Returns
Integer error code, set to 0 if successful.

Definition at line 193 of file EpetraExt_BlockDiagMatrix.h.

◆ ApplyInverse()

int EpetraExt_BlockDiagMatrix::ApplyInverse ( const Epetra_MultiVector &  X,
Epetra_MultiVector &  Y 
) const
virtual

Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y.

Parameters
InX - A Epetra_MultiVector of dimension NumVectors to solve for.
OutY -A Epetra_MultiVector of dimension NumVectors containing result.
Returns
Integer error code, set to 0 if successful.
Warning
In order to work with AztecOO, any implementation of this method must support the case where X and Y are the same object.

Definition at line 231 of file EpetraExt_BlockDiagMatrix.cpp.

◆ NormInf()

virtual double EpetraExt_BlockDiagMatrix::NormInf ( ) const
inlinevirtual

NormInf - Not Implemented.

Definition at line 210 of file EpetraExt_BlockDiagMatrix.h.

◆ PutScalar()

void EpetraExt_BlockDiagMatrix::PutScalar ( double  value)

PutScalar function.

Definition at line 143 of file EpetraExt_BlockDiagMatrix.cpp.

◆ DataMap()

virtual const Epetra_BlockMap& EpetraExt_BlockDiagMatrix::DataMap ( ) const
inlinevirtual

Returns the Epetra_BlockMap object with the distribution of underlying values.

Definition at line 216 of file EpetraExt_BlockDiagMatrix.h.

◆ Allocate()

void EpetraExt_BlockDiagMatrix::Allocate ( )
private

Definition at line 95 of file EpetraExt_BlockDiagMatrix.cpp.

◆ DoCopy()

int EpetraExt_BlockDiagMatrix::DoCopy ( const EpetraExt_BlockDiagMatrix Source)
private

Definition at line 155 of file EpetraExt_BlockDiagMatrix.cpp.

◆ CheckSizes()

int EpetraExt_BlockDiagMatrix::CheckSizes ( const Epetra_SrcDistObject &  Source)
private

Definition at line 379 of file EpetraExt_BlockDiagMatrix.cpp.

◆ CopyAndPermute()

int EpetraExt_BlockDiagMatrix::CopyAndPermute ( const Epetra_SrcDistObject &  Source,
int  NumSameIDs,
int  NumPermuteIDs,
int *  PermuteToLIDs,
int *  PermuteFromLIDs,
const Epetra_OffsetIndex *  Indexor,
Epetra_CombineMode  CombineMode = Zero 
)
private

Definition at line 386 of file EpetraExt_BlockDiagMatrix.cpp.

◆ PackAndPrepare()

int EpetraExt_BlockDiagMatrix::PackAndPrepare ( const Epetra_SrcDistObject &  Source,
int  NumExportIDs,
int *  ExportLIDs,
int &  LenExports,
char *&  Exports,
int &  SizeOfPacket,
int *  Sizes,
bool &  VarSizes,
Epetra_Distributor &  Distor 
)
private

Definition at line 508 of file EpetraExt_BlockDiagMatrix.cpp.

◆ UnpackAndCombine()

int EpetraExt_BlockDiagMatrix::UnpackAndCombine ( const Epetra_SrcDistObject &  Source,
int  NumImportIDs,
int *  ImportLIDs,
int  LenImports,
char *  Imports,
int &  SizeOfPacket,
Epetra_Distributor &  Distor,
Epetra_CombineMode  CombineMode,
const Epetra_OffsetIndex *  Indexor 
)
private

Definition at line 580 of file EpetraExt_BlockDiagMatrix.cpp.

Member Data Documentation

◆ LAPACK

Epetra_LAPACK EpetraExt_BlockDiagMatrix::LAPACK
private

Definition at line 260 of file EpetraExt_BlockDiagMatrix.h.

◆ List_

Teuchos::ParameterList EpetraExt_BlockDiagMatrix::List_
private

Definition at line 261 of file EpetraExt_BlockDiagMatrix.h.

◆ HasComputed_

bool EpetraExt_BlockDiagMatrix::HasComputed_
private

Has Computed? Needed for Inverse/Factorization modes.

Definition at line 264 of file EpetraExt_BlockDiagMatrix.h.

◆ ApplyMode_

int EpetraExt_BlockDiagMatrix::ApplyMode_
private

Which Apply Mode to use.

Definition at line 267 of file EpetraExt_BlockDiagMatrix.h.

◆ DataMap_

Epetra_BlockMap* EpetraExt_BlockDiagMatrix::DataMap_
private

Map for the data.

Definition at line 270 of file EpetraExt_BlockDiagMatrix.h.

◆ Values_

double* EpetraExt_BlockDiagMatrix::Values_
private

Actual Data values.

Definition at line 273 of file EpetraExt_BlockDiagMatrix.h.

◆ Pivots_

int* EpetraExt_BlockDiagMatrix::Pivots_
private

Pivots for factorization.

Definition at line 276 of file EpetraExt_BlockDiagMatrix.h.


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