suanPan
Loading...
Searching...
No Matches
SolverSetting.hpp
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2024 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
17
18#ifndef SOLVERSETTING_HPP
19#define SOLVERSETTING_HPP
20
21#include "Preconditioner.hpp"
22
23enum class Precision {
24 MIXED,
25 FULL
26};
27
28enum class IterativeSolver {
30 GMRES,
31 NONE
32};
33
35 ILU,
36 JACOBI,
37 NONE
38};
39
40template<sp_d data_t> struct SolverSetting {
41 int restart = 20;
42 int max_iteration = 200;
43 data_t tolerance = std::is_same_v<data_t, float> ? 1E-6f : 1E-14;
48 Preconditioner<data_t>* preconditioner = nullptr;
49 string lis_options{};
50};
51
52#endif
PreconditionerType
Definition SolverSetting.hpp:34
Precision
Definition SolverSetting.hpp:23
IterativeSolver
Definition SolverSetting.hpp:28
Definition SolverSetting.hpp:40
unsigned iterative_refinement
Definition SolverSetting.hpp:44
data_t tolerance
Definition SolverSetting.hpp:43
int restart
Definition SolverSetting.hpp:41
Precision precision
Definition SolverSetting.hpp:45
string lis_options
Definition SolverSetting.hpp:49
int max_iteration
Definition SolverSetting.hpp:42
PreconditionerType preconditioner_type
Definition SolverSetting.hpp:47
Preconditioner< data_t > * preconditioner
Definition SolverSetting.hpp:48
IterativeSolver iterative_solver
Definition SolverSetting.hpp:46