LifeV
PreconditionerLinearSolver Class Reference

PreconditionerLinearSolver - Class to wrap linear solver. More...

#include <PreconditionerLinearSolver.hpp>

+ Inheritance diagram for PreconditionerLinearSolver:
+ Collaboration diagram for PreconditionerLinearSolver:

Private Attributes

solverPtr_Type M_solver
 
preconditionerPtr_Type M_preconditioner
 
GetPot M_dataFile
 
bool M_printSubiterationCount
 
std::string M_precName
 
std::string M_precDataSection
 

Public Types

typedef Epetra_Operator prec_raw_type
 
typedef std::shared_ptr< prec_raw_typeprec_type
 
typedef LinearSolver solver_Type
 
typedef std::shared_ptr< solver_TypesolverPtr_Type
 
typedef MatrixEpetra< Realoperator_raw_type
 
typedef std::shared_ptr< operator_raw_typeoperator_type
 
typedef Preconditioner preconditioner_Type
 
typedef std::shared_ptr< preconditioner_TypepreconditionerPtr_Type
 
typedef Displayer::comm_Type comm_Type
 
typedef Displayer::commPtr_Type commPtr_Type
 
typedef Teuchos::ParameterList list_Type
 

Constructors & Destructor

 PreconditionerLinearSolver (std::shared_ptr< Epetra_Comm > comm=std::shared_ptr< Epetra_Comm >(new Epetra_MpiComm(MPI_COMM_WORLD)))
 Default constructor. More...
 
virtual ~PreconditionerLinearSolver ()
 Destructor. More...
 

Methods

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 buildPreconditioner (operator_type &matrix)
 Build a preconditioner based on the given matrix. More...
 
virtual void resetPreconditioner ()
 Reset the preconditioner. More...
 
virtual Real condest ()
 Return An estimation of the condition number of the preconditioner. More...
 
virtual void showMe (std::ostream &output=std::cout) const
 Show informations about the preconditioner. More...
 
static void createLinearSolverList (list_Type &list, const GetPot &dataFile, const std::string &section, const std::string &subSection="SolverLinear", const bool &verbose=true)
 Create the list of parameters of the preconditioner. More...
 

Epetra Operator Interface Methods

Int SetUseTranspose (const bool useTranspose=false)
 Set the matrix to be used transposed (or not) More...
 
bool UseTranspose ()
 Return true if the preconditioner is transposed. More...
 
Int Apply (const Epetra_MultiVector &vector1, Epetra_MultiVector &vector2) const
 Apply the inverse of the preconditioner on vector1 and store the result in vector2. More...
 
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...
 
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...
 

Set Methods

void setDataFromGetPot (const GetPot &dataFile, const std::string &section)
 Set the data of the preconditioner using a GetPot object. More...
 
void setSolver (SolverAztecOO &)
 Set the internal solver. More...
 

Get Methods

bool isPreconditionerSet () const
 Return true if the preconditioner is set. More...
 
prec_raw_typepreconditioner ()
 Return a raw pointer on the preconditioner. More...
 
prec_type preconditionerPtr ()
 Return a shared pointer on the preconditioner. More...
 
solverPtr_Type solverPtr ()
 Return a shared pointer on the solver. More...
 
std::string preconditionerType ()
 Return the type of preconditioner. 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...
 
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 Attributes inherited from Preconditioner
std::string M_precType
 
Displayer M_displayer
 
list_Type M_list
 
bool M_preconditionerCreated
 

Detailed Description

PreconditionerLinearSolver - Class to wrap linear solver.

Author
Gwenol Grandperrin gweno.nosp@m.l.gr.nosp@m.andpe.nosp@m.rrin.nosp@m.@epfl.nosp@m..ch

Definition at line 63 of file PreconditionerLinearSolver.hpp.

Member Typedef Documentation

◆ prec_raw_type

Definition at line 71 of file PreconditionerLinearSolver.hpp.

◆ prec_type

typedef std::shared_ptr<prec_raw_type> prec_type

Definition at line 72 of file PreconditionerLinearSolver.hpp.

◆ solver_Type

Definition at line 74 of file PreconditionerLinearSolver.hpp.

◆ solverPtr_Type

typedef std::shared_ptr<solver_Type> solverPtr_Type

Definition at line 75 of file PreconditionerLinearSolver.hpp.

◆ operator_raw_type

◆ operator_type

typedef std::shared_ptr<operator_raw_type> operator_type

Definition at line 78 of file PreconditionerLinearSolver.hpp.

◆ preconditioner_Type

◆ preconditionerPtr_Type

typedef std::shared_ptr<preconditioner_Type> preconditionerPtr_Type

Definition at line 81 of file PreconditionerLinearSolver.hpp.

◆ comm_Type

Definition at line 83 of file PreconditionerLinearSolver.hpp.

◆ commPtr_Type

◆ list_Type

typedef Teuchos::ParameterList list_Type

