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

Poisson2dOperator: A sample implementation of the Epetra_Operator class. More...

#include <Poisson2dOperator.h>

Inheritance diagram for Poisson2dOperator:
Inheritance graph
[legend]

Public Attributes

int nx_
 
int ny_
 
int myny_
 
bool useTranspose_
 
const Epetra_Commcomm_
 
Epetra_Mapmap_
 
int numImports_
 
int * importIDs_
 
Epetra_MapimportMap_
 
Epetra_Importimporter_
 
Epetra_MultiVectorimportX_
 
const char * Label_
 
long long * importIDs_
 
 Poisson2dOperator (int nx, int ny, const Epetra_Comm &comm)
 Builds a 2 dimensional Poisson operator for a nx by ny grid, assuming zero Dirichlet BCs. More...
 
 ~Poisson2dOperator ()
 Destructor. More...
 
int SetUseTranspose (bool useTranspose)
 If useTranspose = true, apply the transpose from now on. More...
 
int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Poisson2dOperator applied to a Epetra_MultiVector X in Y. More...
 
int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Poisson2dOperator inverse applied to an Epetra_MultiVector X in Y. More...
 
double NormInf () const
 Returns the infinity norm of the global matrix. More...
 
const char * Label () const
 Returns a character string describing the operator. More...
 
bool UseTranspose () const
 Returns the current UseTranspose setting. More...
 
bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise. More...
 
const Epetra_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator. More...
 
const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator. More...
 
const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator. More...
 
Epetra_CrsMatrixGeneratePrecMatrix () const
 Generate a tridiagonal approximation to the 5-point Poisson as an Epetra_CrsMatrix. More...
 
 Poisson2dOperator (int nx, int ny, const Epetra_Comm &comm)
 Builds a 2 dimensional Poisson operator for a nx by ny grid, assuming zero Dirichlet BCs. More...
 
 ~Poisson2dOperator ()
 Destructor. More...
 
int SetUseTranspose (bool UseTranspose)
 If set true, transpose of this operator will be applied. More...
 
int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Poisson2dOperator applied to a Epetra_MultiVector X in Y. More...
 
int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Poisson2dOperator inverse applied to an Epetra_MultiVector X in Y. More...
 
double NormInf () const
 Returns the infinity norm of the global matrix. More...
 
const char * Label () const
 Returns a character string describing the operator. More...
 
bool UseTranspose () const
 Returns the current UseTranspose setting. More...
 
bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise. More...
 
const Epetra_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator. More...
 
const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator. More...
 
const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator. More...
 
Epetra_CrsMatrixGeneratePrecMatrix () const
 Generate a tridiagonal approximation to the 5-point Poisson as an Epetra_CrsMatrix. More...
 

Additional Inherited Members

Detailed Description

Poisson2dOperator: A sample implementation of the Epetra_Operator class.

The Poisson2dOperator class is a class that implements Epetra_Operator for a 5-point Poisson stencil operator.

Definition at line 59 of file Poisson2dOperator.h.

Constructor & Destructor Documentation

Poisson2dOperator::Poisson2dOperator ( int  nx,
int  ny,
const Epetra_Comm comm 
)

Builds a 2 dimensional Poisson operator for a nx by ny grid, assuming zero Dirichlet BCs.

Build a 2 D Poisson operator. Split the y-dimension across the processor space.

Parameters
Innx - Number of gridpoints in the x direction.
Inny - Number of gridpoints in the y direction.

Definition at line 52 of file Poisson2dOperator.cpp.

Poisson2dOperator::~Poisson2dOperator ( )

Destructor.

Definition at line 107 of file Poisson2dOperator.cpp.

Poisson2dOperator::Poisson2dOperator ( int  nx,
int  ny,
const Epetra_Comm comm 
)

Builds a 2 dimensional Poisson operator for a nx by ny grid, assuming zero Dirichlet BCs.

Build a 2 D Poisson operator. Split the y-dimension across the processor space.

Parameters
Innx - Number of gridpoints in the x direction.
Inny - Number of gridpoints in the y direction.
Poisson2dOperator::~Poisson2dOperator ( )

Destructor.

Member Function Documentation

int Poisson2dOperator::SetUseTranspose ( bool  useTranspose)
inlinevirtual

If useTranspose = true, apply the transpose from now on.

This flag allows the transpose of the given operator to be used implicitly. Setting this flag affects only the Apply() and ApplyInverse() methods. If the implementation of this interface does not support transpose use, this method should return a value of -1.

Parameters
useTranspose[in] If true, this operator from now on switches to use its transpose. Otherwise, this operator from now on does not use its transpose.
Returns
-1 if this class does not implement the transpose, 0 if successful.

Implements Epetra_Operator.

Definition at line 88 of file Poisson2dOperator.h.

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

