#include <KrylovSolverOptions.hpp>


Public Types | |
| enum | Type { conjugateGradient, biConjugateGradient, biConjugateGradientStabilized, fgmres, gmres, iterativeLUFactorization } |
| enum | PreconditionerType { diagonal, incompleteCholeski, multiGrid, spectralFEM, none } |
Public Member Functions | |
| Type | type () |
| PreconditionerType | precond () |
| KrylovSolverOptions () | |
| ~KrylovSolverOptions () | |
| void | get (IdentifierSet &I) |
| const ReferenceCounting < Parameter > | get (const char *parameterName) const |
| void | reset () |
Static Public Member Functions | |
| static const char * | identifier () |
Protected Member Functions | |
| template<typename EnumType> | |
| void | get (const char *label, EnumType &e) const |
| void | get (const char *label, real_t &d) const |
| void | get (const char *label, int &i) const |
| void | get (const char *label, std::string &s) const |
| void | add (ReferenceCounting< Parameter > p) |
Private Member Functions | |
| std::ostream & | put (std::ostream &os) const |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const ParametrizableObject &P) |
| Writes the ParametrizableObject. | |
Definition at line 25 of file KrylovSolverOptions.hpp.
| conjugateGradient | |
| biConjugateGradient | |
| biConjugateGradientStabilized | |
| fgmres | |
| gmres | |
| iterativeLUFactorization |
Definition at line 36 of file KrylovSolverOptions.hpp.
00036 { 00037 conjugateGradient, 00038 biConjugateGradient, 00039 biConjugateGradientStabilized, 00040 fgmres, 00041 gmres, 00042 iterativeLUFactorization 00043 };
Definition at line 45 of file KrylovSolverOptions.hpp.
00045 { 00046 diagonal, 00047 incompleteCholeski, 00048 multiGrid, 00049 spectralFEM, 00050 none 00051 };
| KrylovSolverOptions::KrylovSolverOptions | ( | ) | [inline, explicit] |
Definition at line 73 of file KrylovSolverOptions.hpp.
References biConjugateGradient, biConjugateGradientStabilized, conjugateGradient, diagonal, fgmres, gmres, incompleteCholeski, iterativeLUFactorization, multiGrid, none, and spectralFEM.
00074 { 00075 // autodoc:"is used to select the type of solver" 00076 EnumParameter<Type>* E1 00077 = new EnumParameter<Type>(KrylovSolverOptions:: 00078 conjugateGradient,"type"); 00079 00080 // autodoc: "selects the conjugate gradient" 00081 (*E1).addSwitch("cg", 00082 KrylovSolverOptions::conjugateGradient); 00083 // autodoc: "selects the bi-conjugate gradient (for non symetric problems)" 00084 (*E1).addSwitch("bicg", 00085 KrylovSolverOptions::biConjugateGradient); 00086 // autodoc: "selects the bi-conjugate gradient stabilized (for non symetric problems)" 00087 (*E1).addSwitch("bicgstab", 00088 KrylovSolverOptions::biConjugateGradientStabilized); 00089 // autodoc: "selects the flexible general minimum residual method (for non symetric problems)" 00090 (*E1).addSwitch("fgmres", 00091 KrylovSolverOptions::fgmres); 00092 // autodoc: "selects the general minimum residual method (for non symetric problems)" 00093 (*E1).addSwitch("gmres", 00094 KrylovSolverOptions::gmres); 00095 // autodoc: "selects the iterative LU factorization" 00096 (*E1).addSwitch("ilufact", 00097 KrylovSolverOptions::iterativeLUFactorization); 00098 add(E1); 00099 00100 00101 // autodoc: "is used to select the preconditioner" 00102 EnumParameter<PreconditionerType>* E2 00103 = new EnumParameter<PreconditionerType>(KrylovSolverOptions::none, 00104 "precond"); 00105 00106 // autodoc: "preconditions with the diagonal of the operator" 00107 (*E2).addSwitch("diagonal", 00108 KrylovSolverOptions::diagonal); 00109 // autodoc: "incomplete choleski factorization" 00110 (*E2).addSwitch("ichol", 00111 KrylovSolverOptions::incompleteCholeski); 00112 // autodoc: "multigrid finite difference solver. By now, the grid must be $(2^{n_x}+1)\times(2^{n_y}+1)\times(2^{n_z}+1)$." 00113 (*E2).addSwitch("multigrid", 00114 KrylovSolverOptions::multiGrid); 00115 // autodoc: "preconditions a spectral method by a finite element method" 00116 (*E2).addSwitch("sfem", 00117 KrylovSolverOptions::spectralFEM); 00118 // autodoc: "no preconditioning" 00119 (*E2).addSwitch("none", 00120 KrylovSolverOptions::none); 00121 add(E2); 00122 }
| KrylovSolverOptions::~KrylovSolverOptions | ( | ) | [inline] |
| std::ostream& KrylovSolverOptions::put | ( | std::ostream & | os | ) | const [inline, private, virtual] |
Implements ParametrizableObject.
Definition at line 29 of file KrylovSolverOptions.hpp.
References identifier().
00030 { 00031 os << this->identifier(); 00032 return os; 00033 }

| Type KrylovSolverOptions::type | ( | ) | [inline] |
Definition at line 53 of file KrylovSolverOptions.hpp.
References conjugateGradient.
Referenced by KrylovSolver::KrylovSolver().
00054 { 00055 KrylovSolverOptions::Type t = conjugateGradient; 00056 get("type", t); 00057 return t; 00058 }
| PreconditionerType KrylovSolverOptions::precond | ( | ) | [inline] |
Definition at line 60 of file KrylovSolverOptions.hpp.
References none.
Referenced by KrylovSolver::KrylovSolver().
00061 { 00062 KrylovSolverOptions::PreconditionerType t = none; 00063 get("precond", t); 00064 return t; 00065 }
| static const char* KrylovSolverOptions::identifier | ( | ) | [inline, static] |
| void ParametrizableObject::get | ( | IdentifierSet & | I | ) | [inline, inherited] |
Definition at line 54 of file ParametrizableObject.hpp.
References ParametrizableObject::__parameters.
00055 { 00056 for (ParameterList::iterator i = __parameters.begin(); 00057 i != __parameters.end(); ++i) 00058 { 00059 (*(*i).second).get(I); 00060 I.insert((*i).first); 00061 } 00062 }
| void ParametrizableObject::get | ( | const char * | label, | |
| EnumType & | e | |||
| ) | const [inline, protected, inherited] |
Definition at line 71 of file ParametrizableObject.hpp.
References Parameter::Enum.
00072 { 00073 ReferenceCounting<Parameter> p = get(label); 00074 if((*p).type() == Parameter::Enum) { 00075 e = dynamic_cast<const EnumParameter<EnumType>&>(*p); 00076 return; 00077 } 00078 }
| void ParametrizableObject::get | ( | const char * | label, | |
| real_t & | d | |||
| ) | const [inline, protected, inherited] |
Definition at line 80 of file ParametrizableObject.hpp.
References Parameter::Double.
00081 { 00082 ReferenceCounting<Parameter> p = get(label); 00083 if((*p).type() == Parameter::Double) { 00084 d = dynamic_cast<const DoubleParameter&>(*p); 00085 return; 00086 } 00087 }
| void ParametrizableObject::get | ( | const char * | label, | |
| int & | i | |||
| ) | const [inline, protected, inherited] |
Definition at line 89 of file ParametrizableObject.hpp.
References Parameter::Integer.
00090 { 00091 ReferenceCounting<Parameter> p = get(label); 00092 if((*p).type() == Parameter::Integer) { 00093 i = dynamic_cast<const IntegerParameter&>(*p); 00094 return; 00095 } 00096 }
| void ParametrizableObject::get | ( | const char * | label, | |
| std::string & | s | |||
| ) | const [inline, protected, inherited] |
Definition at line 98 of file ParametrizableObject.hpp.
References Parameter::String.
00099 { 00100 ReferenceCounting<Parameter> p = get(label); 00101 if((*p).type() == Parameter::String) { 00102 s = dynamic_cast<const StringParameter&>(*p); 00103 return; 00104 } 00105 }
| const ReferenceCounting<Parameter> ParametrizableObject::get | ( | const char * | parameterName | ) | const [inline, inherited] |
Definition at line 117 of file ParametrizableObject.hpp.
References ParametrizableObject::__parameters, ErrorHandler::normal, and stringify().
00118 { 00119 ParameterList::const_iterator i = __parameters.find(parameterName); 00120 if (i != __parameters.end()) { 00121 return (*i).second; 00122 } else { 00123 throw ErrorHandler(__FILE__,__LINE__, 00124 stringify(parameterName)+" not found", 00125 ErrorHandler::normal); 00126 return 0; 00127 } 00128 }

| void ParametrizableObject::add | ( | ReferenceCounting< Parameter > | p | ) | [inline, protected, inherited] |
Definition at line 65 of file ParametrizableObject.hpp.
References ParametrizableObject::__parameters.
00066 { 00067 __parameters[(*p).label()] = p; 00068 }
| void ParametrizableObject::reset | ( | ) | [inline, inherited] |
Definition at line 109 of file ParametrizableObject.hpp.
References ParametrizableObject::__parameters.
00110 { 00111 for (ParameterList::iterator i = __parameters.begin(); 00112 i != __parameters.end(); ++i) { 00113 (*(*i).second).reset(); 00114 } 00115 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const ParametrizableObject & | P | |||
| ) | [friend, inherited] |
Writes the ParametrizableObject.
Definition at line 22 of file ParametrizableObject.cpp.
00024 { 00025 os << P.put(os); 00026 return os; 00027 }
1.5.6