IFPACK Development
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ifpack_LocalFilter Class Reference

Ifpack_LocalFilter a class for light-weight extraction of the submatrix corresponding to local rows and columns. More...

#include <Ifpack_LocalFilter.h>

Inheritance diagram for Ifpack_LocalFilter:
Inheritance graph
[legend]
Collaboration diagram for Ifpack_LocalFilter:
Collaboration graph
[legend]

Public Member Functions

 Ifpack_LocalFilter (const Teuchos::RefCountPtr< const Epetra_RowMatrix > &Matrix)
 Constructor.
 
virtual ~Ifpack_LocalFilter ()
 Destructor.
 
virtual int NumMyRowEntries (int MyRow, int &NumEntries) const
 Returns the number of nonzero entries in MyRow.
 
virtual int MaxNumEntries () const
 Returns the maximum of NumMyRowEntries() over all rows.
 
virtual int ExtractMyRowCopy (int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const
 Returns a copy of the specified local row in user-provided arrays.
 
virtual int ExtractDiagonalCopy (Epetra_Vector &Diagonal) const
 Returns a copy of the main diagonal in a user-provided vector.
 
virtual int Multiply (bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Epetra_RowMatrix multiplied by a Epetra_MultiVector X in Y.
 
virtual int Solve (bool, bool, bool, const Epetra_MultiVector &, Epetra_MultiVector &) const
 Returns result of a local-only solve using a triangular Epetra_RowMatrix with Epetra_MultiVectors X and Y (NOT IMPLEMENTED).
 
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 
virtual int InvRowSums (Epetra_Vector &) const
 Computes the sum of absolute values of the rows of the Epetra_RowMatrix, results returned in x (NOT IMPLEMENTED).
 
virtual int LeftScale (const Epetra_Vector &)
 Scales the Epetra_RowMatrix on the left with a Epetra_Vector x (NOT IMPLEMENTED).
 
virtual int InvColSums (Epetra_Vector &) const
 Computes the sum of absolute values of the columns of the Epetra_RowMatrix, results returned in x (NOT IMPLEMENTED).
 
virtual int RightScale (const Epetra_Vector &)
 Scales the Epetra_RowMatrix on the right with a Epetra_Vector x (NOT IMPLEMENTED).
 
virtual bool Filled () const
 If FillComplete() has been called, this query returns true, otherwise it returns false.
 
virtual double NormInf () const
 Returns the infinity norm of the global matrix.
 
virtual double NormOne () const
 Returns the one norm of the global matrix.
 
virtual int NumGlobalNonzeros () const
 Returns the number of nonzero entries in the global matrix.
 
virtual int NumGlobalRows () const
 Returns the number of global matrix rows.
 
virtual int NumGlobalCols () const
 Returns the number of global matrix columns.
 
virtual int NumGlobalDiagonals () const
 Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.
 
virtual long long NumGlobalNonzeros64 () const
 Returns the number of nonzero entries in the global matrix.
 
virtual long long NumGlobalRows64 () const
 Returns the number of global matrix rows.
 
virtual long long NumGlobalCols64 () const
 Returns the number of global matrix columns.
 
virtual long long NumGlobalDiagonals64 () const
 Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.
 
virtual int NumMyNonzeros () const
 Returns the number of nonzero entries in the calling processor's portion of the matrix.
 
virtual int NumMyRows () const
 Returns the number of matrix rows owned by the calling processor.
 
virtual int NumMyCols () const
 Returns the number of matrix columns owned by the calling processor.
 
virtual int NumMyDiagonals () const
 Returns the number of local nonzero diagonal entries, based on global row/column index comparisons.
 
virtual bool LowerTriangular () const
 If matrix is lower triangular in local index space, this query returns true, otherwise it returns false.
 
virtual bool UpperTriangular () const
 If matrix is upper triangular in local index space, this query returns true, otherwise it returns false.
 
virtual const Epetra_MapRowMatrixRowMap () const
 Returns the Epetra_Map object associated with the rows of this matrix.
 
virtual const Epetra_MapRowMatrixColMap () const
 Returns the Epetra_Map object associated with the columns of this matrix.
 
virtual const Epetra_ImportRowMatrixImporter () const
 Returns the Epetra_Import object that contains the import operations for distributed operations.
 
int SetOwnership (bool)
 Sets ownership.
 
int SetUseTranspose (bool UseTranspose_in)
 Sets use transpose (not implemented).
 
bool UseTranspose () const
 Returns the current UseTranspose setting.
 
bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise.
 
const Epetra_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator.
 
const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator.
 
const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator.
 
const Epetra_BlockMapMap () const
 
const char * Label () const
 

Detailed Description

Ifpack_LocalFilter a class for light-weight extraction of the submatrix corresponding to local rows and columns.

Class Ifpack_LocalFilter enables a light-weight contruction of an Epetra_RowMatrix-derived object, containing only the elements of the original, distributed matrix with local row and column ID. The local submatrix is based on a communicator containing the local process only. Each process will have its local object, corresponding to the local submatrix. Submatrices may or may not overlap.

The following instructions can be used to create "localized" matrices:

#include "Ifpack_LocalFilter.h"
...
Teuchos::RefCountPtr<Epetra_RowMatrix> A; // fill the elements of A,
A->FillComplete();
Ifpack_LocalFilter a class for light-weight extraction of the submatrix corresponding to local rows a...

Once created, LocalA defined, on each process, the submatrix corresponding to local rows and columns only. The creation and use of LocalA is "cheap", as the elements of the local matrix are obtained through calls to ExtractMyRowCopy on the original, distributed matrix, say A. This means that A must remain in scope every time LocalA is accessed.

A very convenient use of this class is to use Ifpack solvers to compute the LU factorizations of local blocks. If applied to a localized matrix, several Ifpack objects can operator in the same phase in a safe way, without non-required data exchange.

Author
Marzio Sala, SNL 9214
Date
Sep-04

Definition at line 98 of file Ifpack_LocalFilter.h.

Constructor & Destructor Documentation

◆ Ifpack_LocalFilter()

Ifpack_LocalFilter::Ifpack_LocalFilter ( const Teuchos::RefCountPtr< const Epetra_RowMatrix > & Matrix)

Constructor.

Definition at line 53 of file Ifpack_LocalFilter.cpp.

References ExtractMyRowCopy().

◆ ~Ifpack_LocalFilter()

virtual Ifpack_LocalFilter::~Ifpack_LocalFilter ( )
inlinevirtual

Destructor.

Definition at line 108 of file Ifpack_LocalFilter.h.

Member Function Documentation

◆ Apply()

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

Implements Epetra_Operator.

Definition at line 176 of file Ifpack_LocalFilter.cpp.

◆ ApplyInverse()

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

Implements Epetra_Operator.

Definition at line 209 of file Ifpack_LocalFilter.cpp.

◆ Comm()

const Epetra_Comm & Ifpack_LocalFilter::Comm ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 383 of file Ifpack_LocalFilter.h.

◆ ExtractDiagonalCopy()

int Ifpack_LocalFilter::ExtractDiagonalCopy ( Epetra_Vector & Diagonal) const
virtual

Returns a copy of the main diagonal in a user-provided vector.

Parameters
Diagonal- (Out) Extracted main diagonal.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

Definition at line 167 of file Ifpack_LocalFilter.cpp.

References Epetra_DistObject::Map(), and Epetra_BlockMap::SameAs().

◆ ExtractMyRowCopy()

int Ifpack_LocalFilter::ExtractMyRowCopy ( int MyRow,
int Length,
int & NumEntries,
double * Values,
int * Indices ) const
virtual

Returns a copy of the specified local row in user-provided arrays.

Parameters
MyRow- (In) Local row to extract.
Length- (In) Length of Values and Indices.
NumEntries- (Out) Number of nonzero entries extracted.
Values- (Out) Extracted values for this row.
Indices- (Out) Extracted global column indices for the corresponding values.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

Definition at line 130 of file Ifpack_LocalFilter.cpp.

Referenced by Ifpack_LocalFilter().

◆ Filled()

virtual bool Ifpack_LocalFilter::Filled ( ) const
inlinevirtual

If FillComplete() has been called, this query returns true, otherwise it returns false.

Implements Epetra_RowMatrix.

Definition at line 227 of file Ifpack_LocalFilter.h.

◆ HasNormInf()

bool Ifpack_LocalFilter::HasNormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 377 of file Ifpack_LocalFilter.h.

◆ InvColSums()

virtual int Ifpack_LocalFilter::InvColSums ( Epetra_Vector & ) const
inlinevirtual

Computes the sum of absolute values of the columns of the Epetra_RowMatrix, results returned in x (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 210 of file Ifpack_LocalFilter.h.

◆ InvRowSums()

virtual int Ifpack_LocalFilter::InvRowSums ( Epetra_Vector & ) const
inlinevirtual

Computes the sum of absolute values of the rows of the Epetra_RowMatrix, results returned in x (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 198 of file Ifpack_LocalFilter.h.

◆ Label()

const char * Ifpack_LocalFilter::Label ( ) const
inlinevirtual

Implements Epetra_Operator.

Definition at line 403 of file Ifpack_LocalFilter.h.

◆ LeftScale()

virtual int Ifpack_LocalFilter::LeftScale ( const Epetra_Vector & )
inlinevirtual

Scales the Epetra_RowMatrix on the left with a Epetra_Vector x (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 204 of file Ifpack_LocalFilter.h.

◆ LowerTriangular()

virtual bool Ifpack_LocalFilter::LowerTriangular ( ) const
inlinevirtual

If matrix is lower triangular in local index space, this query returns true, otherwise it returns false.

Implements Epetra_RowMatrix.

Definition at line 325 of file Ifpack_LocalFilter.h.

◆ Map()

const Epetra_BlockMap & Ifpack_LocalFilter::Map ( ) const
virtual

Implements Epetra_SrcDistObject.

Definition at line 216 of file Ifpack_LocalFilter.cpp.

◆ MaxNumEntries()

virtual int Ifpack_LocalFilter::MaxNumEntries ( ) const
inlinevirtual

Returns the maximum of NumMyRowEntries() over all rows.

Implements Epetra_RowMatrix.

Definition at line 130 of file Ifpack_LocalFilter.h.

◆ Multiply()

virtual int Ifpack_LocalFilter::Multiply ( bool TransA,
const Epetra_MultiVector & X,
Epetra_MultiVector & Y ) const
inlinevirtual

Returns the result of a Epetra_RowMatrix multiplied by a Epetra_MultiVector X in Y.

Parameters
TransA-(In) If true, multiply by the transpose of matrix, otherwise just use matrix.
X- (In) A Epetra_MultiVector of dimension NumVectors to multiply with matrix.
Y-(Out) A Epetra_MultiVector of dimension NumVectorscontaining result.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

Definition at line 175 of file Ifpack_LocalFilter.h.

◆ NormInf()

virtual double Ifpack_LocalFilter::NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix.

Implements Epetra_RowMatrix.

Definition at line 236 of file Ifpack_LocalFilter.h.

◆ NormOne()

virtual double Ifpack_LocalFilter::NormOne ( ) const
inlinevirtual

Returns the one norm of the global matrix.

Implements Epetra_RowMatrix.

Definition at line 245 of file Ifpack_LocalFilter.h.

◆ NumGlobalCols()

virtual int Ifpack_LocalFilter::NumGlobalCols ( ) const
inlinevirtual

Returns the number of global matrix columns.

Implements Epetra_RowMatrix.

Definition at line 264 of file Ifpack_LocalFilter.h.

◆ NumGlobalCols64()

virtual long long Ifpack_LocalFilter::NumGlobalCols64 ( ) const
inlinevirtual

Returns the number of global matrix columns.

Definition at line 289 of file Ifpack_LocalFilter.h.

◆ NumGlobalDiagonals()

virtual int Ifpack_LocalFilter::NumGlobalDiagonals ( ) const
inlinevirtual

Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.

Implements Epetra_RowMatrix.

Definition at line 270 of file Ifpack_LocalFilter.h.

◆ NumGlobalDiagonals64()

virtual long long Ifpack_LocalFilter::NumGlobalDiagonals64 ( ) const
inlinevirtual

Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.

Definition at line 295 of file Ifpack_LocalFilter.h.

◆ NumGlobalNonzeros()

virtual int Ifpack_LocalFilter::NumGlobalNonzeros ( ) const
inlinevirtual

Returns the number of nonzero entries in the global matrix.

Implements Epetra_RowMatrix.

Definition at line 252 of file Ifpack_LocalFilter.h.

◆ NumGlobalNonzeros64()

virtual long long Ifpack_LocalFilter::NumGlobalNonzeros64 ( ) const
inlinevirtual

Returns the number of nonzero entries in the global matrix.

Definition at line 277 of file Ifpack_LocalFilter.h.

◆ NumGlobalRows()

virtual int Ifpack_LocalFilter::NumGlobalRows ( ) const
inlinevirtual

Returns the number of global matrix rows.

Implements Epetra_RowMatrix.

Definition at line 258 of file Ifpack_LocalFilter.h.

◆ NumGlobalRows64()

virtual long long Ifpack_LocalFilter::NumGlobalRows64 ( ) const
inlinevirtual

Returns the number of global matrix rows.

Definition at line 283 of file Ifpack_LocalFilter.h.

◆ NumMyCols()

virtual int Ifpack_LocalFilter::NumMyCols ( ) const
inlinevirtual

Returns the number of matrix columns owned by the calling processor.

Implements Epetra_RowMatrix.

Definition at line 313 of file Ifpack_LocalFilter.h.

◆ NumMyDiagonals()

virtual int Ifpack_LocalFilter::NumMyDiagonals ( ) const
inlinevirtual

Returns the number of local nonzero diagonal entries, based on global row/column index comparisons.

Implements Epetra_RowMatrix.

Definition at line 319 of file Ifpack_LocalFilter.h.

◆ NumMyNonzeros()

virtual int Ifpack_LocalFilter::NumMyNonzeros ( ) const
inlinevirtual

Returns the number of nonzero entries in the calling processor's portion of the matrix.

Implements Epetra_RowMatrix.

Definition at line 301 of file Ifpack_LocalFilter.h.

◆ NumMyRowEntries()

virtual int Ifpack_LocalFilter::NumMyRowEntries ( int MyRow,
int & NumEntries ) const
inlinevirtual

Returns the number of nonzero entries in MyRow.

Parameters
MyRow- (In) Local row.
NumEntries- (Out) Number of nonzero values present.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_RowMatrix.

Definition at line 123 of file Ifpack_LocalFilter.h.

◆ NumMyRows()

virtual int Ifpack_LocalFilter::NumMyRows ( ) const
inlinevirtual

Returns the number of matrix rows owned by the calling processor.

Implements Epetra_RowMatrix.

Definition at line 307 of file Ifpack_LocalFilter.h.

◆ OperatorDomainMap()

const Epetra_Map & Ifpack_LocalFilter::OperatorDomainMap ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 389 of file Ifpack_LocalFilter.h.

◆ OperatorRangeMap()

const Epetra_Map & Ifpack_LocalFilter::OperatorRangeMap ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 395 of file Ifpack_LocalFilter.h.

◆ RightScale()

virtual int Ifpack_LocalFilter::RightScale ( const Epetra_Vector & )
inlinevirtual

Scales the Epetra_RowMatrix on the right with a Epetra_Vector x (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 217 of file Ifpack_LocalFilter.h.

◆ RowMatrixColMap()

virtual const Epetra_Map & Ifpack_LocalFilter::RowMatrixColMap ( ) const
inlinevirtual

Returns the Epetra_Map object associated with the columns of this matrix.

Implements Epetra_RowMatrix.

Definition at line 343 of file Ifpack_LocalFilter.h.

◆ RowMatrixImporter()

virtual const Epetra_Import * Ifpack_LocalFilter::RowMatrixImporter ( ) const
inlinevirtual

Returns the Epetra_Import object that contains the import operations for distributed operations.

Implements Epetra_RowMatrix.

Definition at line 349 of file Ifpack_LocalFilter.h.

◆ RowMatrixRowMap()

virtual const Epetra_Map & Ifpack_LocalFilter::RowMatrixRowMap ( ) const
inlinevirtual

Returns the Epetra_Map object associated with the rows of this matrix.

Implements Epetra_RowMatrix.

Definition at line 337 of file Ifpack_LocalFilter.h.

◆ SetOwnership()

int Ifpack_LocalFilter::SetOwnership ( bool )
inline

Sets ownership.

Definition at line 358 of file Ifpack_LocalFilter.h.

◆ SetUseTranspose()

int Ifpack_LocalFilter::SetUseTranspose ( bool UseTranspose_in)
inlinevirtual

Sets use transpose (not implemented).

Implements Epetra_Operator.

Definition at line 364 of file Ifpack_LocalFilter.h.

◆ Solve()

virtual int Ifpack_LocalFilter::Solve ( bool ,
bool ,
bool ,
const Epetra_MultiVector & ,
Epetra_MultiVector &  ) const
inlinevirtual

Returns result of a local-only solve using a triangular Epetra_RowMatrix with Epetra_MultiVectors X and Y (NOT IMPLEMENTED).

Implements Epetra_RowMatrix.

Definition at line 186 of file Ifpack_LocalFilter.h.

◆ UpperTriangular()

virtual bool Ifpack_LocalFilter::UpperTriangular ( ) const
inlinevirtual

If matrix is upper triangular in local index space, this query returns true, otherwise it returns false.

Implements Epetra_RowMatrix.

Definition at line 331 of file Ifpack_LocalFilter.h.

◆ UseTranspose()

bool Ifpack_LocalFilter::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 371 of file Ifpack_LocalFilter.h.


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