EpetraExt Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Private Member Functions | Private Attributes | List of all members
EpetraExt_PointToBlockDiagPermute Class Reference

EpetraExt_PointToBlockDiagPermute: A class for managing point-to-block-diagonal permutations. More...

#include <EpetraExt_PointToBlockDiagPermute.h>

Inheritance diagram for EpetraExt_PointToBlockDiagPermute:
Inheritance graph
[legend]

Private Member Functions

int ExtractBlockDiagonal ()
 Pulls the block diagonal of the matrix and then builds the BDMat_. More...
 
int SetupContiguousMode ()
 Setup/Cleanup for Contiguous Mode. More...
 
int CleanupContiguousMode ()
 
void UpdateImportVector (int NumVectors) const
 
void UpdateExportVector (int NumVectors) const
 
template<typename int_type >
Epetra_FECrsMatrixTCreateFECrsMatrix ()
 
template<typename int_type >
int TSetupContiguousMode ()
 
template<typename int_type >
int TExtractBlockDiagonal ()
 
template<typename int_type >
int TSetParameters (Teuchos::ParameterList &List)
 
template<typename int_type >
const int_type * Blockids_const_ptr () const
 
template<typename int_type >
int_type *& Blockids_ref ()
 
template<>
const int * Blockids_const_ptr () const
 
template<>
int *& Blockids_ref ()
 
template<>
const long long * Blockids_const_ptr () const
 
template<>
long long *& Blockids_ref ()
 

Private Attributes

Teuchos::ParameterList List_
 
const Epetra_CrsMatrixMatrix_
 
bool PurelyLocalMode_
 
bool ContiguousBlockMode_
 
int ContiguousBlockSize_
 
int NumBlocks_
 
int * Blockstart_
 
int * Blockids_int_
 
long long * Blockids_LL_
 
Epetra_BlockMapBDMap_
 
Epetra_MapCompatibleMap_
 
EpetraExt_BlockDiagMatrixBDMat_
 
Epetra_ImportImporter_
 
Epetra_ExportExporter_
 
Epetra_MultiVectorImportVector_
 
Epetra_MultiVectorExportVector_
 
 EpetraExt_PointToBlockDiagPermute (const Epetra_CrsMatrix &MAT)
 @ Name Constructors More...
 

Destructor

virtual ~EpetraExt_PointToBlockDiagPermute ()
 Destructor. More...
 

Attribute set methods

virtual int SetParameters (Teuchos::ParameterList &List)
 Sets the parameter list. More...
 
virtual int SetUseTranspose (bool)
 Set whether to use the transpose. More...
 
virtual int Compute ()
 Extracts the block-diagonal, builds maps, etc. 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
 Returns the infinity norm of the global matrix - NOT IMPLEMENTED. More...
 

Attribute access functions

virtual const char * Label () const
 Return a string describing the operator. More...
 
virtual bool UseTranspose () const
 Return the current UseTranspose setting. More...
 
virtual bool HasNormInf () const
 Return true if the this object can provide an approximate Inf-norm, false otherwise. More...
 
virtual const Epetra_CommComm () const
 Return a pointer to the Epetra_Comm communicator associated with this operator. More...
 
virtual const Epetra_MapOperatorDomainMap () const
 Return the Epetra_Map object associated with the domain of this operator. More...
 
virtual const Epetra_MapOperatorRangeMap () const
 Return the Epetra_Map object associated with the range of this operator. More...
 
virtual const
EpetraExt_BlockDiagMatrix
BlockMatrix ()
 Return the block matrix. Only call this after calling Compute. More...
 
virtual Epetra_FECrsMatrixCreateFECrsMatrix ()
 Create an Epetra_FECrsMatrix from the BlockDiagMatrix. More...
 

Miscellaneous

virtual void Print (std::ostream &os) const
 Print information about this object to the given output stream. More...
 

Import/Export Methods

