LifeV
PreconditionerPCD Class Reference

PreconditionerPCD. More...

#include <PreconditionerPCD.hpp>

+ Inheritance diagram for PreconditionerPCD:
+ Collaboration diagram for PreconditionerPCD:

Protected Attributes

int M_velocityBlockSize
 
int M_pressureBlockSize
 
FESpacePtr_Type M_uFESpace
 
FESpacePtr_Type M_pFESpace
 
Real M_timestep
 
Real M_viscosity
 
Real M_density
 
vectorPtr_Type M_beta
 
ADRAssembler< mesh_Type, matrixBlock_Type, vector_TypeM_adrPressureAssembler
 
ADRAssembler< mesh_Type, matrixBlock_Type, vector_TypeM_adrVelocityAssembler
 
GetPot M_dataFile
 
BCHandlerPtr_Type M_bcHandlerPtr
 
std::string M_fluidPrec
 
std::string M_fluidPrecDataSection
 
std::string M_pressureLaplacianPrec
 
std::string M_pressureLaplacianPrecDataSection
 
std::string M_pressureMassPrec
 
std::string M_pressureMassPrecDataSection
 
std::string M_pressureLaplacianOperator
 
std::string M_pressureMassOperator
 
bool M_setApBoundaryConditions
 
bool M_setFpBoundaryConditions
 
bool M_setMpBoundaryConditions
 
bool M_fullFactorization
 
bool M_schurOperatorReverseOrder
 
bool M_useStiffStrain
 
bool M_enableTransient
 
Real M_divergenceCoeff
 
bool M_recomputeNormalVectors
 
std::string M_inflowBoundaryType
 
std::string M_outflowBoundaryType
 
std::string M_characteristicBoundaryType
 
vectorPtr_Type M_normalVectors
 
- Protected Attributes inherited from PreconditionerComposition
std::shared_ptr< Epetra_Comm > M_comm
 
- Protected Attributes inherited from Preconditioner
std::string M_precType
 
Displayer M_displayer
 
list_Type M_list
 
bool M_preconditionerCreated
 

Private Member Functions

 PreconditionerPCD (const PreconditionerPCD &P)
 
 PreconditionerPCD (const std::shared_ptr< PreconditionerPCD > &)
 
void computeNormalVectors ()
 
vectorPtr_Type computeRobinCoefficient ()
 
void setBCByBoundaryType (matrixPtr_type Ap, UInt ApOffset, matrixPtr_type Fp, UInt FpOffset, matrixPtr_type Mp, UInt MpOffset)
 

Static Private Member Functions

static Real fZero (const Real &, const Real &, const Real &, const Real &, const ID &)
 

Public Types

typedef RegionMesh< LinearTetramesh_Type
 
typedef MapEpetra map_Type
 
typedef MatrixEpetraStructured< RealmatrixBlock_Type
 
typedef MatrixEpetraStructuredView< RealmatrixBlockView_Type
 
typedef MatrixEpetra< Realmatrix_Type
 
typedef std::shared_ptr< matrix_TypematrixPtr_type
 
typedef VectorEpetra vector_Type
 
typedef std::shared_ptr< vector_TypevectorPtr_Type
 
typedef Preconditioner super_Type
 
typedef std::shared_ptr< super_TypesuperPtr_Type
 
typedef ComposedOperator< Preconditionerpreconditioner_Type
 
typedef std::shared_ptr< preconditioner_TypepreconditionerPtr_Type
 
typedef std::shared_ptr< FESpace< mesh_Type, map_Type > > FESpacePtr_Type
 
typedef std::shared_ptr< BCHandlerBCHandlerPtr_Type
 
typedef Teuchos::ParameterList list_Type
 

