#include <Ifpack.h>
Public Types | |
| enum | parameter { absolute_threshold, relative_threshold, drop_tolerance, fill_tolerance, relax_value, level_fill, level_overlap, num_steps, use_reciprocal, overlap_mode } |
| enum | EPrecType { POINT_RELAXATION, POINT_RELAXATION_STAND_ALONE, BLOCK_RELAXATION, BLOCK_RELAXATION_STAND_ALONE, BLOCK_RELAXATION_STAND_ALONE_ILU, BLOCK_RELAXATION_STAND_ALONE_AMESOS, BLOCK_RELAXATION_AMESOS, AMESOS, AMESOS_STAND_ALONE, IC, IC_STAND_ALONE, ICT, ICT_STAND_ALONE, ILU, ILU_STAND_ALONE, ILUT, ILUT_STAND_ALONE, CHEBYSHEV } |
| Enum for the type of preconditioner. | |
Public Member Functions | |
| Ifpack_Preconditioner * | Create (const string PrecType, Epetra_RowMatrix *Matrix, const int overlap=0) |
| Creates an instance of Ifpack_Preconditioner given the string name of the preconditioner type (can fail with bad input). | |
| int | SetParameters (int argc, char *argv[], Teuchos::ParameterList &List, string &PrecType, int &Overlap) |
| Sets the options in List from the command line. | |
Static Public Member Functions | |
| const char * | toString (const EPrecType precType) |
| Function that gives the string name for preconditioner given its enumerication value. | |
| Ifpack_Preconditioner * | Create (EPrecType PrecType, Epetra_RowMatrix *Matrix, const int overlap=0) |
| Creates an instance of Ifpack_Preconditioner given the enum value of the preconditioner type (can not fail, no bad input possible). | |
Static Public Attributes | |
| const int | numPrecTypes |
| | |
| const EPrecType | precTypeValues [numPrecTypes] |
| List of the preconditioner types as enum values . | |
| const char * | precTypeNames [numPrecTypes] |
| List of preconditioner types as string values. | |
| const bool | supportsUnsymmetric [numPrecTypes] |
| List of bools that determines if the precondtioner type supports unsymmetric matrices. | |
Class Ifpack is a function class, that contains just one method: Create(). Using Create(), users can easily define a variety of IFPACK preconditioners.
Create requires 3 arguments:
The first argument can assume the following values:
"point relaxation" : returns an instance of Ifpack_AdditiveSchwarz<Ifpack_PointRelaxation>"point relaxation stand-alone" : returns an instance of Ifpack_PointRelaxation (value of overlap is ignored)."block relaxation" : returns an instance of Ifpack_AdditiveSchwarz<Ifpack_BlockRelaxation>"block relaxation stand-alone)" : returns an instance of Ifpack_BlockRelaxation."Amesos" : returns an instance of Ifpack_AdditiveSchwarz<Ifpack_Amesos>."Amesos" : returns an instance of Ifpack_Amesos."IC" : returns an instance of Ifpack_AdditiveSchwarz<Ifpack_IC>."IC stand-alone" : returns an instance of Ifpack_AdditiveSchwarz<Ifpack_IC>."ICT" : returns an instance of Ifpack_AdditiveSchwarz<Ifpack_ICT>."ICT stand-alone" : returns an instance of Ifpack_ICT."ILU" : returns an instance of Ifpack_AdditiveSchwarz<Ifpack_ILU>."ILU stand-alone" : returns an instance of Ifpack_ILU."ILUT" : returns an instance of Ifpack_AdditiveSchwarz<Ifpack_ILUT>."ILUT stand-alone" : returns an instance of Ifpack_ILUT.
The following fragment of code shows the basic usage of this class.
#include "Ifpack.h" ... Ifpack Factory; Epetra_RowMatrix* A; // A is FillComplete()'d. string PrecType = "ILU"; // use incomplete LU on each process int OverlapLevel = 1; // one row of overlap among the processes Ifpack_Preconditioner* Prec = Factory.Create(PrecType, A, OverlapLevel); assert (Prec != 0); Teuchos::ParameterList List; List.set("fact: level-of-fill", 5); // use ILU(5) IFPACK_CHK_ERR(Prec->SetParameters(List)); IFPACK_CHK_ERR(Prec->Initialize()); IFPACK_CHK_ERR(Prec->Compute()); // now Prec can be used as AztecOO preconditioner // like for instance AztecOO AztecOOSolver(*Problem); // specify solver AztecOOSolver.SetAztecOption(AZ_solver,AZ_gmres); AztecOOSolver.SetAztecOption(AZ_output,32); // Set Prec as preconditioning operator AztecOOSolver.SetPrecOperator(Prec); // Call the solver AztecOOSolver.Iterate(1550,1e-8); // print information on stdout cout << *Prec; // delete the preconditioner delete Prec;
|
||||||||||||||||
|
Creates an instance of Ifpack_Preconditioner given the string name of the preconditioner type (can fail with bad input).
0 if the preconditioner with that input name does not exist. Otherwise, return a newly created preconditioner object. Note that the client is responsible for calling delete on the returned object once it is finished using it! |
|
||||||||||||||||
|
Creates an instance of Ifpack_Preconditioner given the enum value of the preconditioner type (can not fail, no bad input possible).
|
|
||||||||||||||||||||||||
|
Sets the options in List from the command line.
Note: If you want full support for all parameters, consider reading in a parameter list from an XML file as supported by the Teuchos helper function |
|
|
Initial value:
+5
+4
+8
+1
|
|
|
Initial value:
{
"point relaxation"
,"point relaxation stand-alone"
,"block relaxation"
,"block relaxation stand-alone"
,"block relaxation stand-alone (ILU)"
,"block relaxation stand-alone (Amesos)"
,"block relaxation (Amesos)"
,"Amesos"
,"Amesos stand-alone"
,"IC"
,"IC stand-alone"
,"ICT"
,"ICT stand-alone"
,"ILU"
,"ILU stand-alone"
,"ILUT"
,"ILUT stand-alone"
,"Chebyshev"
}
|
|
|
Initial value:
{
POINT_RELAXATION
,POINT_RELAXATION_STAND_ALONE
,BLOCK_RELAXATION
,BLOCK_RELAXATION_STAND_ALONE
,BLOCK_RELAXATION_STAND_ALONE_ILU
,BLOCK_RELAXATION_STAND_ALONE_AMESOS
,BLOCK_RELAXATION_AMESOS
,AMESOS
,AMESOS_STAND_ALONE
,IC
,IC_STAND_ALONE
,ICT
,ICT_STAND_ALONE
,ILU
,ILU_STAND_ALONE
,ILUT
,ILUT_STAND_ALONE
,CHEBYSHEV
}
|
|
|
Initial value:
{
true
,true
,true
,true
,true
,true
,true
,true
,true
,false
,false
,false
,false
,true
,true
,true
,true
,false
}
|
1.3.9.1