FGMRESOptions Class Reference

#include <FGMRESOptions.hpp>

Inheritance diagram for FGMRESOptions:

Inheritance graph
[legend]
Collaboration diagram for FGMRESOptions:

Collaboration graph
[legend]

List of all members.

Public Member Functions

real_t epsilon ()
int maxiter ()
int basis ()
 FGMRESOptions ()
 ~FGMRESOptions ()
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.


Detailed Description

Definition at line 25 of file FGMRESOptions.hpp.


Constructor & Destructor Documentation

FGMRESOptions::FGMRESOptions (  )  [inline, explicit]

Definition at line 63 of file FGMRESOptions.hpp.

00064   {
00065     // autodoc: "sets maximum number of iteration"
00066     add(new IntegerParameter(500, "maxiter"));
00067     // autodoc: "sets the number of vectors to build in the Krylov basis"
00068     add(new IntegerParameter(100, "basis"));
00069     // autodoc: "sets the required reduction factor of the residu"
00070     add(new DoubleParameter (1E-5,"epsilon"));
00071   }

FGMRESOptions::~FGMRESOptions (  )  [inline]

Definition at line 73 of file FGMRESOptions.hpp.

00074   {
00075     ;
00076   }


Member Function Documentation

std::ostream& FGMRESOptions::put ( std::ostream &  os  )  const [inline, private, virtual]

Implements ParametrizableObject.

Definition at line 29 of file FGMRESOptions.hpp.

References identifier().

00030   {
00031     os << this->identifier();
00032     return os;
00033   }

Here is the call graph for this function:

static const char* FGMRESOptions::identifier (  )  [inline, static]

Definition at line 36 of file FGMRESOptions.hpp.

Referenced by put().

00037   {
00038     // autodoc: "specifies fgmres options"
00039     return "fgmres";
00040   }

real_t FGMRESOptions::epsilon (  )  [inline]

Definition at line 42 of file FGMRESOptions.hpp.

00043   {
00044     real_t eps = 0;
00045     get("epsilon",eps);
00046     return eps;
00047   }

int FGMRESOptions::maxiter (  )  [inline]

Definition at line 49 of file FGMRESOptions.hpp.

00050   {
00051     int maxiter = 0;
00052     get("maxiter",maxiter);
00053     return maxiter;
00054   }

int FGMRESOptions::basis (  )  [inline]

Definition at line 56 of file FGMRESOptions.hpp.

00057   {
00058     int basis = 20;
00059     get("basis",basis);
00060     return basis;
00061   }

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   }

template<typename EnumType>
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   }

Here is the call graph for this function:

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   }


Friends And Related Function Documentation

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 }


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

Generated on Wed Nov 19 00:06:36 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6