Constructors, destructor

 PreconditionerPCD (std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
 default constructor More...
 
virtual ~PreconditionerPCD ()
 constructor from matrix A. More...
 

Methods

void createParametersList (list_Type &list, const GetPot &dataFile, const std::string &section, const std::string &subsection="PCD")
 Create the list of parameters of the preconditioner. More...
 
double condest ()
 Return an estimation of the conditionement number of the preconditioner. More...
 
void updateBeta (const vector_Type &beta)
 Update the vector beta of the convective term in Fp. More...
 
int buildPreconditioner (matrixPtr_type &A)
 Build the preconditioner. More...
 

Get Methods

int numBlocksRows () const
 
int numBlocksColumns () const
 

Set Methods

void setDataFromGetPot (const GetPot &dataFile, const std::string &section)
 Setter using GetPot. More...
 
virtual void setParameters (Teuchos::ParameterList &list)
 Method to setup the solver using Teuchos::ParameterList. More...
 
void setFESpace (FESpacePtr_Type uFESpace, FESpacePtr_Type pFESpace)
 Setter for the FESpace. More...
 
void setBCHandler (BCHandlerPtr_Type bchPtr)
 Setter for the BCHandler. More...
 
void setTimestep (const Real &timestep)
 Setter for the timestep. More...
 
void setViscosity (const Real &viscosity)
 Setter for the viscosity. More...
 
void setDensity (const Real &density)
 Setter for the density. More...
 
void setUseMinusDivergence (const bool &useMinusDivergence)
 Setter to know if we used B or -B in the discretization of the Navier-Stokes equations. More...
 

Additional Inherited Members

- Public Types inherited from PreconditionerComposition
typedef Preconditioner super_Type
 
typedef std::shared_ptr< super_TypesuperPtr_Type
 
typedef Epetra_Operator operator_Type
 
typedef std::shared_ptr< operator_TypeoperatorPtr_Type
 
typedef ComposedOperator< operator_Typeprec_Type
 
typedef std::shared_ptr< prec_TypeprecPtr_Type
 
typedef MatrixEpetra< Realmatrix_Type
 
typedef std::shared_ptr< matrix_TypematrixPtr_Type
 
typedef Teuchos::ParameterList list_Type
 
- Public Types inherited from Preconditioner
typedef Epetra_Operator prec_raw_type
 
typedef std::shared_ptr< prec_raw_typeprec_type
 
typedef MatrixEpetra< Realoperator_raw_type
 
typedef std::shared_ptr< operator_raw_typeoperator_type
 
typedef Displayer::comm_Type comm_Type
 
typedef Displayer::commPtr_Type commPtr_Type
 
typedef Teuchos::ParameterList list_Type
 
- Public Member Functions inherited from PreconditionerComposition
 PreconditionerComposition (std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
 Constructor. More...
 
 ~PreconditionerComposition ()
 Destructor. More...
 
void resetPreconditioner ()
 Reset the preconditioner. More...
 
Int SetUseTranspose (const bool useTranspose=false)
 Set the matrix to be used transposed (or not) More...
 
Int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Apply the inverse of the preconditioner on vector1 and store the result in vector2. More...
 
Int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Apply the inverse of the preconditioner on vector1 and store the result in vector2. More...
 
bool UseTranspose ()
 Return true if the preconditioner is transposed. More...
 
const Epetra_Map & OperatorRangeMap () const
 Return the Range map of the operator. More...
 
const Epetra_Map & OperatorDomainMap () const
 Return the Domain map of the operator. More...
 
void setComm (std::shared_ptr< Epetra_Comm > comm)
 
bool isPreconditionerSet () const
 Preconditioner is set? More...
 
operator_Typepreconditioner ()
 Get a standard pointer to the preconditioner. More...
 
operatorPtr_Type preconditionerPtr ()
 get a std::shared_ptr to the preconditioner. More...
 
virtual std::string preconditionerType ()
 Return the type name of the preconditioner. More...
 
UInt numOperators () const
 Return the number of operators in the composition. More...
 
- Public Member Functions inherited from Preconditioner
 Preconditioner (const commPtr_Type &comm=commPtr_Type())
 Constructor. More...
 
 Preconditioner (const Preconditioner &preconditioner, const commPtr_Type &comm=commPtr_Type())
 Copy constructor. More...
 
virtual ~Preconditioner ()
 Destructor. More...
 
virtual Int buildPreconditioner (operator_type &matrix)=0
 Build a preconditioner based on the given matrix. More...
 
virtual void showMe (std::ostream &output=std::cout) const
 Show informations about the preconditioner. More...
 
void setParametersList (const list_Type &list)
 The the internal list. More...
 
virtual void setSolver (SolverAztecOO &)
 Set the internal solver. More...
 
const bool & preconditionerCreated ()
 Return true if the preconditioner has been created. More...
 
const list_TypeparametersList () const
 Return the parameters list. More...
 
list_TypeparametersList ()
 Return the parameters list. More...
 
- Protected Member Functions inherited from PreconditionerComposition
int pushBack (matrixPtr_Type A, const bool useInverse=false, const bool useTranspose=false)
 Add A to the right of the composition. More...
 
int pushBack (operatorPtr_Type oper, const bool useInverse=false, const bool useTranspose=false, matrixPtr_Type baseMatrix=matrixPtr_Type())
 
int pushBack (matrixPtr_Type A, superPtr_Type preconditioner, const bool useInverse=false, const bool useTranspose=false)
 Use a preconditioner to build the inverse of A and add it to the right of the composition. More...
 
int pushBack (matrixPtr_Type embeddedA, superPtr_Type preconditioner, const VectorBlockStructure &blockStructure, const UInt &blockIndex, const MapEpetra &fullMap, const bool useInverse=false, const bool useTranspose=false, const bool buildPreconditioner=true)
 Use a preconditioner to build the inverse of A and add it to the right of the composition. More...
 
int pushBack (operatorPtr_Type embeddedOperator, const VectorBlockStructure &blockStructure, const UInt &blockIndex, const MapEpetra &fullMap, const bool useInverse, const bool useTranspose)
 

Detailed Description

PreconditionerPCD.

Author
Gwenol Grandperrin

The PreconditionerPCD class provides the PCD block preconditioner

Definition at line 63 of file PreconditionerPCD.hpp.

Member Typedef Documentation

◆ mesh_Type

Definition at line 71 of file PreconditionerPCD.hpp.

◆ map_Type

Definition at line 72 of file PreconditionerPCD.hpp.

◆ matrixBlock_Type

◆ matrixBlockView_Type

◆ matrix_Type

Definition at line 75 of file PreconditionerPCD.hpp.

◆ matrixPtr_type

typedef std::shared_ptr<matrix_Type> matrixPtr_type

Definition at line 76 of file PreconditionerPCD.hpp.

◆ vector_Type

Definition at line 77 of file PreconditionerPCD.hpp.

◆ vectorPtr_Type

typedef std::shared_ptr<vector_Type> vectorPtr_Type

Definition at line 78 of file PreconditionerPCD.hpp.

◆ super_Type

Definition at line 80 of file PreconditionerPCD.hpp.

◆ superPtr_Type

typedef std::shared_ptr<super_Type> superPtr_Type

Definition at line 81 of file PreconditionerPCD.hpp.

◆ preconditioner_Type

◆ preconditionerPtr_Type

typedef std::shared_ptr<preconditioner_Type> preconditionerPtr_Type

Definition at line 84 of file PreconditionerPCD.hpp.

◆ FESpacePtr_Type

typedef std::shared_ptr<FESpace<mesh_Type, map_Type> > FESpacePtr_Type

Definition at line 86 of file PreconditionerPCD.hpp.

◆ BCHandlerPtr_Type

typedef std::shared_ptr<BCHandler> BCHandlerPtr_Type

Definition at line 87 of file PreconditionerPCD.hpp.

◆ list_Type

typedef Teuchos::ParameterList list_Type

Definition at line 89 of file PreconditionerPCD.hpp.

Constructor & Destructor Documentation

◆ PreconditionerPCD() [1/3]

PreconditionerPCD ( std::shared_ptr< Epetra_Comm >  comm = std::shared_ptr<Epetra_Comm> ( new Epetra_MpiComm ( MPI_COMM_WORLD ) ))

default constructor

Definition at line 57 of file PreconditionerPCD.cpp.

+ Here is the caller graph for this function:

◆ ~PreconditionerPCD()

~PreconditionerPCD ( )
virtual

constructor from matrix A.

Parameters
AEpetraMatrix<double> matrix upon which construct the preconditioner default destructor

Definition at line 84 of file PreconditionerPCD.cpp.

◆ PreconditionerPCD() [2/3]

PreconditionerPCD ( const PreconditionerPCD P)
inlineprivate

Definition at line 247 of file PreconditionerPCD.hpp.

+ Here is the caller graph for this function:

◆ PreconditionerPCD() [3/3]

PreconditionerPCD ( const std::shared_ptr< PreconditionerPCD > &  )
inlineprivate

Definition at line 249 of file PreconditionerPCD.hpp.

Member Function Documentation

◆ createParametersList()

void createParametersList ( list_Type list,
const GetPot dataFile,
const std::string &  section,
const std::string &  subSection = "PCD" 
)
virtual

Create the list of parameters of the preconditioner.

Parameters
listA Parameter list to be filled
dataFileA GetPot object containing the data about the preconditioner
sectionThe section in "dataFile" where to find data about the preconditioner
subSectionThe subsection in "dataFile" where to find data about the preconditioner

Implements PreconditionerComposition.

Definition at line 90 of file PreconditionerPCD.cpp.

◆ condest()

Real condest ( )
virtual

Return an estimation of the conditionement number of the preconditioner.

Reimplemented from PreconditionerComposition.

Definition at line 172 of file PreconditionerPCD.cpp.

◆ updateBeta()

void updateBeta ( const vector_Type beta)

Update the vector beta of the convective term in Fp.

This method updates the value of beta.

Parameters
betaNew vector beta to be used to built the convective term

Definition at line 178 of file PreconditionerPCD.cpp.

+ Here is the caller graph for this function:

◆ buildPreconditioner()

int buildPreconditioner ( matrixPtr_type A)
virtual

Build the preconditioner.

Implements PreconditionerComposition.

Definition at line 184 of file PreconditionerPCD.cpp.

◆ numBlocksRows()

int numBlocksRows ( ) const

Definition at line 820 of file PreconditionerPCD.cpp.

◆ numBlocksColumns()

int numBlocksColumns ( ) const

Definition at line 826 of file PreconditionerPCD.cpp.

◆ setDataFromGetPot()

void setDataFromGetPot ( const GetPot dataFile,
const std::string &  section 
)
virtual

Setter using GetPot.

This method use GetPot to load data from a file and then set the preconditioner.

Parameters
dataFileis a GetPot dataFile
sectionis the section containing the data

Implements PreconditionerComposition.

Definition at line 832 of file PreconditionerPCD.cpp.

+ Here is the caller graph for this function:

◆ setParameters()

void setParameters ( Teuchos::ParameterList &  list)
virtual

Method to setup the solver using Teuchos::ParameterList.

Parameters
listTeuchos::ParameterList object

Implements PreconditionerComposition.

Definition at line 841 of file PreconditionerPCD.cpp.

◆ setFESpace()

void setFESpace ( FESpacePtr_Type  uFESpace,
FESpacePtr_Type  pFESpace 
)

Setter for the FESpace.

This method set the pointer for the FESpaces needed for the construction of the operators Ap, Fp and Mp.

Parameters
uFESpacestd::shared_ptr on the FESpace for the velocity
pFESpacestd::shared_ptr on the FESpace for the pressure

Definition at line 873 of file PreconditionerPCD.cpp.

◆ setBCHandler()

void setBCHandler ( BCHandlerPtr_Type  bchPtr)

Setter for the BCHandler.

This method set the pointer for the FESpaces needed for the construction of the operators Ap, Fp and Mp.

Parameters
bchPtrpointer to a BCHandler boject

Definition at line 888 of file PreconditionerPCD.cpp.

◆ setTimestep()

void setTimestep ( const Real timestep)

Setter for the timestep.

This method set the timestep used to compute Fp.

Parameters
timestepTimestep used to compute the solution of the Navier-Stokes equations

Definition at line 894 of file PreconditionerPCD.cpp.

◆ setViscosity()

void setViscosity ( const Real viscosity)

Setter for the viscosity.

This method set the viscosity used to compute Fp.

Parameters
viscosityViscosity used to compute the solution of the Navier-Stokes equations

Definition at line 900 of file PreconditionerPCD.cpp.

◆ setDensity()

void setDensity ( const Real density)

Setter for the density.

This method set the density used to compute Fp.

Parameters
densityDensity used to compute the solution of the Navier-Stokes equations

Definition at line 906 of file PreconditionerPCD.cpp.

◆ setUseMinusDivergence()

void setUseMinusDivergence ( const bool &  useMinusDivergence)

Setter to know if we used B or -B in the discretization of the Navier-Stokes equations.

Parameters
useMinusDivergenceis true if -B has been used.

Definition at line 912 of file PreconditionerPCD.cpp.

+ Here is the caller graph for this function:

◆ computeNormalVectors()

void computeNormalVectors ( )
private

Definition at line 925 of file PreconditionerPCD.cpp.

+ Here is the caller graph for this function:

◆ computeRobinCoefficient()

PreconditionerPCD::vectorPtr_Type computeRobinCoefficient ( )
private

Definition at line 1034 of file PreconditionerPCD.cpp.

◆ fZero()

static Real fZero ( const Real ,
const Real ,
const Real ,
const Real ,
const ID  
)
inlinestaticprivate

Definition at line 255 of file PreconditionerPCD.hpp.

◆ setBCByBoundaryType()

void setBCByBoundaryType ( matrixPtr_type  Ap,
UInt  ApOffset,
matrixPtr_type  Fp,
UInt  FpOffset,
matrixPtr_type  Mp,
UInt  MpOffset 
)
private

Definition at line 1069 of file PreconditionerPCD.cpp.

Field Documentation

◆ M_velocityBlockSize

int M_velocityBlockSize
protected

Definition at line 206 of file PreconditionerPCD.hpp.

◆ M_pressureBlockSize

int M_pressureBlockSize
protected

Definition at line 207 of file PreconditionerPCD.hpp.

◆ M_uFESpace

FESpacePtr_Type M_uFESpace
protected

Definition at line 208 of file PreconditionerPCD.hpp.

◆ M_pFESpace

FESpacePtr_Type M_pFESpace
protected

Definition at line 209 of file PreconditionerPCD.hpp.

◆ M_timestep

Real M_timestep
protected

Definition at line 211 of file PreconditionerPCD.hpp.

◆ M_viscosity

Real M_viscosity
protected

Definition at line 212 of file PreconditionerPCD.hpp.

◆ M_density

Real M_density
protected

Definition at line 213 of file PreconditionerPCD.hpp.

◆ M_beta

vectorPtr_Type M_beta
protected

Definition at line 214 of file PreconditionerPCD.hpp.

◆ M_adrPressureAssembler

ADRAssembler<mesh_Type, matrixBlock_Type, vector_Type> M_adrPressureAssembler
protected

Definition at line 216 of file PreconditionerPCD.hpp.

◆ M_adrVelocityAssembler

ADRAssembler<mesh_Type, matrixBlock_Type, vector_Type> M_adrVelocityAssembler
protected

Definition at line 217 of file PreconditionerPCD.hpp.

◆ M_dataFile

GetPot M_dataFile
protected

Definition at line 220 of file PreconditionerPCD.hpp.

◆ M_bcHandlerPtr

BCHandlerPtr_Type M_bcHandlerPtr
protected

Definition at line 221 of file PreconditionerPCD.hpp.

◆ M_fluidPrec

std::string M_fluidPrec
protected

Definition at line 222 of file PreconditionerPCD.hpp.

◆ M_fluidPrecDataSection

std::string M_fluidPrecDataSection
protected

Definition at line 223 of file PreconditionerPCD.hpp.

◆ M_pressureLaplacianPrec

std::string M_pressureLaplacianPrec
protected

Definition at line 224 of file PreconditionerPCD.hpp.

◆ M_pressureLaplacianPrecDataSection

std::string M_pressureLaplacianPrecDataSection
protected

Definition at line 225 of file PreconditionerPCD.hpp.

◆ M_pressureMassPrec

std::string M_pressureMassPrec
protected

Definition at line 226 of file PreconditionerPCD.hpp.

◆ M_pressureMassPrecDataSection

std::string M_pressureMassPrecDataSection
protected

Definition at line 227 of file PreconditionerPCD.hpp.

◆ M_pressureLaplacianOperator

std::string M_pressureLaplacianOperator
protected

Definition at line 228 of file PreconditionerPCD.hpp.

◆ M_pressureMassOperator

std::string M_pressureMassOperator
protected

Definition at line 229 of file PreconditionerPCD.hpp.

◆ M_setApBoundaryConditions

bool M_setApBoundaryConditions
protected

Definition at line 230 of file PreconditionerPCD.hpp.

◆ M_setFpBoundaryConditions

bool M_setFpBoundaryConditions
protected

Definition at line 231 of file PreconditionerPCD.hpp.

◆ M_setMpBoundaryConditions

bool M_setMpBoundaryConditions
protected

Definition at line 232 of file PreconditionerPCD.hpp.

◆ M_fullFactorization

bool M_fullFactorization
protected

Definition at line 233 of file PreconditionerPCD.hpp.

◆ M_schurOperatorReverseOrder

bool M_schurOperatorReverseOrder
protected

Definition at line 234 of file PreconditionerPCD.hpp.

◆ M_useStiffStrain

bool M_useStiffStrain
protected

Definition at line 235 of file PreconditionerPCD.hpp.

◆ M_enableTransient

bool M_enableTransient
protected

Definition at line 236 of file PreconditionerPCD.hpp.

◆ M_divergenceCoeff

Real M_divergenceCoeff
protected

Definition at line 237 of file PreconditionerPCD.hpp.

◆ M_recomputeNormalVectors

bool M_recomputeNormalVectors
protected

Definition at line 238 of file PreconditionerPCD.hpp.

◆ M_inflowBoundaryType

std::string M_inflowBoundaryType
protected

Definition at line 240 of file PreconditionerPCD.hpp.

◆ M_outflowBoundaryType

std::string M_outflowBoundaryType
protected

Definition at line 241 of file PreconditionerPCD.hpp.

◆ M_characteristicBoundaryType

std::string M_characteristicBoundaryType
protected

Definition at line 242 of file PreconditionerPCD.hpp.

◆ M_normalVectors

vectorPtr_Type M_normalVectors
protected

Definition at line 244 of file PreconditionerPCD.hpp.


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