openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
backend.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) NumeriCor GmbH
2 // SPDX-License-Identifier: Apache-2.0
3 
13 #ifndef _BACKEND_H
14 #define _BACKEND_H
15 
16 #include <cstdio>
17 
18 #include <mpi.h>
19 
21 #define DELIMIT_OPTS "+"
23 #define EXIT(A) ::opencarp::finalize_backend_and_exit(A)
24 
25 namespace opencarp {
26 
28 bool ginkgo_selected();
29 
31 bool petsc_active();
32 
39 void initialize_backend(int *argc, char **argv, char *rc, char *help_msg);
40 
42 void finalize_backend();
43 
44 [[noreturn]] void finalize_backend_and_exit(int code);
45 
46 #ifdef WITH_PETSC
47 // Implemented by the PETSc backend. Only its own sources include its headers.
49 void set_petsc_active(bool active);
58 void initialize_PETSc(int *argc, char **argv, char *rc, char *help_msg);
59 void finalize_PETSc();
61 void petsc_set_comm_world(MPI_Comm comm);
63 void petsc_redirect_errors(FILE* fd);
64 void petsc_insert_options(const char* options);
65 #endif
66 
67 } // namespace opencarp
68 
69 #endif
bool petsc_active()
Definition: backend.cc:53
void finalize_backend_and_exit(int code)
Definition: backend.cc:101
void finalize_backend()
Definition: backend.cc:87
void initialize_backend(int *argc, char **argv, char *rc, char *help_msg)
Definition: backend.cc:58
bool ginkgo_selected()
Definition: backend.cc:44