EpetraExt Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
Public Member Functions | 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 Member Functions

 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.
 
 ~Poisson2dOperator ()
 Destructor.
 
int SetUseTranspose (bool useTranspose)
 If useTranspose = true, apply the transpose from now on.
 
int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Poisson2dOperator applied to a Epetra_MultiVector X in Y.
 
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.
 
double NormInf () const
 Returns the infinity norm of the global matrix.
 
const char * Label () const
 Returns a character string describing the operator.
 
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.
 
Epetra_CrsMatrixGeneratePrecMatrix () const
 Generate a tridiagonal approximation to the 5-point Poisson as an Epetra_CrsMatrix.
 
 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.
 
 ~Poisson2dOperator ()
 Destructor.
 
int SetUseTranspose (bool UseTranspose)
 If set true, transpose of this operator will be applied.
 
int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Returns the result of a Poisson2dOperator applied to a Epetra_MultiVector X in Y.
 
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.
 
double NormInf () const
 Returns the infinity norm of the global matrix.
 
const char * Label () const
 Returns a character string describing the operator.
 
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.
 
Epetra_CrsMatrixGeneratePrecMatrix () const
 Generate a tridiagonal approximation to the 5-point Poisson as an Epetra_CrsMatrix.
 
- Public Member Functions inherited from Epetra_Operator
virtual ~Epetra_Operator ()
 

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_
 

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 inout/Poisson2dOperator.h.

Constructor & Destructor Documentation

◆ Poisson2dOperator() [1/2]

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 inout/Poisson2dOperator.cpp.

◆ ~Poisson2dOperator() [1/2]

Poisson2dOperator::~Poisson2dOperator ( )

Destructor.

Definition at line 107 of file inout/Poisson2dOperator.cpp.

◆ Poisson2dOperator() [2/2]

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() [2/2]

Poisson2dOperator::~Poisson2dOperator ( )

Destructor.

Member Function Documentation

◆ SetUseTranspose() [1/2]

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 inout/Poisson2dOperator.h.

◆ Apply() [1/2]

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 inout/Poisson2dOperator.cpp.

◆ ApplyInverse() [1/2]

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 inout/Poisson2dOperator.h.

◆ NormInf() [1/2]

double Poisson2dOperator::NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix.

Implements Epetra_Operator.

Definition at line 124 of file inout/Poisson2dOperator.h.

◆ Label() [1/2]

const char * Poisson2dOperator::Label ( ) const
inlinevirtual

Returns a character string describing the operator.

Implements Epetra_Operator.

Definition at line 130 of file inout/Poisson2dOperator.h.

◆ UseTranspose() [1/2]

bool Poisson2dOperator::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 133 of file inout/Poisson2dOperator.h.

◆ HasNormInf() [1/2]

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 inout/Poisson2dOperator.h.

◆ Comm() [1/2]

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 inout/Poisson2dOperator.h.

◆ OperatorDomainMap() [1/2]

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 inout/Poisson2dOperator.h.

◆ OperatorRangeMap() [1/2]

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 inout/Poisson2dOperator.h.

◆ GeneratePrecMatrix() [1/2]

Epetra_CrsMatrix * Poisson2dOperator::GeneratePrecMatrix ( ) const

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

Definition at line 195 of file inout/Poisson2dOperator.cpp.

◆ SetUseTranspose() [2/2]

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 inout_LL/Poisson2dOperator.h.

◆ Apply() [2/2]

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.

◆ ApplyInverse() [2/2]

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 inout_LL/Poisson2dOperator.h.

◆ NormInf() [2/2]

double Poisson2dOperator::NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix.

Implements Epetra_Operator.

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

◆ Label() [2/2]

const char * Poisson2dOperator::Label ( ) const
inlinevirtual

Returns a character string describing the operator.

Implements Epetra_Operator.

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

◆ UseTranspose() [2/2]

bool Poisson2dOperator::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

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

◆ HasNormInf() [2/2]

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 inout_LL/Poisson2dOperator.h.

◆ Comm() [2/2]

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 inout_LL/Poisson2dOperator.h.

◆ OperatorDomainMap() [2/2]

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 inout_LL/Poisson2dOperator.h.

◆ OperatorRangeMap() [2/2]

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 inout_LL/Poisson2dOperator.h.

◆ GeneratePrecMatrix() [2/2]

Epetra_CrsMatrix * Poisson2dOperator::GeneratePrecMatrix ( ) const

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

Member Data Documentation

◆ nx_

int Poisson2dOperator::nx_

Definition at line 155 of file inout/Poisson2dOperator.h.

◆ ny_

int Poisson2dOperator::ny_

Definition at line 155 of file inout/Poisson2dOperator.h.

◆ myny_

int Poisson2dOperator::myny_

Definition at line 155 of file inout/Poisson2dOperator.h.

◆ useTranspose_

bool Poisson2dOperator::useTranspose_

Definition at line 156 of file inout/Poisson2dOperator.h.

◆ comm_

const Epetra_Comm & Poisson2dOperator::comm_

Definition at line 157 of file inout/Poisson2dOperator.h.

◆ map_

Epetra_Map * Poisson2dOperator::map_

Definition at line 158 of file inout/Poisson2dOperator.h.

◆ numImports_

int Poisson2dOperator::numImports_

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

◆ importIDs_ [1/2]

int* Poisson2dOperator::importIDs_

Definition at line 160 of file inout/Poisson2dOperator.h.

◆ importMap_

Epetra_Map * Poisson2dOperator::importMap_

Definition at line 161 of file inout/Poisson2dOperator.h.

◆ importer_

Epetra_Import * Poisson2dOperator::importer_

Definition at line 162 of file inout/Poisson2dOperator.h.

◆ importX_

Epetra_MultiVector * Poisson2dOperator::importX_
mutable

Definition at line 163 of file inout/Poisson2dOperator.h.

◆ Label_

const char * Poisson2dOperator::Label_

Definition at line 164 of file inout/Poisson2dOperator.h.

◆ importIDs_ [2/2]

long long* Poisson2dOperator::importIDs_

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


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