forked from KratosMultiphysics/Kratos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinear_solvers_application.cpp
100 lines (78 loc) · 4.23 KB
/
linear_solvers_application.cpp
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
98
99
100
// KRATOS _ _ ____ _
// | | (_)_ __ ___ __ _ _ __/ ___| ___ | |_ _____ _ __ ___
// | | | | '_ \ / _ \/ _` | '__\___ \ / _ \| \ \ / / _ \ '__/ __|
// | |___| | | | | __/ (_| | | ___) | (_) | |\ V / __/ | \__ |
// |_____|_|_| |_|\___|\__,_|_| |____/ \___/|_| \_/ \___|_| |___/ Application
//
// Author: Thomas Oberbichler
// System includes
// External includes
// Project includes
#include "includes/define.h"
#include "linear_solvers_application.h"
#include "custom_factories/dense_linear_solver_factory.h"
#include "custom_solvers/eigen_sparse_cg_solver.h"
#include "custom_solvers/eigen_sparse_lu_solver.h"
#include "custom_solvers/eigen_sparse_qr_solver.h"
#include "custom_solvers/eigen_direct_solver.h"
#if defined USE_EIGEN_MKL
#include "custom_solvers/eigen_pardiso_lu_solver.h"
#include "custom_solvers/eigen_pardiso_llt_solver.h"
#include "custom_solvers/eigen_pardiso_ldlt_solver.h"
#endif
namespace Kratos
{
void KratosLinearSolversApplication::Register()
{
KRATOS_INFO("") << " Kratos _ _ ____ _\n"
<< " | | (_)_ __ ___ __ _ _ __/ ___| ___ | |_ _____ _ __ ___\n"
<< " | | | | '_ \\ / _ \\/ _` | '__\\___ \\ / _ \\| \\ \\ / / _ \\ '__/ __|\n"
<< " | |___| | | | | __/ (_| | | ___) | (_) | |\\ V / __/ | \\__ \\\n"
<< " |_____|_|_| |_|\\___|\\__,_|_| |____/ \\___/|_| \\_/ \\___|_| |___/\n"
<< "Initializing KratosLinearSolversApplication..." << std::endl;
RegisterDenseLinearSolvers();
using complex = std::complex<double>;
// Sparse LU Solver
using SparseLUType = EigenDirectSolver<EigenSparseLUSolver<double>>;
static auto SparseLUFactory = SparseLUType::Factory();
KRATOS_REGISTER_LINEAR_SOLVER("sparse_lu", SparseLUFactory);
// Complex Sparse LU Solver
using ComplexSparseLUType = EigenDirectSolver<EigenSparseLUSolver<complex>>;
static auto ComplexSparseLUFactory = ComplexSparseLUType::Factory();
KRATOS_REGISTER_COMPLEX_LINEAR_SOLVER("sparse_lu_complex", ComplexSparseLUFactory);
// Sparse QR Solver
using SparseQRType = EigenDirectSolver<EigenSparseQRSolver<double>>;
static auto SparseQRFactory = SparseQRType::Factory();
KRATOS_REGISTER_LINEAR_SOLVER("sparse_qr", SparseQRFactory);
// Sparse CG Solver
using SparseCGType = EigenDirectSolver<EigenSparseCGSolver<double>>;
static auto SparseCGFactory = SparseCGType::Factory();
KRATOS_REGISTER_LINEAR_SOLVER("sparse_cg", SparseCGFactory);
#if defined USE_EIGEN_MKL
// Pardiso LU Solver
using PardisoLUType = EigenDirectSolver<EigenPardisoLUSolver<double>>;
static auto PardisoLUFactory = PardisoLUType::Factory();
KRATOS_REGISTER_LINEAR_SOLVER("pardiso_lu", PardisoLUFactory);
// Pardiso LDLT Solver
using PardisoLDLTType = EigenDirectSolver<EigenPardisoLDLTSolver<double>>;
static auto PardisoLDLTFactory = PardisoLDLTType::Factory();
KRATOS_REGISTER_LINEAR_SOLVER("pardiso_ldlt", PardisoLDLTFactory);
// Pardiso LLT Solver
using PardisoLLTType = EigenDirectSolver<EigenPardisoLLTSolver<double>>;
static auto PardisoLLTFactory = PardisoLLTType::Factory();
KRATOS_REGISTER_LINEAR_SOLVER("pardiso_llt", PardisoLLTFactory);
// Complex Pardiso LU Solver
using ComplexPardisoLUType = EigenDirectSolver<EigenPardisoLUSolver<complex>>;
static auto ComplexPardisoLUFactory = ComplexPardisoLUType::Factory();
KRATOS_REGISTER_COMPLEX_LINEAR_SOLVER("pardiso_lu_complex", ComplexPardisoLUFactory);
// Complex Pardiso LDLT Solver
using ComplexPardisoLDLTType = EigenDirectSolver<EigenPardisoLDLTSolver<complex>>;
static auto ComplexPardisoLDLTFactory = ComplexPardisoLDLTType::Factory();
KRATOS_REGISTER_COMPLEX_LINEAR_SOLVER("pardiso_ldlt_complex", ComplexPardisoLDLTFactory);
// Complex Pardiso LLT Solver
using ComplexPardisoLLTType = EigenDirectSolver<EigenPardisoLLTSolver<complex>>;
static auto ComplexPardisoLLTFactory = ComplexPardisoLLTType::Factory();
KRATOS_REGISTER_COMPLEX_LINEAR_SOLVER("pardiso_llt_complex", ComplexPardisoLLTFactory);
#endif // defined USE_EIGEN_MKL
}
} // namespace Kratos