CreatorMap.cc 7.05 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#include "CreatorMap.h"
#include "OEMSolver.h"
#include "Preconditioner.h"
#include "DiagonalPreconditioner.h"
#include "ILUPreconditioner.h"
#include "ILUTPreconditioner.h"
#include "NonLinSolver.h"
#include "MatrixVector.h"
#include "SystemVector.h"
#include "Estimator.h"
11
12
#include "ResidualEstimator.h"
#include "ResidualParallelEstimator.h"
13
14
15
16
17
18
19
20
21
22
23
#include "RecoveryEstimator.h"
#include "LeafData.h"
#include "SurfaceRegion_ED.h"
#include "MultiGridWrapper.h"
#include "DOFMatrix.h"
#include "SparseVector.h"
#include "GSSmoother.h"
#include "JacobiSmoother.h"
#include "ElementRegion_ED.h"
#include "BiCGStab.h"
#include "BiCGStab2.h"
24
#include "BFGS_Precond.h"
25
26
27
28
29
30
#include "BoxSmoother.h"
#include "MultiGridPreconWrapper.h"
#include "GMResSolver2.h"
#include "TFQMR.h"
#include "VecSymSolver.h"
#include "UmfPackSolver.h"
31
#include "PardisoSolver.h"
32
#include "DuneSolver.h"
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

namespace AMDiS {

