00001 #ifndef __FLinearSolverFactory__ 00002 #define __FLinearSolverFactory__ 00003 00004 00005 00048 #include <stdio.h> 00049 00050 #include "AbsFLinearSolver.hpp" 00051 00052 class FLinearSolverFactory 00053 { 00054 public: 00055 00056 int n, nmax; 00057 char** model; 00058 char** modelName; 00059 int* modelContext; 00060 00061 int nContext, maxContext; 00062 char** context; 00063 00064 public: 00065 00066 FLinearSolverFactory(int nmodels=50, int ncontext=10); 00067 virtual ~FLinearSolverFactory(); 00068 00069 int numberOfContexts(){ return nContext; } 00070 int numberOfModels(){ return n; } 00071 00072 int maxContexts(){ return maxContext; } 00073 int maxModels(){ return nmax; } 00074 00075 void addModel(char* name, char* newModel, int icontext); 00076 void addContext(char* newContext); 00077 00078 char* getContextType(int icontext){ return context[icontext]; } 00079 char* getContext(int imodel){ return context[getModelContext(imodel)]; } 00080 char* getModel(int imodel){ return model[imodel]; } 00081 char* getModelName(int imodel){ return modelName[imodel]; } 00082 int getModelContext(int imodel){ return modelContext[imodel]; } 00083 00084 virtual AbsFLinearSolver* createSolver(int indexModel=0, int maxIter=10, int m=10, double epsilon=1.0e-4); 00085 00086 virtual AbsFLinearSolver* createSolverByName(char* name, int maxIter, int m=10, double epsilon=1.0e-4); 00087 00088 // used for combined solvers: gmresr, gmres* 00089 virtual AbsFLinearSolver* createSolverByName(char* name, int outerIter, int l, 00090 int innerIter, int m, double epsilon=1.0e-4); 00091 00092 // used for gmres* 00093 virtual AbsFLinearSolver* createSolverByName(char* name, int outerIter, int l, 00094 AbsFLinearSolver* innerSolver, double epsilon=1.0e-4); 00095 00096 virtual void showModels(); 00097 00098 virtual void report(); 00099 virtual void report(FILE* file){} 00100 }; 00101 00102 00103 00104 #endif