BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
fn_matrix_type.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_MATRIX_TYPE_HPP
13#define FN_MATRIX_TYPE_HPP
14#include "en_SolverEnums.hpp"
15#include "cl_SpMatrix.hpp"
16#include "assert.hpp"
17
18namespace belfem
19{
20 inline
22 {
23 switch( aType )
24 {
26 {
27 return SpMatrixType::CSC ;
28 }
30 {
31 return SpMatrixType::CSC ;
32 }
34 {
35 return SpMatrixType::CSC ;
36 }
37 case( SolverType::PARDISO ) :
38 {
39 return SpMatrixType::CSR ;
40 }
41 case( SolverType::PETSc ) :
42 {
43 return SpMatrixType::CSR ;
44 }
45 case( SolverType::STRUMPACK ) :
46 {
47 return SpMatrixType::CSR ;
48 }
49 default:
50 {
51 BELFEM_ERROR( false, "Unknown solver type");
53 }
54 }
55 }
56}
57#endif //FN_MATRIX_TYPE_HPP
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
USER GUIDES:
Definition cl_Capacitor.cpp:16
SpMatrixType
Definition cl_SpMatrix.hpp:29
@ UNDEFINED
Definition cl_SpMatrix.hpp:32
@ 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 matrix_type(const SolverType aType)
Definition fn_matrix_type.hpp:21