LifeV
NavierStokesOperator Class Reference

A abstract class for handling n-by-m block operators This class inherits from LifeV::LinearOperator. More...

#include <NavierStokesOperator.hpp>

+ Inheritance diagram for NavierStokesOperator:
+ Collaboration diagram for NavierStokesOperator:

Public Member Functions

 NavierStokesOperator ()
 Empty Constructor. More...
 
- Public Member Functions inherited from LinearOperatorAlgebra
virtual ~LinearOperatorAlgebra ()
 Destructor. More...
 
int apply (const VectorEpetra &X, VectorEpetra &Y) const
 Returns the result of a LinearOperator applied to a VectorEpetra X in Y. More...
 
int applyInverse (const VectorEpetra &X, VectorEpetra &Y)
 Returns the result of a LinearOperator inverse applied to an VectorEpetra X in Y. More...
 

Private Attributes

operatorPtrContainer_Type M_oper
 block operator represented like a dense matrix of pointers to Operators More...
 
bool M_useTranspose
 whenever transpose should be used More...
 

Public Typedefs

typedef LinearOperatorAlgebra super
 
typedef super::comm_Type comm_Type
 
typedef super::commPtr_Type commPtr_Type
 
typedef super::map_Type map_Type
 
typedef super::mapPtr_Type mapPtr_Type
 
typedef super::operator_Type operator_Type
 
typedef super::operatorPtr_Type operatorPtr_Type
 
typedef super::vector_Type vector_Type
 
typedef super::vectorPtr_Type vectorPtr_Type
 
typedef boost::numeric::ublas::matrix< operatorPtr_TypeoperatorPtrContainer_Type
 
typedef std::vector< vectorPtr_TypevectorPtrContainer_Type
 
typedef std::vector< mapPtr_TypemapPtrContainer_Type
 

Set Methods

UInt M_nBlockRows
 Number of blocks in each row. More...
 
UInt M_nBlockCols
 Number of blocks in each column. More...
 
std::string M_name
 Name of the object. More...
 
commPtr_Type M_comm
 Communicator. More...
 
void setUp (const std::shared_ptr< BlockEpetra_Map > &map, const commPtr_Type &comm)
 SetUp for a "square operator". More...
 
void setUp (const std::shared_ptr< BlockEpetra_Map > &domainMap, const std::shared_ptr< BlockEpetra_Map > &rangeMap, const commPtr_Type &comm)
 SetUp for a "rectangular operator". More...
 
void setUp (const operatorPtrContainer_Type &blockOper, const commPtr_Type &comm)
 SetUp when the operator is given like a std::matrix. More...
 
void setBlock (UInt iblock, UInt jblock, const operatorPtr_Type &operBlock)
 set a component of the block operator More...
 
void fillComplete ()
 Complete the block matrix with null operators. More...
 
int SetUseTranspose (bool useTranspose)
 If true the transpose of the operator will be computed. More...
 
virtual int Apply (const vector_Type &X, vector_Type &Y) const
 Compute Y = Op*X;. More...
 
virtual int ApplyInverse (const vector_Type &X, vector_Type &Y) const
 Compute Y = Op;. More...
 
double NormInf () const
 Compute the Inf norm of the operator. More...
 
virtual 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 comm_TypeComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator. More...
 
const operatorPtr_Typeblock (UInt iblock, UInt jblock) const
 Returns a const pointer to the (i,j) block. More...
 
const map_TypeOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator. More...
 
const mapPtr_TypeOperatorDomainMap_ptr () const
 Returns the Epetra_Map object associated with the domain of this operator as a pointer. More...
 
const std::shared_ptr< BlockEpetra_Map > & OperatorDomainBlockMapPtr () const
 
const map_TypeOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator. More...
 
const mapPtr_TypeOperatorRangeMap_ptr () const
 Returns the Epetra_Map object associated with the range of this operator as a pointer. More...
 
const std::shared_ptr< BlockEpetra_Map > & OperatorRangeBlockMapPtr () const
 
int applyNoTranspose (const vector_Type &X, vector_Type &Y) const
 Compute Y = Op*X;. More...
 
int applyTranspose (const vector_Type &X, vector_Type &Y) const
 Compute Y = Op'*X;. More...
 
int blockJacobi (const vector_Type &X, vector_Type &Y) const
 Y = diag(block(i,i)^-1)*X. More...
 
int blockUpperTriangularSolve (const vector_Type &X, vector_Type &Y) const
 Y = backwardsubstitution(X) More...
 
int blockLowerTriangularSolve (const vector_Type &X, vector_Type &Y) const
 Y = forwardsubstitution(X) More...
 
void setName (const std::string &name)
 Change the name of the operator, (available for derivate classes). More...
 

Maps

std::shared_ptr< BlockEpetra_MapM_domainMap
 Domain Map. More...
 
std::shared_ptr< BlockEpetra_MapM_rangeMap
 Range Map. More...
 

