BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
en_SolverEnums.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12#ifndef BELFEM_EN_SOLVERENUMS_HPP
13#define BELFEM_EN_SOLVERENUMS_HPP
14
15#include "typedefs.hpp"
16#include "fn_to_enum.hpp"
17
18namespace belfem
19{
20//------------------------------------------------------------------------------
21
32
33//------------------------------------------------------------------------------
34
42
43//------------------------------------------------------------------------------
44
45
62
63//------------------------------------------------------------------------------
64
66 {
67 AIJ = 0,
68 CSR = 1,
69 CSC = 2,
70 UNDEFINED = 3
71 };
72
73//------------------------------------------------------------------------------
74
78 enum class Preconditioner
79 {
80 NONE, // No preconditioner
81 ASM, // Additive Schwarz
82 GASM, // Restricted additive Schwarz ( PCASM with PC_ASM_RESTRICT, NOT PETSc's PCGASM )
83 GAMG, // Geometric algebraic multigrid
84 JACOBI, // i.e. diagonal scaling preconditioning)
85 BJACOBI, // Block Jacobi
86 LU, // direct solver, based on LU factorization, as a preconditioner
87 ICC, // Incomplete Cholesky factorization
88 ILU, // Incomplete factorization
89 HMG, // Hybrid of PETSc preconditioners
90 SPAI, // Use the Sparse Approximate Inverse method of Grote and Barnard as a preconditioner
91 UNDEFINED
92 };
93
94
95//------------------------------------------------------------------------------
96
100 enum class KrylovMethod
101 {
102 PREONLY, // No Krylov Method
103 CG, // Conjugate Gradient
104 CGS, // Conjugate Gradient Squared
105 IBCGS, // Improved Stabilized version of BiConjugate Gradient
106 GMRES, // Generalized Minimal Residual
107 TFQMR, // transpose free QMR
108 BCGS, // Stabilized version of BiConjugate Gradient
109 AUTO, // PETSc: PREONLY if the preconditioner is LU, else GMRES; STRUMPACK: always factorization-preconditioned GMRES
110 UNDEFINED
111 };
112
113//------------------------------------------------------------------------------
114
116 {
118 METIS = 1,
121 PARMETIS = 4, // explicit parallel ND: PETSc path uses BELFEM's collective
122 PTSCOTCH = 5, // wrapper; MUMPS / STRUMPACK map it as metis / scotch do in parallel
123 UNDEFINED = 6 // appended, never inserted: the value travels as a uint
124 };
125
126//------------------------------------------------------------------------------
127
129 {
130 OFF = 0,
131 BLR = 1,
133 UNDEFINED = 3
134 };
135
136//------------------------------------------------------------------------------
137
142 {
143 AMD = 0, //Approximate Minimum Degree
144 USERPIVOT = 1, // User Pivot ( currently not supported )
145 AMF = 2, // Approximate Minimum Fill
146 SCOTCH = 3, // SCOTCH
147 PORD = 4, // PORD ordering ( shipped with MUMPS )
148 METIS = 5, // METIS nested dissection
149 QAMD = 6, // Approximate Minimum Degree with automatic quasi-dense row detection
151 UNDEFINED
152 };
153
154//------------------------------------------------------------------------------
155
160 {
164 UNDEFINED
165 };
166
167//------------------------------------------------------------------------------
168
180
181//------------------------------------------------------------------------------
182
187 {
188 None = 0,
189 Full = 1,
190 Main = 2,
191 UNDEFINED = 3
192 };
193
194
195//------------------------------------------------------------------------------
196
197// set the default solver, PETSc is deliberately not set by default
198#ifdef BELFEM_STRUMPACK
200#elif BELFEM_MUMPS
202#elif BELFEM_PARDISO
204#elif BELFEM_SUITESPARSE
206#elif BELFEM_SUPERLU
208#else
210#endif
211
212
213//------------------------------------------------------------------------------
214// conversion tools
215//------------------------------------------------------------------------------
216
217 string
218 to_string( const SolverType aSolverType );
219
221 solver_type( const string & aString );
222
223//------------------------------------------------------------------------------
224
225 string
226 to_string( const DistributedMatrixType aDistributedMatrixType );
227
229 distributed_matrix_type( const string & aString );
230
231//------------------------------------------------------------------------------
232
233 string
234 to_string( const EulerMethod aEulerMethod );
235
237 euler_method( const string & aString );
238
239//------------------------------------------------------------------------------
240
241 string
242 to_string( const Preconditioner aPreconditioner ) ;
243
245 preconditioner( const string & aString );
246
247//------------------------------------------------------------------------------
248
249 string
250 to_string( const KrylovMethod aKrylovMethod ) ;
251
253 krylov_method( const string & aString );
254
255//------------------------------------------------------------------------------
256
257 string
258 to_string( const ReorderingMethod aReorderingMethod ) ;
259
261 reordering_method( const string & aString );
262
263//------------------------------------------------------------------------------
264
265 string
266 to_string( const CompressionMethod aCompressionMethod ) ;
267
269 compression_method( const string & aString );
270
271//------------------------------------------------------------------------------
272
273 string
274 to_string( const MumpsSerialReodrdering aMumpsSerialReodrdering ) ;
275
277 serial_reordering( const string & aString );
278
279//------------------------------------------------------------------------------
280
281 string
282 to_string( const MumpsParallelReodrdering aMumpsParallelReodrdering ) ;
283
285 parallel_reordering( const string & aString );
286
287//------------------------------------------------------------------------------
288
289 string
290 to_string( const MumpsBlockLowRanking aBLR );
291
293 block_low_ranking( const string & aString );
294
295//------------------------------------------------------------------------------
296}
297
298#endif //BELFEM_EN_SOLVERENUMS_HPP
USER GUIDES:
Definition cl_Capacitor.cpp:16
DistributedMatrixType
Definition en_SolverEnums.hpp:66
@ AIJ
Definition en_SolverEnums.hpp:67
EulerMethod
Definition en_SolverEnums.hpp:47
@ MassOnly
Definition en_SolverEnums.hpp:58
@ BackwardDifference1
Definition en_SolverEnums.hpp:52
@ Derivative
Definition en_SolverEnums.hpp:59
@ BackwardDifference5
Definition en_SolverEnums.hpp:56
@ Static
Definition en_SolverEnums.hpp:48
@ CrankNicolson
Definition en_SolverEnums.hpp:50
@ Galerkin
Definition en_SolverEnums.hpp:51
@ ForwardExplicit
Definition en_SolverEnums.hpp:49
@ BackwardDifference2
Definition en_SolverEnums.hpp:53
@ BackwardDifference3
Definition en_SolverEnums.hpp:54
@ StiffnessOnly
Definition en_SolverEnums.hpp:57
@ BackwardDifference4
Definition en_SolverEnums.hpp:55
CompressionMethod compression_method(const string &aString)
Definition en_SolverEnums.cpp:401
@ CSC
Definition cl_SpMatrix.hpp:30
@ CSR
Definition cl_SpMatrix.hpp:31
SolverType solver_type(const string &aString)
Definition en_SolverEnums.cpp:57
ReorderingMethod reordering_method(const string &aString)
Definition en_SolverEnums.cpp:358
Preconditioner preconditioner(const string &aString)
Definition en_SolverEnums.cpp:240
MumpsSerialReodrdering
MUMPS only.
Definition en_SolverEnums.hpp:142
@ PORD
Definition en_SolverEnums.hpp:147
@ AMD
Definition en_SolverEnums.hpp:143
@ AMF
Definition en_SolverEnums.hpp:145
@ USERPIVOT
Definition en_SolverEnums.hpp:144
@ QAMD
Definition en_SolverEnums.hpp:149
KrylovMethod krylov_method(const string &aString)
Definition en_SolverEnums.cpp:305
MumpsParallelReodrdering parallel_reordering(const string &aString)
Definition en_SolverEnums.cpp:513
DistributedMatrixType distributed_matrix_type(const string &aString)
Definition en_SolverEnums.cpp:99
MumpsErrorAnalysis
MUMPS only.
Definition en_SolverEnums.hpp:187
@ Main
Definition en_SolverEnums.hpp:190
@ Full
Definition en_SolverEnums.hpp:189
const SolverType gDefaultSolver
Definition en_SolverEnums.hpp:209
SolverType
Definition en_SolverEnums.hpp:23
@ PETSc
Definition en_SolverEnums.hpp:29
@ PARDISO
Definition en_SolverEnums.hpp:28
@ UNDEFINED
Definition en_SolverEnums.hpp:30
@ MUMPS
Definition en_SolverEnums.hpp:26
@ STRUMPACK
Definition en_SolverEnums.hpp:27
@ UMFPACK
Definition en_SolverEnums.hpp:24
@ SUPERLU
Definition en_SolverEnums.hpp:25
ReorderingMethod
Definition en_SolverEnums.hpp:116
@ AUTOMATIC
Definition en_SolverEnums.hpp:120
@ PARMETIS
Definition en_SolverEnums.hpp:121
@ PTSCOTCH
Definition en_SolverEnums.hpp:122
@ SCOTCH
Definition en_SolverEnums.hpp:119
@ METIS
Definition en_SolverEnums.hpp:118
@ NATURAL
Definition en_SolverEnums.hpp:117
KrylovMethod
PETSC only.
Definition en_SolverEnums.hpp:101
@ PREONLY
Definition en_SolverEnums.hpp:102
@ BCGS
Definition en_SolverEnums.hpp:108
@ CGS
Definition en_SolverEnums.hpp:104
@ CG
Definition en_SolverEnums.hpp:103
@ IBCGS
Definition en_SolverEnums.hpp:105
@ TFQMR
Definition en_SolverEnums.hpp:107
@ GMRES
Definition en_SolverEnums.hpp:106
@ AUTO
Definition en_SolverEnums.hpp:109
SymmetryMode
Definition en_SolverEnums.hpp:36
@ Unsymmetric
Definition en_SolverEnums.hpp:37
@ GeneralSymmetric
Definition en_SolverEnums.hpp:39
@ PositiveDefiniteSymmetric
Definition en_SolverEnums.hpp:38
EulerMethod euler_method(const string &aString)
Definition en_SolverEnums.cpp:164
Preconditioner
PETSC only.
Definition en_SolverEnums.hpp:79
@ GASM
Definition en_SolverEnums.hpp:82
@ ASM
Definition en_SolverEnums.hpp:81
@ LU
Definition en_SolverEnums.hpp:86
@ HMG
Definition en_SolverEnums.hpp:89
@ NONE
Definition en_SolverEnums.hpp:80
@ ICC
Definition en_SolverEnums.hpp:87
@ SPAI
Definition en_SolverEnums.hpp:90
@ JACOBI
Definition en_SolverEnums.hpp:84
@ GAMG
Definition en_SolverEnums.hpp:83
@ BJACOBI
Definition en_SolverEnums.hpp:85
@ ILU
Definition en_SolverEnums.hpp:88
MumpsBlockLowRanking block_low_ranking(const string &aString)
Definition en_SolverEnums.cpp:568
MumpsSerialReodrdering serial_reordering(const string &aString)
Definition en_SolverEnums.cpp:466
MumpsBlockLowRanking
MUMPS only.
Definition en_SolverEnums.hpp:173
@ Automatic
Definition en_SolverEnums.hpp:175
@ FactorizationOnly
Definition en_SolverEnums.hpp:177
@ FactorizationAndSolution
Definition en_SolverEnums.hpp:176
@ Off
Definition en_SolverEnums.hpp:174
CompressionMethod
Definition en_SolverEnums.hpp:129
@ OFF
Definition en_SolverEnums.hpp:130
@ BLR
Definition en_SolverEnums.hpp:131
string to_string(const DomainType aDomainType)
Definition en_DomainType.cpp:21
MumpsParallelReodrdering
MUMPS only.
Definition en_SolverEnums.hpp:160