BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_preferred_matrix_format.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 FN_PREFERRED_MATRIX_FORMAT_HPP
13#define FN_PREFERRED_MATRIX_FORMAT_HPP
14#include "cl_SpMatrix.hpp"
15#include "en_SolverEnums.hpp"
16namespace belfem
17{
18 inline SpMatrixType
20 {
21 switch( aSolver )
22 {
23 case( SolverType::UMFPACK ) :
24 case( SolverType::SUPERLU ) :
25 {
26 return SpMatrixType::CSC ;
27 }
28 case( SolverType::STRUMPACK ) :
29 case( SolverType::PARDISO ) :
30 case( SolverType::PETSc ) :
31 case( SolverType::MUMPS ) :
32 {
33 return SpMatrixType::CSR ;
34 }
35 default:
36 {
37 return SpMatrixType::CSR ;
38 }
39 }
40 }
41}
42#endif //FN_PREFERRED_MATRIX_FORMAT_HPP
USER GUIDES:
Definition cl_Capacitor.cpp:16
SpMatrixType
Definition cl_SpMatrix.hpp:29
@ CSC
Definition cl_SpMatrix.hpp:30
@ CSR
Definition cl_SpMatrix.hpp:31
SolverType
Definition en_SolverEnums.hpp:23
@ PETSc
Definition en_SolverEnums.hpp:29
@ PARDISO
Definition en_SolverEnums.hpp:28
@ MUMPS
Definition en_SolverEnums.hpp:26
@ STRUMPACK
Definition en_SolverEnums.hpp:27
@ UMFPACK
Definition en_SolverEnums.hpp:24
@ SUPERLU
Definition en_SolverEnums.hpp:25
SpMatrixType preferred_matrix_format(SolverType aSolver)
Definition fn_preferred_matrix_format.hpp:19