Additional Inherited Members

- Public Types inherited from LinearOperatorAlgebra
typedef Epetra_Comm comm_Type
 
typedef std::shared_ptr< comm_TypecommPtr_Type
 
typedef Epetra_Map map_Type
 
typedef std::shared_ptr< map_TypemapPtr_Type
 
typedef std::shared_ptr< const map_TypeconstMapPtr_Type
 
typedef Epetra_Operator operator_Type
 
typedef std::shared_ptr< operator_TypeoperatorPtr_Type
 
typedef Epetra_MultiVector vector_Type
 
typedef std::shared_ptr< vector_TypevectorPtr_Type
 

Detailed Description

A abstract class for handling n-by-m block operators This class inherits from LifeV::LinearOperator.

The Transpose is not supported yet.

Definition at line 60 of file NavierStokesOperator.hpp.

Member Typedef Documentation

◆ super

Definition at line 66 of file NavierStokesOperator.hpp.

◆ comm_Type

Definition at line 67 of file NavierStokesOperator.hpp.

◆ commPtr_Type

Definition at line 68 of file NavierStokesOperator.hpp.

◆ map_Type

Definition at line 69 of file NavierStokesOperator.hpp.

◆ mapPtr_Type

Definition at line 70 of file NavierStokesOperator.hpp.

◆ operator_Type

Definition at line 71 of file NavierStokesOperator.hpp.

◆ operatorPtr_Type

◆ vector_Type

Definition at line 73 of file NavierStokesOperator.hpp.

◆ vectorPtr_Type

Definition at line 74 of file NavierStokesOperator.hpp.

◆ operatorPtrContainer_Type

typedef boost::numeric::ublas::matrix<operatorPtr_Type> operatorPtrContainer_Type

Definition at line 76 of file NavierStokesOperator.hpp.

◆ vectorPtrContainer_Type

Definition at line 77 of file NavierStokesOperator.hpp.

◆ mapPtrContainer_Type

typedef std::vector<mapPtr_Type > mapPtrContainer_Type

Definition at line 78 of file NavierStokesOperator.hpp.

Constructor & Destructor Documentation

◆ NavierStokesOperator()

Empty Constructor.

Definition at line 7 of file NavierStokesOperator.cpp.

Member Function Documentation

◆ setUp() [1/3]

void setUp ( const std::shared_ptr< BlockEpetra_Map > &  map,
const commPtr_Type comm 
)

SetUp for a "square operator".

Parameters
domainMapthe map of a vector in the domain of this is obtained by concatenating the block maps in domainMap. rangeMap is assumed to be the same of domainMap.
commthe communicator.

Definition at line 14 of file NavierStokesOperator.cpp.

◆ setUp() [2/3]

void setUp ( const std::shared_ptr< BlockEpetra_Map > &  domainMap,
const std::shared_ptr< BlockEpetra_Map > &  rangeMap,
const commPtr_Type comm 
)

SetUp for a "rectangular operator".

Parameters
domainMapthe map of a vector in the domain of this is obtained by concatenating the block maps in domainMap.
rangeMapthe map of a vector in the range of this is obtained by concatenating the block maps in rangeMap.
commthe communicator.

Definition at line 27 of file NavierStokesOperator.cpp.

◆ setUp() [3/3]

void setUp ( const operatorPtrContainer_Type blockOper,
const commPtr_Type comm 
)

SetUp when the operator is given like a std::matrix.

Parameters
blockOpera dense matrix to describe the block operator
commthe communicator

Definition at line 44 of file NavierStokesOperator.cpp.

◆ setBlock()

void setBlock ( UInt  iblock,
UInt  jblock,
const operatorPtr_Type operBlock 
)

set a component of the block operator

Parameters
iblock,jblockThe position of the block is (iblock, jblock).
operBlock: an operator_ptr representing the block

Definition at line 82 of file NavierStokesOperator.cpp.

◆ fillComplete()

void fillComplete ( )

Complete the block matrix with null operators.

Definition at line 91 of file NavierStokesOperator.cpp.

◆ SetUseTranspose()

int SetUseTranspose ( bool  useTranspose)
virtual

If true the transpose of the operator will be computed.

Implements LinearOperatorAlgebra.

Definition at line 108 of file NavierStokesOperator.cpp.

◆ Apply()

int Apply ( const vector_Type X,
vector_Type Y 
) const
virtual

Compute Y = Op*X;.

Implements LinearOperatorAlgebra.

Definition at line 123 of file NavierStokesOperator.cpp.

◆ ApplyInverse()

int ApplyInverse ( const vector_Type X,
vector_Type Y 
) const
virtual

Compute Y = Op;.

ApplyInverse is implemented for the matrices with block diagonal, lowerTriangular, upperTriangular form

Implements LinearOperatorAlgebra.

Definition at line 133 of file NavierStokesOperator.cpp.

◆ NormInf()

double NormInf ( ) const
inlinevirtual

Compute the Inf norm of the operator.

