LifeV
PreconditionerML Class Reference

PreconditionerML - Class of multilevels preconditioner. More...

#include <PreconditionerML.hpp>

+ Inheritance diagram for PreconditionerML:
+ Collaboration diagram for PreconditionerML:

Protected Attributes

list_Type M_IfpackSubList
 
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 Attributes

operator_type M_operator
 
prec_type M_preconditioner
 
bool M_analyze
 
bool M_visualizationDataAvailable
 
std::shared_ptr< std::vector< Real > > M_xCoord
 
std::shared_ptr< std::vector< Real > > M_yCoord
 
std::shared_ptr< std::vector< Real > > M_zCoord
 

Public Types

typedef Preconditioner super
 
typedef ML_Epetra::MultiLevelPreconditioner prec_raw_type
 
typedef std::shared_ptr< prec_raw_typeprec_type
 
typedef super::operator_raw_type operator_raw_type
 
typedef super::operator_type operator_type
 

Constructors & Destructor

 PreconditionerML (std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
 Empty constructor. More...
 
virtual ~PreconditionerML ()
 destructor. More...
 
 PreconditionerML (operator_type &matrix)
 Constructor from a matrix. More...
 

Methods

Int buildPreconditioner (operator_type &matrix)
 Build a preconditioner based on the given matrix. More...
 
void resetPreconditioner ()
 Reset the preconditioner. More...
 
virtual void createParametersList (list_Type &list, const GetPot &dataFile, const std::string &section, const std::string &subSection)
 Create the list of parameters of the preconditioner. More...
 
virtual Int ApplyInverse (const Epetra_MultiVector &vector1, Epetra_MultiVector &vector2) const
 Apply the inverse of the preconditioner on vector1 and store the result in vector2. More...
 
virtual Int Apply (const Epetra_MultiVector &vector1, Epetra_MultiVector &vector2) const
 Apply the preconditioner on vector1 and store the result in vector2. More...
 
virtual void showMe (std::ostream &output=std::cout) const
 Show informations about the preconditioner. More...
 
static void createMLList (list_Type &list, const GetPot &dataFile, const std::string &section, const std::string &subSection="ML", const bool &verbose=true)
 Create the list of parameters of the preconditioner. More...
 

Set Methods

void setDataFromGetPot (const GetPot &dataFile, const std::string &section)
 Set the data of the preconditioner using a GetPot object. More...
 
Int SetUseTranspose (bool useTranspose=false)
 Set the matrix to be used transposed (or not) More...
 
void setVerticesCoordinates (std::shared_ptr< std::vector< Real > > xCoord, std::shared_ptr< std::vector< Real > > yCoord, std::shared_ptr< std::vector< Real > > zCoord)
 Set the coordinate to be used for the visualization of the aggregates. More...
 

Get Methods

Real condest ()
 Return An estimation of the condition number of the preconditioner. More...
 
super::prec_raw_typepreconditioner ()
 Return a raw pointer on the preconditioner. More...
 
super::prec_type preconditionerPtr ()
 Return a shared pointer on the preconditioner. More...
 
std::string preconditionerType ()
 Return the type of preconditioner. 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...
 

Additional Inherited Members

- 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 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...
 
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...
 

Detailed Description

PreconditionerML - Class of multilevels preconditioner.

Author
Simone Deparis simon.nosp@m.e.de.nosp@m.paris.nosp@m.@epf.nosp@m.l.ch
Contributor:
Gwenol Grandperrin gweno.nosp@m.l.gr.nosp@m.andpe.nosp@m.rrin.nosp@m.@epfl.nosp@m..ch
Maintainer:
Gwenol Grandperrin gweno.nosp@m.l.gr.nosp@m.andpe.nosp@m.rrin.nosp@m.@epfl.nosp@m..ch

Definition at line 59 of file PreconditionerML.hpp.

Member Typedef Documentation

◆ super

Definition at line 67 of file PreconditionerML.hpp.

◆ prec_raw_type

typedef ML_Epetra::MultiLevelPreconditioner prec_raw_type

Definition at line 69 of file PreconditionerML.hpp.

◆ prec_type

typedef std::shared_ptr<prec_raw_type> prec_type

Definition at line 70 of file PreconditionerML.hpp.

◆ operator_raw_type

◆ operator_type

Definition at line 73 of file PreconditionerML.hpp.

Constructor & Destructor Documentation

◆ PreconditionerML() [1/2]

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

Empty constructor.

Definition at line 48 of file PreconditionerML.cpp.

◆ ~PreconditionerML()

~PreconditionerML ( )
virtual

destructor.

Definition at line 59 of file PreconditionerML.cpp.

◆ PreconditionerML() [2/2]

Constructor from a matrix.

Parameters
matrixMatrix upon which construct the preconditioner

Member Function Documentation

◆ buildPreconditioner()

Int buildPreconditioner ( operator_type matrix)
virtual

Build a preconditioner based on the given matrix.

Parameters
matrixMatrix upon which construct the preconditioner

Implements Preconditioner.

Definition at line 70 of file PreconditionerML.cpp.

◆ resetPreconditioner()

void resetPreconditioner ( )
virtual

Reset the preconditioner.

Implements Preconditioner.

Definition at line 102 of file PreconditionerML.cpp.

◆ createParametersList()

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

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 Preconditioner.

Definition at line 117 of file PreconditionerML.hpp.

◆ createMLList()

void createMLList ( list_Type list,
const GetPot dataFile,
const std::string &  section,
const std::string &  subSection = "ML",
const bool &  verbose = true 
)
static

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

Definition at line 114 of file PreconditionerML.cpp.

◆ ApplyInverse()

virtual Int ApplyInverse ( const Epetra_MultiVector vector1,
Epetra_MultiVector vector2 
) const
inlinevirtual

Apply the inverse of the preconditioner on vector1 and store the result in vector2.

Parameters
vector1Vector to which we apply the preconditioner
vector2Vector to the store the result

Reimplemented from Preconditioner.

Definition at line 143 of file PreconditionerML.hpp.

◆ Apply()

virtual Int Apply ( const Epetra_MultiVector vector1,
Epetra_MultiVector vector2 
) const
inlinevirtual

Apply the preconditioner on vector1 and store the result in vector2.

Parameters
vector1Vector to which we apply the preconditioner
vector2Vector to the store the result

Reimplemented from Preconditioner.

Definition at line 153 of file PreconditionerML.hpp.

◆ showMe()

void showMe ( std::ostream &  output = std::cout) const
virtual

Show informations about the preconditioner.

Reimplemented from Preconditioner.

Definition at line 507 of file PreconditionerML.cpp.

◆ setDataFromGetPot()

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

Set the data of the preconditioner using a GetPot object.

Parameters
dataFileA GetPot object containing the data about the preconditioner
sectionThe section in "dataFile" where to find data about the preconditioner

Implements Preconditioner.

Definition at line 516 of file PreconditionerML.cpp.

◆ SetUseTranspose()

Int SetUseTranspose ( bool  useTranspose = false)
inlinevirtual

Set the matrix to be used transposed (or not)

Parameters
useTransposeIf true the preconditioner is transposed

Reimplemented from Preconditioner.

Definition at line 179 of file PreconditionerML.hpp.

◆ setVerticesCoordinates()

void setVerticesCoordinates ( std::shared_ptr< std::vector< Real > >  xCoord,
std::shared_ptr< std::vector< Real > >  yCoord,
std::shared_ptr< std::vector< Real > >  zCoord 
)

Set the coordinate to be used for the visualization of the aggregates.

According to the Trilinos::ML manual one should setup the following variables in ML:

  • viz: enable
  • viz: output format
  • x-coordinates
  • y-coordinates
  • z-coordinates

This is the reason why one has to provide these informations. In order to get an output of the aggregation one has to set the variable /ML/visualization/enable to true in the datafile.

See also
M.W. Gee, C.M. Siefert, J.J. Hu, R.S. Tuminaro and M.G. Sala. ML 5.0 Smoothed Aggregation User's Guide. Sandia National Laboratories, 2006
Parameters
xCoordShared pointer on a vector of the x coordinates of the vertices of the mesh
yCoordShared pointer on a vector of the y coordinates of the vertices of the mesh
zCoordShared pointer on a vector of the z coordinates of the vertices of the mesh

Definition at line 561 of file PreconditionerML.cpp.

◆ condest()

Real condest ( )
virtual

Return An estimation of the condition number of the preconditioner.

Implements Preconditioner.

Definition at line 576 of file PreconditionerML.cpp.

◆ preconditioner()

Preconditioner::prec_raw_type * preconditioner ( )
virtual

Return a raw pointer on the preconditioner.

Implements Preconditioner.

Definition at line 582 of file PreconditionerML.cpp.

◆ preconditionerPtr()

super::prec_type preconditionerPtr ( )
inlinevirtual

Return a shared pointer on the preconditioner.

Implements Preconditioner.

Definition at line 218 of file PreconditionerML.hpp.

◆ preconditionerType()

std::string preconditionerType ( )
inlinevirtual

Return the type of preconditioner.

Implements Preconditioner.

Definition at line 224 of file PreconditionerML.hpp.

◆ UseTranspose()

bool UseTranspose ( )
inlinevirtual

Return true if the preconditioner is transposed.

Reimplemented from Preconditioner.

Definition at line 230 of file PreconditionerML.hpp.

◆ OperatorRangeMap()

const Epetra_Map& OperatorRangeMap ( ) const
inlinevirtual

Return the Range map of the operator.

Reimplemented from Preconditioner.

Definition at line 236 of file PreconditionerML.hpp.

◆ OperatorDomainMap()

const Epetra_Map& OperatorDomainMap ( ) const
inlinevirtual

Return the Domain map of the operator.

Reimplemented from Preconditioner.

Definition at line 242 of file PreconditionerML.hpp.

Field Documentation

◆ M_IfpackSubList

list_Type M_IfpackSubList
protected

Definition at line 251 of file PreconditionerML.hpp.

◆ M_comm

std::shared_ptr<Epetra_Comm> M_comm
protected

Definition at line 252 of file PreconditionerML.hpp.

◆ M_operator

operator_type M_operator
private

Definition at line 256 of file PreconditionerML.hpp.

◆ M_preconditioner

prec_type M_preconditioner
private

Definition at line 258 of file PreconditionerML.hpp.

◆ M_analyze

bool M_analyze
private

Definition at line 260 of file PreconditionerML.hpp.

◆ M_visualizationDataAvailable

bool M_visualizationDataAvailable
private

Definition at line 262 of file PreconditionerML.hpp.

◆ M_xCoord

std::shared_ptr<std::vector<Real> > M_xCoord
private

Definition at line 263 of file PreconditionerML.hpp.

◆ M_yCoord

std::shared_ptr<std::vector<Real> > M_yCoord
private

Definition at line 264 of file PreconditionerML.hpp.

◆ M_zCoord

std::shared_ptr<std::vector<Real> > M_zCoord
private

Definition at line 265 of file PreconditionerML.hpp.


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