int Import (const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
 Imports an Epetra_DistObject using the Epetra_Import object. More...
 
int Import (const Epetra_SrcDistObject &A, const Epetra_Export &Exporter, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
 Imports an Epetra_DistObject using the Epetra_Export object. More...
 
int Export (const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
 Exports an Epetra_DistObject using the Epetra_Import object. More...
 
int Export (const Epetra_SrcDistObject &A, const Epetra_Export &Exporter, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
 Exports an Epetra_DistObject using the Epetra_Export object. More...
 

Internal utilities

virtual int CheckSizes (const Epetra_SrcDistObject &Source)
 Allows the source and target (this) objects to be compared for compatibility, return nonzero if not. More...
 
virtual int CopyAndPermute (const Epetra_SrcDistObject &Source, int NumSameIDs, int NumPermuteIDs, int *PermuteToLIDs, int *PermuteFromLIDs, const Epetra_OffsetIndex *Indexor, Epetra_CombineMode CombineMode=Zero)
 Perform ID copies and permutations that are on processor. More...
 
virtual int PackAndPrepare (const Epetra_SrcDistObject &Source, int NumExportIDs, int *ExportLIDs, int &LenExports, char *&Exports, int &SizeOfPacket, int *Sizes, bool &VarSizes, Epetra_Distributor &Distor)
 Perform any packing or preparation required for call to DoTransfer(). More...
 
virtual 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)
 Perform any unpacking and combining after call to DoTransfer(). More...
 

Additional Inherited Members

- Public Member Functions inherited from Epetra_SrcDistObject
virtual const Epetra_BlockMapMap () const =0
 

Detailed Description

EpetraExt_PointToBlockDiagPermute: A class for managing point-to-block-diagonal permutations.

Manages point-to-block-diagonal permutations (and vice versa) as well as service routines for extracting block diagonals from matrices.

Definition at line 78 of file EpetraExt_PointToBlockDiagPermute.h.

Constructor & Destructor Documentation

EpetraExt_PointToBlockDiagPermute::EpetraExt_PointToBlockDiagPermute ( const Epetra_CrsMatrix MAT)

@ Name Constructors

Constructor

Definition at line 58 of file EpetraExt_PointToBlockDiagPermute.cpp.

EpetraExt_PointToBlockDiagPermute::~EpetraExt_PointToBlockDiagPermute ( )
virtual

Destructor.

Definition at line 83 of file EpetraExt_PointToBlockDiagPermute.cpp.

Member Function Documentation

int EpetraExt_PointToBlockDiagPermute::SetParameters ( Teuchos::ParameterList List)
virtual

Sets the parameter list.

Definition at line 137 of file EpetraExt_PointToBlockDiagPermute.cpp.

virtual int EpetraExt_PointToBlockDiagPermute::SetUseTranspose ( bool  )
inlinevirtual

Set whether to use the transpose.

Returns
0 if this class can change its transpose state, else nonzero.

This class does NOT know how to apply its transpose, so this method always returns an error code.

Implements Epetra_Operator.

Definition at line 106 of file EpetraExt_PointToBlockDiagPermute.h.

int EpetraExt_PointToBlockDiagPermute::Compute ( )
virtual

Extracts the block-diagonal, builds maps, etc.

Definition at line 155 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::Apply ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
virtual

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.

Implements Epetra_Operator.

Definition at line 162 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::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.

Implements Epetra_Operator.

Definition at line 169 of file EpetraExt_PointToBlockDiagPermute.cpp.

virtual double EpetraExt_PointToBlockDiagPermute::NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix - NOT IMPLEMENTED.

Implements Epetra_Operator.

Definition at line 142 of file EpetraExt_PointToBlockDiagPermute.h.

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

Return a string describing the operator.

Implements Epetra_Operator.

Definition at line 149 of file EpetraExt_PointToBlockDiagPermute.h.

virtual bool EpetraExt_PointToBlockDiagPermute::UseTranspose ( ) const
inlinevirtual

Return the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 152 of file EpetraExt_PointToBlockDiagPermute.h.

virtual bool EpetraExt_PointToBlockDiagPermute::HasNormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 155 of file EpetraExt_PointToBlockDiagPermute.h.

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

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

Implements Epetra_Operator.

Definition at line 158 of file EpetraExt_PointToBlockDiagPermute.h.

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

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

Implements Epetra_Operator.

Definition at line 161 of file EpetraExt_PointToBlockDiagPermute.h.

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

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

Implements Epetra_Operator.

Definition at line 164 of file EpetraExt_PointToBlockDiagPermute.h.

virtual const EpetraExt_BlockDiagMatrix& EpetraExt_PointToBlockDiagPermute::BlockMatrix ( )
inlinevirtual

Return the block matrix. Only call this after calling Compute.

Definition at line 167 of file EpetraExt_PointToBlockDiagPermute.h.

Epetra_FECrsMatrix * EpetraExt_PointToBlockDiagPermute::CreateFECrsMatrix ( )
virtual

Create an Epetra_FECrsMatrix from the BlockDiagMatrix.

This is generally only useful if you want to do a matrix-matrix multiply.

Definition at line 602 of file EpetraExt_PointToBlockDiagPermute.cpp.

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

Print information about this object to the given output stream.

Reimplemented from Epetra_DistObject.

Definition at line 221 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::Import ( const Epetra_SrcDistObject A,
const Epetra_Import Importer,
Epetra_CombineMode  CombineMode,
const Epetra_OffsetIndex Indexor = 0 
)

Imports an Epetra_DistObject using the Epetra_Import object.

Parameters
InSource - Distributed object that will be imported into the "\e this" object.
InImporter - A Epetra_Import object specifying the communication required.
InCombineMode - A Epetra_CombineMode enumerated type specifying how results should be combined on the receiving processor.
Returns
Integer error code, set to 0 if successful.

Definition at line 651 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::Import ( const Epetra_SrcDistObject A,
const Epetra_Export Exporter,
Epetra_CombineMode  CombineMode,
const Epetra_OffsetIndex Indexor = 0 
)

Imports an Epetra_DistObject using the Epetra_Export object.

Parameters
InSource - Distributed object that will be imported into the "\e this" object.
InExporter - A Epetra_Export object specifying the communication required.
InCombineMode - A Epetra_CombineMode enumerated type specifying how results should be combined on the receiving processor.
Returns
Integer error code, set to 0 if successful.

Definition at line 656 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::Export ( const Epetra_SrcDistObject A,
const Epetra_Import Importer,
Epetra_CombineMode  CombineMode,
const Epetra_OffsetIndex Indexor = 0 
)

Exports an Epetra_DistObject using the Epetra_Import object.

Parameters
InSource - Distributed object that will be exported to the "\e this" object.
InImporter - A Epetra_Import object specifying the communication required.
InCombineMode - A Epetra_CombineMode enumerated type specifying how results should be combined on the receiving processor.
Returns
Integer error code, set to 0 if successful.

Definition at line 661 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::Export ( const Epetra_SrcDistObject A,
const Epetra_Export Exporter,
Epetra_CombineMode  CombineMode,
const Epetra_OffsetIndex Indexor = 0 
)

Exports an Epetra_DistObject using the Epetra_Export object.

Parameters
InSource - Distributed object that will be exported to the "\e this" multivector.
InExporter - A Epetra_Export object specifying the communication required.
InCombineMode - A Epetra_CombineMode enumerated type specifying how results should be combined on the receiving processor.
Returns
Integer error code, set to 0 if successful.

Definition at line 666 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::CheckSizes ( const Epetra_SrcDistObject Source)
protectedvirtual

Allows the source and target (this) objects to be compared for compatibility, return nonzero if not.

Implements Epetra_DistObject.

Definition at line 672 of file EpetraExt_PointToBlockDiagPermute.cpp.

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

Perform ID copies and permutations that are on processor.

Implements Epetra_DistObject.

Definition at line 678 of file EpetraExt_PointToBlockDiagPermute.cpp.

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

Perform any packing or preparation required for call to DoTransfer().

Implements Epetra_DistObject.

Definition at line 690 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::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 
)
protectedvirtual

Perform any unpacking and combining after call to DoTransfer().

Implements Epetra_DistObject.

Definition at line 704 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::ExtractBlockDiagonal ( )
private

Pulls the block diagonal of the matrix and then builds the BDMat_.

Definition at line 489 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::SetupContiguousMode ( )
private

Setup/Cleanup for Contiguous Mode.

Definition at line 538 of file EpetraExt_PointToBlockDiagPermute.cpp.

int EpetraExt_PointToBlockDiagPermute::CleanupContiguousMode ( )
private

Definition at line 555 of file EpetraExt_PointToBlockDiagPermute.cpp.

void EpetraExt_PointToBlockDiagPermute::UpdateImportVector ( int  NumVectors) const
private

Definition at line 619 of file EpetraExt_PointToBlockDiagPermute.cpp.

void EpetraExt_PointToBlockDiagPermute::UpdateExportVector ( int  NumVectors) const
private

Definition at line 633 of file EpetraExt_PointToBlockDiagPermute.cpp.

template<typename int_type >
Epetra_FECrsMatrix * EpetraExt_PointToBlockDiagPermute::TCreateFECrsMatrix ( )
private

Definition at line 570 of file EpetraExt_PointToBlockDiagPermute.cpp.

template<typename int_type >
int EpetraExt_PointToBlockDiagPermute::TSetupContiguousMode ( )
private

Definition at line 507 of file EpetraExt_PointToBlockDiagPermute.cpp.

template<typename int_type >
int EpetraExt_PointToBlockDiagPermute::TExtractBlockDiagonal ( )
private

Definition at line 230 of file EpetraExt_PointToBlockDiagPermute.cpp.

template<typename int_type >
int EpetraExt_PointToBlockDiagPermute::TSetParameters ( Teuchos::ParameterList List)
private

Definition at line 97 of file EpetraExt_PointToBlockDiagPermute.cpp.

template<typename int_type >
const int_type* EpetraExt_PointToBlockDiagPermute::Blockids_const_ptr ( ) const
private
template<typename int_type >
int_type*& EpetraExt_PointToBlockDiagPermute::Blockids_ref ( )
private
template<>
const int* EpetraExt_PointToBlockDiagPermute::Blockids_const_ptr ( ) const
inlineprivate

Definition at line 339 of file EpetraExt_PointToBlockDiagPermute.h.

template<>
int*& EpetraExt_PointToBlockDiagPermute::Blockids_ref ( )
inlineprivate

Definition at line 341 of file EpetraExt_PointToBlockDiagPermute.h.

template<>
const long long* EpetraExt_PointToBlockDiagPermute::Blockids_const_ptr ( ) const
inlineprivate

Definition at line 344 of file EpetraExt_PointToBlockDiagPermute.h.

template<>
long long*& EpetraExt_PointToBlockDiagPermute::Blockids_ref ( )
inlineprivate

Definition at line 345 of file EpetraExt_PointToBlockDiagPermute.h.

Member Data Documentation

Teuchos::ParameterList EpetraExt_PointToBlockDiagPermute::List_
private

Definition at line 297 of file EpetraExt_PointToBlockDiagPermute.h.

const Epetra_CrsMatrix* EpetraExt_PointToBlockDiagPermute::Matrix_
private

Definition at line 298 of file EpetraExt_PointToBlockDiagPermute.h.

bool EpetraExt_PointToBlockDiagPermute::PurelyLocalMode_
private

Definition at line 299 of file EpetraExt_PointToBlockDiagPermute.h.

bool EpetraExt_PointToBlockDiagPermute::ContiguousBlockMode_
private

Definition at line 302 of file EpetraExt_PointToBlockDiagPermute.h.

int EpetraExt_PointToBlockDiagPermute::ContiguousBlockSize_
private

Definition at line 303 of file EpetraExt_PointToBlockDiagPermute.h.

int EpetraExt_PointToBlockDiagPermute::NumBlocks_
private

Definition at line 305 of file EpetraExt_PointToBlockDiagPermute.h.

int* EpetraExt_PointToBlockDiagPermute::Blockstart_
private

Definition at line 306 of file EpetraExt_PointToBlockDiagPermute.h.

int* EpetraExt_PointToBlockDiagPermute::Blockids_int_
private

Definition at line 307 of file EpetraExt_PointToBlockDiagPermute.h.

long long* EpetraExt_PointToBlockDiagPermute::Blockids_LL_
private

Definition at line 309 of file EpetraExt_PointToBlockDiagPermute.h.

Epetra_BlockMap* EpetraExt_PointToBlockDiagPermute::BDMap_
private

Definition at line 311 of file EpetraExt_PointToBlockDiagPermute.h.

Epetra_Map* EpetraExt_PointToBlockDiagPermute::CompatibleMap_
private

Definition at line 312 of file EpetraExt_PointToBlockDiagPermute.h.

EpetraExt_BlockDiagMatrix* EpetraExt_PointToBlockDiagPermute::BDMat_
private

Definition at line 313 of file EpetraExt_PointToBlockDiagPermute.h.

Epetra_Import* EpetraExt_PointToBlockDiagPermute::Importer_
private

Definition at line 314 of file EpetraExt_PointToBlockDiagPermute.h.

Epetra_Export* EpetraExt_PointToBlockDiagPermute::Exporter_
private

Definition at line 315 of file EpetraExt_PointToBlockDiagPermute.h.

Epetra_MultiVector* EpetraExt_PointToBlockDiagPermute::ImportVector_
mutableprivate

Definition at line 316 of file EpetraExt_PointToBlockDiagPermute.h.

Epetra_MultiVector* EpetraExt_PointToBlockDiagPermute::ExportVector_
mutableprivate

Definition at line 317 of file EpetraExt_PointToBlockDiagPermute.h.


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