Not implemented yet.

Implements LinearOperatorAlgebra.

Definition at line 146 of file NavierStokesOperator.hpp.

◆ Label()

virtual const char* Label ( ) const
inlinevirtual

Returns a character string describing the operator.

Implements LinearOperatorAlgebra.

Definition at line 149 of file NavierStokesOperator.hpp.

◆ UseTranspose()

bool UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements LinearOperatorAlgebra.

Definition at line 152 of file NavierStokesOperator.hpp.

◆ HasNormInf()

bool HasNormInf ( ) const
inlinevirtual

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

Implements LinearOperatorAlgebra.

Definition at line 155 of file NavierStokesOperator.hpp.

◆ Comm()

const comm_Type& Comm ( ) const
inlinevirtual

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

Implements LinearOperatorAlgebra.

Definition at line 158 of file NavierStokesOperator.hpp.

◆ block()

const NavierStokesOperator::operatorPtr_Type & block ( UInt  iblock,
UInt  jblock 
) const

Returns a const pointer to the (i,j) block.

Definition at line 139 of file NavierStokesOperator.cpp.

◆ OperatorDomainMap()

const map_Type& OperatorDomainMap ( ) const
inlinevirtual

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

Implements LinearOperatorAlgebra.

Definition at line 164 of file NavierStokesOperator.hpp.

◆ OperatorDomainMap_ptr()

const mapPtr_Type& OperatorDomainMap_ptr ( ) const
inline

Returns the Epetra_Map object associated with the domain of this operator as a pointer.

Definition at line 166 of file NavierStokesOperator.hpp.

◆ OperatorDomainBlockMapPtr()

const std::shared_ptr<BlockEpetra_Map>& OperatorDomainBlockMapPtr ( ) const
inline

Definition at line 167 of file NavierStokesOperator.hpp.

◆ OperatorRangeMap()

const map_Type& OperatorRangeMap ( ) const
inlinevirtual

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

Implements LinearOperatorAlgebra.

Definition at line 170 of file NavierStokesOperator.hpp.

◆ OperatorRangeMap_ptr()

const mapPtr_Type& OperatorRangeMap_ptr ( ) const
inline

Returns the Epetra_Map object associated with the range of this operator as a pointer.

Definition at line 172 of file NavierStokesOperator.hpp.

◆ OperatorRangeBlockMapPtr()

const std::shared_ptr<BlockEpetra_Map>& OperatorRangeBlockMapPtr ( ) const
inline

Definition at line 173 of file NavierStokesOperator.hpp.

◆ applyNoTranspose()

int applyNoTranspose ( const vector_Type X,
vector_Type Y 
) const
protected

Compute Y = Op*X;.

Definition at line 152 of file NavierStokesOperator.cpp.

◆ applyTranspose()

int applyTranspose ( const vector_Type X,
vector_Type Y 
) const
protected

Compute Y = Op'*X;.

Definition at line 176 of file NavierStokesOperator.cpp.

◆ blockJacobi()

int blockJacobi ( const vector_Type X,
vector_Type Y 
) const
protected

Y = diag(block(i,i)^-1)*X.

◆ blockUpperTriangularSolve()

int blockUpperTriangularSolve ( const vector_Type X,
vector_Type Y 
) const
protected

Y = backwardsubstitution(X)

◆ blockLowerTriangularSolve()

int blockLowerTriangularSolve ( const vector_Type X,
vector_Type Y 
) const
protected

Y = forwardsubstitution(X)

◆ setName()

void setName ( const std::string &  name)
inlineprotected

Change the name of the operator, (available for derivate classes).

Definition at line 187 of file NavierStokesOperator.hpp.

Field Documentation

◆ M_nBlockRows

UInt M_nBlockRows
private

Number of blocks in each row.

Definition at line 191 of file NavierStokesOperator.hpp.

◆ M_nBlockCols

UInt M_nBlockCols
private

Number of blocks in each column.

Definition at line 193 of file NavierStokesOperator.hpp.

◆ M_name

std::string M_name
private

Name of the object.

Definition at line 196 of file NavierStokesOperator.hpp.

◆ M_comm

commPtr_Type M_comm
private

Communicator.

Definition at line 198 of file NavierStokesOperator.hpp.

◆ M_domainMap

std::shared_ptr<BlockEpetra_Map> M_domainMap
private

Domain Map.

Definition at line 203 of file NavierStokesOperator.hpp.

◆ M_rangeMap

std::shared_ptr<BlockEpetra_Map> M_rangeMap
private

Range Map.

Definition at line 205 of file NavierStokesOperator.hpp.

◆ M_oper

operatorPtrContainer_Type M_oper
private

block operator represented like a dense matrix of pointers to Operators

Definition at line 209 of file NavierStokesOperator.hpp.

◆ M_useTranspose

bool M_useTranspose
private

whenever transpose should be used

Definition at line 212 of file NavierStokesOperator.hpp.


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