Definition at line 86 of file PreconditionerLinearSolver.hpp.

Constructor & Destructor Documentation

◆ PreconditionerLinearSolver()

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

Default constructor.

Parameters
commThe communicator.

Definition at line 48 of file PreconditionerLinearSolver.cpp.

◆ ~PreconditionerLinearSolver()

Destructor.

Definition at line 57 of file PreconditionerLinearSolver.cpp.

Member Function Documentation

◆ createParametersList()

void createParametersList ( list_Type list,
const GetPot dataFile,
const std::string &  section,
const std::string &  subSection 
)
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 Preconditioner.

Definition at line 68 of file PreconditionerLinearSolver.cpp.

◆ createLinearSolverList()

void createLinearSolverList ( list_Type list,
const GetPot dataFile,
const std::string &  section,
const std::string &  subSection = "SolverLinear",
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 77 of file PreconditionerLinearSolver.cpp.

◆ 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 99 of file PreconditionerLinearSolver.cpp.

◆ resetPreconditioner()

void resetPreconditioner ( )
virtual

Reset the preconditioner.

Implements Preconditioner.

Definition at line 121 of file PreconditionerLinearSolver.cpp.

◆ condest()

Real condest ( )
virtual

Return An estimation of the condition number of the preconditioner.

Implements Preconditioner.

Definition at line 128 of file PreconditionerLinearSolver.cpp.

◆ showMe()

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

Show informations about the preconditioner.

Reimplemented from Preconditioner.

Definition at line 134 of file PreconditionerLinearSolver.cpp.

◆ SetUseTranspose()

Int SetUseTranspose ( const bool  useTranspose = false)
virtual

Set the matrix to be used transposed (or not)

Parameters
useTransposeIf true the preconditioner is transposed

Reimplemented from Preconditioner.

Definition at line 143 of file PreconditionerLinearSolver.cpp.

◆ UseTranspose()

bool UseTranspose ( )
virtual

Return true if the preconditioner is transposed.

Reimplemented from Preconditioner.

Definition at line 149 of file PreconditionerLinearSolver.cpp.

◆ Apply()

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

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 155 of file PreconditionerLinearSolver.cpp.

◆ ApplyInverse()

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

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 161 of file PreconditionerLinearSolver.cpp.

◆ OperatorRangeMap()

const Epetra_Map & OperatorRangeMap ( ) const
virtual

Return the Range map of the operator.

Reimplemented from Preconditioner.

Definition at line 175 of file PreconditionerLinearSolver.cpp.

◆ OperatorDomainMap()

const Epetra_Map & OperatorDomainMap ( ) const
virtual

Return the Domain map of the operator.

Reimplemented from Preconditioner.

Definition at line 181 of file PreconditionerLinearSolver.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 190 of file PreconditionerLinearSolver.cpp.

◆ setSolver()

void setSolver ( SolverAztecOO )
virtual

Set the internal solver.

Note: the argument is unused

Parameters
solverSolverAztecOO

Reimplemented from Preconditioner.

Definition at line 200 of file PreconditionerLinearSolver.cpp.

◆ isPreconditionerSet()

bool isPreconditionerSet ( ) const

Return true if the preconditioner is set.

Definition at line 210 of file PreconditionerLinearSolver.cpp.

◆ preconditioner()

PreconditionerLinearSolver::prec_raw_type * preconditioner ( )
virtual

Return a raw pointer on the preconditioner.

Implements Preconditioner.

Definition at line 216 of file PreconditionerLinearSolver.cpp.

◆ preconditionerPtr()

PreconditionerLinearSolver::prec_type preconditionerPtr ( )
virtual

Return a shared pointer on the preconditioner.

Implements Preconditioner.

Definition at line 222 of file PreconditionerLinearSolver.cpp.

◆ solverPtr()

Return a shared pointer on the solver.

Definition at line 228 of file PreconditionerLinearSolver.cpp.

◆ preconditionerType()

std::string preconditionerType ( )
virtual

Return the type of preconditioner.

Implements Preconditioner.

Definition at line 234 of file PreconditionerLinearSolver.cpp.

Field Documentation

◆ M_solver

solverPtr_Type M_solver
private

Definition at line 232 of file PreconditionerLinearSolver.hpp.

◆ M_preconditioner

preconditionerPtr_Type M_preconditioner
private

Definition at line 233 of file PreconditionerLinearSolver.hpp.

◆ M_dataFile

GetPot M_dataFile
private

Definition at line 234 of file PreconditionerLinearSolver.hpp.

◆ M_printSubiterationCount

bool M_printSubiterationCount
private

Definition at line 236 of file PreconditionerLinearSolver.hpp.

◆ M_precName

std::string M_precName
private

Definition at line 237 of file PreconditionerLinearSolver.hpp.

◆ M_precDataSection

std::string M_precDataSection
private

Definition at line 238 of file PreconditionerLinearSolver.hpp.


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