Returns the result of a Poisson2dOperator 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 115 of file Poisson2dOperator.cpp.

int Poisson2dOperator::ApplyInverse ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
inlinevirtual

Returns the result of a Poisson2dOperator 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 116 of file Poisson2dOperator.h.

double Poisson2dOperator::NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix.

Implements Epetra_Operator.

Definition at line 124 of file Poisson2dOperator.h.

const char* Poisson2dOperator::Label ( ) const
inlinevirtual

Returns a character string describing the operator.

Implements Epetra_Operator.

Definition at line 130 of file Poisson2dOperator.h.

bool Poisson2dOperator::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 133 of file Poisson2dOperator.h.

bool Poisson2dOperator::HasNormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 136 of file Poisson2dOperator.h.

const Epetra_Comm& Poisson2dOperator::Comm ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 139 of file Poisson2dOperator.h.

const Epetra_Map& Poisson2dOperator::OperatorDomainMap ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 142 of file Poisson2dOperator.h.

const Epetra_Map& Poisson2dOperator::OperatorRangeMap ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 145 of file Poisson2dOperator.h.

Epetra_CrsMatrix * Poisson2dOperator::GeneratePrecMatrix ( ) const

Generate a tridiagonal approximation to the 5-point Poisson as an Epetra_CrsMatrix.

Definition at line 195 of file Poisson2dOperator.cpp.

int Poisson2dOperator::SetUseTranspose ( bool  UseTranspose)
inlinevirtual

If set true, transpose of this operator will be applied.

This flag allows the transpose of the given operator to be used implicitly.  Setting this flag
affects only the Apply() and ApplyInverse() methods.  If the implementation of this interface
does not support transpose use, this method should return a value of -1.
Parameters
InUseTranspose -If true, multiply by the transpose of operator, otherwise just use operator.
Returns
Integer error code, set to 0 if successful. Set to -1 if this implementation does not support transpose.

Implements Epetra_Operator.

Definition at line 87 of file LL/Poisson2dOperator.h.

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

Returns the result of a Poisson2dOperator 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.

int Poisson2dOperator::ApplyInverse ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const
inlinevirtual

Returns the result of a Poisson2dOperator 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 115 of file LL/Poisson2dOperator.h.

double Poisson2dOperator::NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix.

Implements Epetra_Operator.

Definition at line 123 of file LL/Poisson2dOperator.h.

const char* Poisson2dOperator::Label ( ) const
inlinevirtual

Returns a character string describing the operator.

Implements Epetra_Operator.

Definition at line 129 of file LL/Poisson2dOperator.h.

bool Poisson2dOperator::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 132 of file LL/Poisson2dOperator.h.

bool Poisson2dOperator::HasNormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 135 of file LL/Poisson2dOperator.h.

const Epetra_Comm& Poisson2dOperator::Comm ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 138 of file LL/Poisson2dOperator.h.

const Epetra_Map& Poisson2dOperator::OperatorDomainMap ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 141 of file LL/Poisson2dOperator.h.

const Epetra_Map& Poisson2dOperator::OperatorRangeMap ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 144 of file LL/Poisson2dOperator.h.

Epetra_CrsMatrix* Poisson2dOperator::GeneratePrecMatrix ( ) const

Generate a tridiagonal approximation to the 5-point Poisson as an Epetra_CrsMatrix.

Member Data Documentation

int Poisson2dOperator::nx_

Definition at line 155 of file Poisson2dOperator.h.

int Poisson2dOperator::ny_

Definition at line 155 of file Poisson2dOperator.h.

int Poisson2dOperator::myny_

Definition at line 155 of file Poisson2dOperator.h.

bool Poisson2dOperator::useTranspose_

Definition at line 156 of file Poisson2dOperator.h.

const Epetra_Comm & Poisson2dOperator::comm_

Definition at line 157 of file Poisson2dOperator.h.

Epetra_Map * Poisson2dOperator::map_

Definition at line 158 of file Poisson2dOperator.h.

int Poisson2dOperator::numImports_

Definition at line 159 of file Poisson2dOperator.h.

int* Poisson2dOperator::importIDs_

Definition at line 160 of file Poisson2dOperator.h.

Epetra_Map * Poisson2dOperator::importMap_

Definition at line 161 of file Poisson2dOperator.h.

Epetra_Import * Poisson2dOperator::importer_

Definition at line 162 of file Poisson2dOperator.h.

Epetra_MultiVector * Poisson2dOperator::importX_
mutable

Definition at line 163 of file Poisson2dOperator.h.

const char * Poisson2dOperator::Label_

Definition at line 164 of file Poisson2dOperator.h.

long long* Poisson2dOperator::importIDs_

Definition at line 159 of file LL/Poisson2dOperator.h.


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