Thyra::LinearSolverBuilderBase for creating LinearOpWithSolveFactoryBase objects and PreconditionerFactoryBase object on demand for various Trilinos linear solver packages.
More...
#include <Thyra_DefaultRealLinearSolverBuilder.hpp>
Inheritance diagram for Thyra::DefaultRealLinearSolverBuilder:
Constructors/Initializers/Accessors | |
| DefaultRealLinearSolverBuilder (const std::string ¶msXmlFileName="", const std::string &extraParamsXmlString="", const std::string ¶msUsedXmlOutFileName="", const std::string ¶msXmlFileNameOption="linear-solver-params-file", const std::string &extraParamsXmlStringOption="extra-linear-solver-params", const std::string ¶msUsedXmlOutFileNameOption="linear-solver-params-used-file") | |
| Construct with default parameters. | |
| ~DefaultRealLinearSolverBuilder () | |
| | |
| void | paramsXmlFileName (const std::string ¶msXmlFileName) |
| The name an XML file that will be read to get XML parameters (if not ""). | |
| void | extraParamsXmlString (const std::string &extraParamsXmlString) |
| An XML string that will be used to update the parameters (if not ""). | |
| void | paramsUsedXmlOutFileName (const std::string ¶msUsedXmlOutFileName) |
| The name of an XML file that will be written (if not "") for the parameters actually used. | |
| void | paramsXmlFileNameOption (const std::string ¶msXmlFileNameOption) |
The name of the option that will be added the the commandline processor that will set paramsXmlFileName() . | |
| void | extraParamsXmlStringOption (const std::string &extraParamsXmlStringOption) |
The name of the option that will be added the the commandline processor that will set extraParamsXmlString() . | |
| void | paramsUsedXmlOutFileNameOption (const std::string ¶msUsedXmlOutFileNameOption) |
The name of the option that will be added the the commandline processor that will set paramsUsedXmlOutFileName() . | |
| void | setLinearSolveStrategyFactory (const Teuchos::RefCountPtr< const Teuchos::AbstractFactory< LinearOpWithSolveFactoryBase< double > > > &solveStrategyFactory, const std::string &solveStrategyName) |
| Set a new linear solver strategy factory object. | |
| void | setPreconditioningStrategyFactory (const Teuchos::RefCountPtr< const Teuchos::AbstractFactory< PreconditionerFactoryBase< double > > > &precStrategyFactory, const std::string &precStrategyName) |
| Set a new preconditioner strategy factory object. | |
| void | setupCLP (Teuchos::CommandLineProcessor *clp) |
| Setup the command-line processor to read in the needed data to extra the parameters from. | |
| void | readParameters (std::ostream *out) |
| Force the parameters to be read from a file and/or an extra XML string. | |
| void | writeParamsFile (const LinearOpWithSolveFactoryBase< double > &lowsFactory, const std::string &outputXmlFileName="") const |
Write the parameters list for a LinearOpWithSolveFactoryBase object to a file after the parameters are read in order to show defaults and create a new list for input the next time. | |
| std::string | getLinearSolveStrategyName () const |
Get the name of the linear solver strategy that will be created on the next call to this->createLinearSolverStrategy(). | |
| std::string | getPreconditionerStrategyName () const |
Get the name of the preconditioner strategy that will be created on the next call to this->createPreconditioningStrategy(). | |
Overridden from ParameterListAcceptor | |
| void | setParameterList (Teuchos::RefCountPtr< Teuchos::ParameterList > const ¶mList) |
| | |
| Teuchos::RefCountPtr< Teuchos::ParameterList > | getParameterList () |
| | |
| Teuchos::RefCountPtr< Teuchos::ParameterList > | unsetParameterList () |
| | |
| Teuchos::RefCountPtr< const Teuchos::ParameterList > | getParameterList () const |
| | |
| Teuchos::RefCountPtr< const Teuchos::ParameterList > | getValidParameters () const |
| | |
Overridden from LinearSolverBuilderBase. | |
| Teuchos::RefCountPtr< LinearOpWithSolveFactoryBase< double > > | createLinearSolveStrategy (const std::string &linearSolveStrategyName) const |
| | |
| Teuchos::RefCountPtr< PreconditionerFactoryBase< double > > | createPreconditioningStrategy (const std::string &preconditioningStrategyName) const |
| | |
Thyra::LinearSolverBuilderBase for creating LinearOpWithSolveFactoryBase objects and PreconditionerFactoryBase object on demand for various Trilinos linear solver packages.
The parameters this class accepts are shown below in human readable format and in XML (i.e. machine readable) format.
Human readable format for valid parameters (with default values) accepted by this class
Linear Solver Type : string = Amesos
Preconditioner Type : string = ML
Linear Solver Types ->
Amesos ->
Refactorization Policy : string = RepivotOnRefactorization
Solver Type : string = Klu
Throw on Preconditioner Input : bool = 1
Amesos Settings ->
AddToDiag : double = 0
AddZeroToDiag : bool = 0
ComputeTrueResidual : bool = 0
ComputeVectorNorms : bool = 0
DebugLevel : int = 0
MatrixProperty : string = general
MaxProcs : int = -1
NoDestroy : bool = 0
OutputLevel : int = 1
PrintTiming : bool = 0
RcondThreshold : double = 1e-12
Redistribute : bool = 0
Refactorize : bool = 0
Reindex : int = 0
ScaleMethod : int = 0
TrustMe : bool = 0
Lapack ->
[empty list]
Mumps ->
[empty list]
Pardiso ->
[empty list]
Scalapack ->
[empty list]
Superludist ->
[empty list]
AztecOO ->
Output Every RHS : bool = 0
Adjoint Solve ->
Max Iterations : int = 400
Tolerance : double = 1e-06
AztecOO Settings ->
Aztec Preconditioner : string = ilu
Aztec Solver : string = GMRES
Convergence Test : string = r0
Drop Tolerance : double = 0
Fill Factor : double = 1
Graph Fill : int = 0
Ill-Conditioning Threshold : double = 1e+11
Orthogonalization : string = Classical
Output Frequency : int = 0
Overlap : int = 0
Polynomial Order : int = 3
RCM Reordering : string = Disabled
Size of Krylov Subspace : int = 300
Steps : int = 3
Forward Solve ->
Max Iterations : int = 400
Tolerance : double = 1e-06
AztecOO Settings ->
Aztec Preconditioner : string = ilu
Aztec Solver : string = GMRES
Convergence Test : string = r0
Drop Tolerance : double = 0
Fill Factor : double = 1
Graph Fill : int = 0
Ill-Conditioning Threshold : double = 1e+11
Orthogonalization : string = Classical
Output Frequency : int = 0
Overlap : int = 0
Polynomial Order : int = 3
RCM Reordering : string = Disabled
Size of Krylov Subspace : int = 300
Steps : int = 3
Preconditioner Types ->
Ifpack ->
Overlap : int = 0
Prec Type : string = ILU
Ifpack Settings ->
amesos: solver type : string = Amesos_Klu
fact: absolute threshold : double = 0
fact: drop tolerance : double = 0
fact: ict level-of-fill : double = 1
fact: ilut level-of-fill : double = 1
fact: level-of-fill : int = 0
fact: relative threshold : double = 1
fact: relax value : double = 0
fact: sparskit: alph : double = 0
fact: sparskit: droptol : double = 0
fact: sparskit: lfil : int = 0
fact: sparskit: mbloc : int = -1
fact: sparskit: permtol : double = 0.1
fact: sparskit: tol : double = 0
fact: sparskit: type : string = ILUT
partitioner: local parts : int = 1
partitioner: overlap : int = 0
partitioner: print level : int = 0
partitioner: type : string = greedy
partitioner: use symmetric graph : bool = 1
relaxation: damping factor : double = 1
relaxation: min diagonal value : double = 1
relaxation: sweeps : int = 1
relaxation: type : string = Jacobi
relaxation: zero starting solution : bool = 1
schwarz: combine mode : string = Zero
schwarz: compute condest : bool = 1
schwarz: filter singletons : bool = 0
schwarz: reordering type : string = none
ML ->
PDE equations : int = 1
aggregation: damping factor : double = 1.333
aggregation: local aggregates : int = 128
aggregation: threshold : double = 0
aggregation: type : string = METIS
coarse: max size : int = 128
coarse: type : string = Amesos-KLU
default values : string = DD
increasing or decreasing : string = increasing
max levels : int = 2
output : int = 8
prec type : string = MGV
print unused : int = -2
smoother: Aztec as solver : bool = 0
smoother: Aztec options : int* = 0x84f8098
smoother: Aztec params : double* = 0x84f8158
smoother: damping factor : double = 0.67
smoother: pre or post : string = both
smoother: sweeps : int = 2
smoother: type : string = Aztec
XML format for valid parameters (with default values) accepted by this class
<ParameterList>
<Parameter name="Linear Solver Type" type="string" value="Amesos"/>
<ParameterList name="Linear Solver Types">
<ParameterList name="Amesos">
<ParameterList name="Amesos Settings">
<Parameter name="AddToDiag" type="double" value="0"/>
<Parameter name="AddZeroToDiag" type="bool" value="0"/>
<Parameter name="ComputeTrueResidual" type="bool" value="0"/>
<Parameter name="ComputeVectorNorms" type="bool" value="0"/>
<Parameter name="DebugLevel" type="int" value="0"/>
<ParameterList name="Lapack"/>
<Parameter name="MatrixProperty" type="string" value="general"/>
<Parameter name="MaxProcs" type="int" value="-1"/>
<ParameterList name="Mumps"/>
<Parameter name="NoDestroy" type="bool" value="0"/>
<Parameter name="OutputLevel" type="int" value="1"/>
<ParameterList name="Pardiso"/>
<Parameter name="PrintTiming" type="bool" value="0"/>
<Parameter name="RcondThreshold" type="double" value="1e-12"/>
<Parameter name="Redistribute" type="bool" value="0"/>
<Parameter name="Refactorize" type="bool" value="0"/>
<Parameter name="Reindex" type="int" value="0"/>
<ParameterList name="Scalapack"/>
<Parameter name="ScaleMethod" type="int" value="0"/>
<ParameterList name="Superludist"/>
<Parameter name="TrustMe" type="bool" value="0"/>
</ParameterList>
<Parameter name="Refactorization Policy" type="string" value="RepivotOnRefactorization"/>
<Parameter name="Solver Type" type="string" value="Klu"/>
<Parameter name="Throw on Preconditioner Input" type="bool" value="1"/>
</ParameterList>
<ParameterList name="AztecOO">
<ParameterList name="Adjoint Solve">
<ParameterList name="AztecOO Settings">
<Parameter name="Aztec Preconditioner" type="string" value="ilu"/>
<Parameter name="Aztec Solver" type="string" value="GMRES"/>
<Parameter name="Convergence Test" type="string" value="r0"/>
<Parameter name="Drop Tolerance" type="double" value="0"/>
<Parameter name="Fill Factor" type="double" value="1"/>
<Parameter name="Graph Fill" type="int" value="0"/>
<Parameter name="Ill-Conditioning Threshold" type="double" value="1e+11"/>
<Parameter name="Orthogonalization" type="string" value="Classical"/>
<Parameter name="Output Frequency" type="int" value="0"/>
<Parameter name="Overlap" type="int" value="0"/>
<Parameter name="Polynomial Order" type="int" value="3"/>
<Parameter name="RCM Reordering" type="string" value="Disabled"/>
<Parameter name="Size of Krylov Subspace" type="int" value="300"/>
<Parameter name="Steps" type="int" value="3"/>
</ParameterList>
<Parameter name="Max Iterations" type="int" value="400"/>
<Parameter name="Tolerance" type="double" value="1e-06"/>
</ParameterList>
<ParameterList name="Forward Solve">
<ParameterList name="AztecOO Settings">
<Parameter name="Aztec Preconditioner" type="string" value="ilu"/>
<Parameter name="Aztec Solver" type="string" value="GMRES"/>
<Parameter name="Convergence Test" type="string" value="r0"/>
<Parameter name="Drop Tolerance" type="double" value="0"/>
<Parameter name="Fill Factor" type="double" value="1"/>
<Parameter name="Graph Fill" type="int" value="0"/>
<Parameter name="Ill-Conditioning Threshold" type="double" value="1e+11"/>
<Parameter name="Orthogonalization" type="string" value="Classical"/>
<Parameter name="Output Frequency" type="int" value="0"/>
<Parameter name="Overlap" type="int" value="0"/>
<Parameter name="Polynomial Order" type="int" value="3"/>
<Parameter name="RCM Reordering" type="string" value="Disabled"/>
<Parameter name="Size of Krylov Subspace" type="int" value="300"/>
<Parameter name="Steps" type="int" value="3"/>
</ParameterList>
<Parameter name="Max Iterations" type="int" value="400"/>
<Parameter name="Tolerance" type="double" value="1e-06"/>
</ParameterList>
<Parameter name="Output Every RHS" type="bool" value="0"/>
</ParameterList>
</ParameterList>
<Parameter name="Preconditioner Type" type="string" value="ML"/>
<ParameterList name="Preconditioner Types">
<ParameterList name="Ifpack">
<ParameterList name="Ifpack Settings">
<Parameter name="amesos: solver type" type="string" value="Amesos_Klu"/>
<Parameter name="fact: absolute threshold" type="double" value="0"/>
<Parameter name="fact: drop tolerance" type="double" value="0"/>
<Parameter name="fact: ict level-of-fill" type="double" value="1"/>
<Parameter name="fact: ilut level-of-fill" type="double" value="1"/>
<Parameter name="fact: level-of-fill" type="int" value="0"/>
<Parameter name="fact: relative threshold" type="double" value="1"/>
<Parameter name="fact: relax value" type="double" value="0"/>
<Parameter name="fact: sparskit: alph" type="double" value="0"/>
<Parameter name="fact: sparskit: droptol" type="double" value="0"/>
<Parameter name="fact: sparskit: lfil" type="int" value="0"/>
<Parameter name="fact: sparskit: mbloc" type="int" value="-1"/>
<Parameter name="fact: sparskit: permtol" type="double" value="0.1"/>
<Parameter name="fact: sparskit: tol" type="double" value="0"/>
<Parameter name="fact: sparskit: type" type="string" value="ILUT"/>
<Parameter name="partitioner: local parts" type="int" value="1"/>
<Parameter name="partitioner: overlap" type="int" value="0"/>
<Parameter name="partitioner: print level" type="int" value="0"/>
<Parameter name="partitioner: type" type="string" value="greedy"/>
<Parameter name="partitioner: use symmetric graph" type="bool" value="1"/>
<Parameter name="relaxation: damping factor" type="double" value="1"/>
<Parameter name="relaxation: min diagonal value" type="double" value="1"/>
<Parameter name="relaxation: sweeps" type="int" value="1"/>
<Parameter name="relaxation: type" type="string" value="Jacobi"/>
<Parameter name="relaxation: zero starting solution" type="bool" value="1"/>
<Parameter name="schwarz: combine mode" type="string" value="Zero"/>
<Parameter name="schwarz: compute condest" type="bool" value="1"/>
<Parameter name="schwarz: filter singletons" type="bool" value="0"/>
<Parameter name="schwarz: reordering type" type="string" value="none"/>
</ParameterList>
<Parameter name="Overlap" type="int" value="0"/>
<Parameter name="Prec Type" type="string" value="ILU"/>
</ParameterList>
<ParameterList name="ML">
<Parameter name="PDE equations" type="int" value="1"/>
<Parameter name="aggregation: damping factor" type="double" value="1.333"/>
<Parameter name="aggregation: local aggregates" type="int" value="128"/>
<Parameter name="aggregation: threshold" type="double" value="0"/>
<Parameter name="aggregation: type" type="string" value="METIS"/>
<Parameter name="coarse: max size" type="int" value="128"/>
<Parameter name="coarse: type" type="string" value="Amesos-KLU"/>
<Parameter name="default values" type="string" value="DD"/>
<Parameter name="increasing or decreasing" type="string" value="increasing"/>
<Parameter name="max levels" type="int" value="2"/>
<Parameter name="output" type="int" value="8"/>
<Parameter name="prec type" type="string" value="MGV"/>
<Parameter name="print unused" type="int" value="-2"/>
<Parameter name="smoother: Aztec as solver" type="bool" value="0"/>
<Parameter name="smoother: Aztec options" type="any" value="0x84f8098 [unused]"/>
<Parameter name="smoother: Aztec params" type="any" value="0x84f8158 [unused]"/>
<Parameter name="smoother: damping factor" type="double" value="0.67"/>
<Parameter name="smoother: pre or post" type="string" value="both"/>
<Parameter name="smoother: sweeps" type="int" value="2"/>
<Parameter name="smoother: type" type="string" value="Aztec"/>
</ParameterList>
</ParameterList>
</ParameterList>
For an example of how to use this class see simple_stratimikos_example.cpp.
simple_stratimikos_example.cpp, and test_single_stratimikos_solver.cpp.
Definition at line 61 of file Thyra_DefaultRealLinearSolverBuilder.hpp.
|
||||||||||||||||||||||||||||
|
Construct with default parameters.
Warning! Do not change the defaults by passing then into this constructor. Instead, use the member functions to set them after Definition at line 66 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Definition at line 84 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
The name an XML file that will be read to get XML parameters (if not "").
Definition at line 90 of file Thyra_DefaultRealLinearSolverBuilder.hpp. |
|
|
An XML string that will be used to update the parameters (if not "").
Definition at line 95 of file Thyra_DefaultRealLinearSolverBuilder.hpp. |
|
|
The name of an XML file that will be written (if not "") for the parameters actually used.
Definition at line 100 of file Thyra_DefaultRealLinearSolverBuilder.hpp. |
|
|
The name of the option that will be added the the commandline processor that will set
Definition at line 105 of file Thyra_DefaultRealLinearSolverBuilder.hpp. |
|
|
The name of the option that will be added the the commandline processor that will set
Definition at line 110 of file Thyra_DefaultRealLinearSolverBuilder.hpp. |
|
|
The name of the option that will be added the the commandline processor that will set
Definition at line 115 of file Thyra_DefaultRealLinearSolverBuilder.hpp. |
|
||||||||||||
|
Set a new linear solver strategy factory object.
Definition at line 93 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
||||||||||||
|
Set a new preconditioner strategy factory object.
Definition at line 104 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Setup the command-line processor to read in the needed data to extra the parameters from.
Command-line options with names
Then, when
After this function is called,
Definition at line 115 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Force the parameters to be read from a file and/or an extra XML string.
First, if
Second, if
Third, if Postconditions:
Definition at line 132 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
||||||||||||
|
Write the parameters list for a
If
Definition at line 146 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Get the name of the linear solver strategy that will be created on the next call to
Definition at line 160 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Get the name of the preconditioner strategy that will be created on the next call to
Definition at line 167 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Implements Teuchos::ParameterListAcceptor. Definition at line 176 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Implements Teuchos::ParameterListAcceptor. Definition at line 187 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Implements Teuchos::ParameterListAcceptor. Definition at line 193 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Reimplemented from Teuchos::ParameterListAcceptor. Definition at line 201 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Reimplemented from Teuchos::ParameterListAcceptor.
Definition at line 207 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Implements Thyra::LinearSolverBuilderBase< double >.
Definition at line 252 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
|
|
Implements Thyra::LinearSolverBuilderBase< double >. Definition at line 298 of file Thyra_DefaultRealLinearSolverBuilder.cpp. |
1.3.9.1