  template<>
  void CreatorMap<OEMSolver<DOFVector<double> > >::addDefaultCreators()
  {
    OEMSolverCreator<DOFVector<double> > *creator;

    creator = NEW BiCGSolver<DOFVector<double> >::Creator;
    addCreator("bicgstab_albert", creator);

    creator = NEW CGSolver<DOFVector<double> >::Creator;
    addCreator("cg", creator);

    creator = NEW GMResSolver<DOFVector<double> >::Creator;
    addCreator("gmres", creator);

    creator = NEW ODirSolver<DOFVector<double> >::Creator;
    addCreator("odir", creator);

    creator = NEW OResSolver<DOFVector<double> >::Creator;
    addCreator("ores", creator);  

    creator = NEW BiCGStab<DOFVector<double> >::Creator;
    addCreator("bicgstab", creator);

    creator = NEW MultiGridWrapperScal::Creator;
    addCreator("mg", creator);

    creator = NEW BiCGStab2<DOFVector<double> >::Creator;
    addCreator("bicgstab2", creator);

    //        creator = NEW GMResSolver2<DOFVector<double> >::Creator;
66
    //        addCreator("gmres2", creator);
67
68
69

    creator = NEW TFQMR<DOFVector<double> >::Creator;
    addCreator("tfqmr", creator);
70
71
72
73
74

#ifdef HAVE_DUNE
    creator = NEW DuneSolver< DOFVector<double> >::Creator;
    addCreator("dune", creator);
#endif
75
76
  }

77

78
79
80
81
82
83
84
85
86
87
88
89
90
91
  template<>
  void CreatorMap<SmootherBase<DOFMatrix, 
			       SparseVector<double>,
			       ::std::set<DegreeOfFreedom> > >::addDefaultCreators()
  {
    SmootherCreator<DOFMatrix, SparseVector<double>, ::std::set<DegreeOfFreedom> > *creator;

    creator = NEW GSSmoother<DOFMatrix, SparseVector<double>, ::std::set<DegreeOfFreedom> >::Creator;
    addCreator("gs", creator);

    creator = NEW JacobiSmoother<DOFMatrix, SparseVector<double>, ::std::set<DegreeOfFreedom> >::Creator;
    addCreator("j", creator);
  }

92

93
94
95
96
97
98
99
100
101
102
103
104
105
  template<>
  void CreatorMap<PreconditionerScal>::addDefaultCreators()
  {
    CreatorInterface<PreconditionerScal> *creator;

    creator =  NEW DiagonalPreconditioner::Creator;
    addCreator("diag", creator);

    creator = NEW ILUPreconditioner::Creator;
    addCreator("ilu", creator);

    creator = NEW ILUTPreconditioner::Creator;
    addCreator("ilut", creator);
106
107
108

    creator = NEW BFGS_Precond::Creator;
    addCreator("bfgs", creator);
109
110
111
112
113

    creator =  NEW MGPreconWrapperScal::Creator;
    addCreator("mg", creator);
  }

114

115
116
117
118
119
120
121
122
123
124
125
126
  template<>
  void CreatorMap<NonLinSolver<DOFVector<double> > >::addDefaultCreators()
  {
    NonLinSolverCreator<DOFVector<double> > *creator;

    creator = NEW Newton<DOFVector<double> >::Creator;
    addCreator("newton", creator);

    creator = NEW NewtonS<DOFVector<double> >::Creator;
    addCreator("newton_fs", creator);
  }

127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
  template<>
  void CreatorMap<OEMSolver<SystemVector> >::addDefaultCreators()
  {
    OEMSolverCreator<SystemVector> *creator;

    creator = NEW BiCGSolver<SystemVector>::Creator;
    addCreator("bicgstab_albert", creator);

    creator = NEW CGSolver<SystemVector>::Creator;
    addCreator("cg", creator);

    creator = NEW GMResSolver<SystemVector>::Creator;
    addCreator("gmres", creator);

    creator = NEW ODirSolver<SystemVector>::Creator;
    addCreator("odir", creator);

    creator = NEW OResSolver<SystemVector>::Creator;
    addCreator("ores", creator);  

    creator = NEW BiCGStab<SystemVector>::Creator;
    addCreator("bicgstab", creator);

    creator = NEW BiCGStab2<SystemVector>::Creator;
    addCreator("bicgstab2", creator);

    creator = NEW MultiGridWrapperVec::Creator;
    addCreator("mg", creator);

    creator = NEW GMResSolver2<SystemVector>::Creator;
    addCreator("gmres2", creator);

    creator = NEW TFQMR<SystemVector>::Creator;
    addCreator("tfqmr", creator);

    creator = NEW VecSymSolver<SystemVector>::Creator;
    addCreator("vecsym", creator);

#ifdef HAVE_UMFPACK
    creator = NEW UmfPackSolver<SystemVector>::Creator;
    addCreator("umfpack", creator);
#endif
170
171
172
173
174

#ifdef HAVE_MKL
    creator = NEW PardisoSolver<SystemVector>::Creator;
    addCreator("pardiso", creator);
#endif
175
176
177
178
179

#ifdef HAVE_DUNE
    creator = NEW DuneSolver<SystemVector>::Creator;
    addCreator("dune", creator);
#endif
180
181
  }

182

183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
  template<>
  void CreatorMap<SmootherBase<Matrix<DOFMatrix*>, 
			       Vector<SparseVector<double>*>,
			       Vector<  ::std::set<DegreeOfFreedom>*> > >::addDefaultCreators()
  {
    SmootherCreator<Matrix<DOFMatrix*>, 
      Vector<SparseVector<double>*>,
      Vector<  ::std::set<DegreeOfFreedom>*> > *creator;

    creator = NEW GSSmoother<Matrix<DOFMatrix*>, 
      Vector<SparseVector<double>*>,
      Vector<  ::std::set<DegreeOfFreedom>*> >::Creator;
    addCreator("gs", creator);

    creator = NEW JacobiSmoother<Matrix<DOFMatrix*>, 
      Vector<SparseVector<double>*>,
      Vector<  ::std::set<DegreeOfFreedom>*> >::Creator;
    addCreator("j", creator);

    creator = NEW BoxSmoother::Creator;
    addCreator("box", creator);
  }

206

207
208
209
210
211
212
213
214
215
216
217
218
  template<>
  void CreatorMap<NonLinSolver<SystemVector> >::addDefaultCreators()
  {
    NonLinSolverCreator<SystemVector> *creator;

    creator = NEW Newton<SystemVector>::Creator;
    addCreator("newton", creator);

    creator = NEW NewtonS<SystemVector>::Creator;
    addCreator("newton_fs", creator);
  }

219

220
221
222
223
224
225
226
227
  template<>
  void CreatorMap<Estimator>::addDefaultCreators()
  {
    EstimatorCreator *creator;

    creator = NEW ResidualEstimator::Creator;
    addCreator("residual", creator);

228
#ifdef _OPENMP
229
230
    creator = NEW ResidualParallelEstimator::Creator;
    addCreator("residualparallel", creator);
231
#endif
232

233
234
235
236
    creator = NEW RecoveryEstimator::Creator;
    addCreator("recovery", creator);
  }

237

238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
  template<>
  void CreatorMap<ElementData>::addDefaultCreators()
  {
    CreatorInterface<ElementData> *creator;

    creator = NEW LeafDataEstimatable::Creator;
    addCreator("LeafDataEstimatable", creator);

    creator = NEW LeafDataEstimatableVec::Creator;
    addCreator("LeafDataEstimatableVec", creator);

    creator = NEW LeafDataCoarsenable::Creator;
    addCreator("LeafDataCoarsenable", creator);

    creator = NEW LeafDataCoarsenableVec::Creator;
    addCreator("LeafDataCoarsenableVec", creator);

    creator = NEW LeafDataPeriodic::Creator;
    addCreator("LeafDataPeriodic", creator);

    creator = NEW SurfaceRegion_ED::Creator;
    addCreator("SurfaceRegion_ED", creator);

    creator = NEW ElementRegion_ED::Creator;
    addCreator("ElementRegion_ED", creator);
  }

}