CreatorMap.cpp 2.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "CreatorMap.hpp"

// AMDiS includes
#include "solver/ITL_Preconditioner.hpp"
#include "solver/ITL_Solver.hpp"
#include "solver/KrylovPreconditioner.hpp"
#include "solver/LinearSolverInterface.hpp"
#include "solver/UmfPackSolver.hpp"

namespace AMDiS
{
  template<>
  void CreatorMap<LinearSolverInterface>::addDefaultCreators()
  {
    LinearSolverCreator* creator;

    // creators for MTL4 krylov solvers
    // _________________________________________________________________________

    creator = new CGSolver::Creator;
    addCreator("mtl_cg", creator);

    creator = new CGSSolver::Creator;
    addCreator("mtl_cgs", creator);

    creator = new BiCGSolver::Creator;
    addCreator("mtl_bicg", creator);

    creator = new BiCGStabSolver::Creator;
    addCreator("mtl_bicgstab", creator);

    creator = new BiCGStab2Solver::Creator;
    addCreator("mtl_bicgstab2", creator);

    creator = new BiCGStabEllSolver::Creator;
    addCreator("mtl_bicgstab_ell", creator);

    creator = new QMRSolver::Creator;
    addCreator("mtl_qmr", creator);

    creator = new TFQMRSolver::Creator;
    addCreator("mtl_tfqmr", creator);

    creator = new GMResSolver::Creator;
    addCreator("mtl_gmres", creator);

    creator = new GcrSolver::Creator;
    addCreator("mtl_gcr", creator);

    creator = new FGMResSolver::Creator;
    addCreator("mtl_fgmres", creator);

    creator = new IDRsSolver::Creator;
    addCreator("mtl_idr_s", creator);

    creator = new MinResSolver::Creator;
    addCreator("mtl_minres", creator);

    creator = new PreOnly::Creator;
    addCreator("mtl_preonly", creator);
    addCreator("mtl_richardson", creator);

#ifdef HAVE_UMFPACK
    creator = new UmfPackSolver::Creator;
    addCreator("mtl_umfpack", creator);
    addCreator("mtl_direct", creator);
#endif
  }


  template<>
  void CreatorMap<ITL_PreconditionerBase<MTLTypes::MTLMatrix, MTLTypes::MTLVector>>::addDefaultCreators()
  {
    using PreconditionCreator = CreatorInterfaceName<ITL_PreconditionerBase<MTLTypes::MTLMatrix, MTLTypes::MTLVector>>;
    PreconditionCreator* creator;

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

    creator =  new MassLumpingPreconditioner::Creator;
    addCreator("lumping", creator);
    addCreator("masslumping", creator);

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

    creator = new ICPreconditioner::Creator;
    addCreator("ic", creator);

    creator =  new IdentityPreconditioner::Creator;
    addCreator("no", creator);

    creator =  new KrylovPreconditionerSeq::Creator;
    addCreator("krylov", creator);
    addCreator("solver", creator);
  }
} // end namespace AMDiS