9 #if !defined(WITH_PETSC) && !defined(WITH_GINKGO)
10 #error "SF_init.h needs the backends of the build: define WITH_PETSC or WITH_GINKGO"
13 #include <initializer_list>
20 #include "SF_ginkgo_vector.h"
21 #include "SF_ginkgo_matrix.h"
22 #include "SF_ginkgo_solver.h"
30 void init_vector_petsc(abstract_vector<SF_int,SF_real>** vec);
31 void init_matrix_petsc(abstract_matrix<SF_int,SF_real>** mat);
32 void init_solver_petsc(abstract_linear_solver<SF_int,SF_real>** sol);
34 void petsc_log_preallocation_report(std::initializer_list<std::pair<
const char*, abstract_matrix<SF_int,SF_real>*>> matrices);
48 template <
typename T,
typename S>
52 throw std::runtime_error(
"The Ginkgo backend was not enabled");
54 init_vector_ginkgo(
object);
59 template <
typename T,
typename S>
63 throw std::runtime_error(
"The Ginkgo backend was not enabled");
65 init_matrix_ginkgo(
object);
70 template <
typename T,
typename S>
74 throw std::runtime_error(
"The Ginkgo backend was not enabled");
76 init_solver_ginkgo(
object);
84 throw std::runtime_error(
"The PETSc backend was not enabled");
86 init_vector_petsc(
object);
91 template <
typename T,
typename S>
95 throw std::runtime_error(
"The PETSc backend was not enabled");
97 init_matrix_petsc(
object);
102 template <
typename T,
typename S>
106 throw std::runtime_error(
"The PETSc backend was not enabled");
108 init_solver_petsc(
object);
126 template <
class T,
class S>
151 template <
class T,
class S>
162 (*vec)->init(igsize, ilsize, idpn, ilayout);
179 template <
class T,
class S>
189 (*vec)->init(mesh, i, ltype);
204 template <
class T,
class S>
227 template <
class T,
class S>
248 template <
class T,
class S>
Starts and stops the linear algebra backend the flavor parameter selects.
void init_or_throw_petsc(SF::abstract_vector< SF_int, SF_real > **object)
typename non_deduced< T >::type non_deduced_t
void init_or_throw_ginkgo(SF::abstract_vector< T, S > **object)
void init_solver(SF::abstract_linear_solver< T, S > **sol)
void init_vector(SF::abstract_vector< T, S > **vec)
void init_matrix(SF::abstract_matrix< T, S > **mat)