1
by hhiester
deleting initialisation as none of tools are used any longer. |
1 |
// wrapper for test_pressure_solve main
|
2 |
#include "confdefs.h" |
|
3 |
||
4 |
#include <stdio.h> |
|
5 |
#include <stdlib.h> |
|
6 |
#include <errno.h> |
|
7 |
#include <cstdlib> |
|
8 |
#include <iostream> |
|
9 |
using std::cerr; |
|
10 |
using std::endl; |
|
11 |
||
12 |
#ifdef HAVE_MPI
|
|
13 |
#include <mpi.h> |
|
14 |
#endif
|
|
15 |
||
16 |
#ifdef HAVE_PETSC
|
|
17 |
#include <petsc.h> |
|
18 |
#endif
|
|
19 |
||
20 |
extern "C"{ |
|
21 |
#ifdef HAVE_PYTHON
|
|
22 |
#include "python_statec.h" |
|
23 |
#endif
|
|
24 |
void test_pressure_solve_(); |
|
25 |
}
|
|
26 |
||
27 |
int main(int argc, char **argv){ |
|
28 |
||
29 |
#ifdef HAVE_MPI
|
|
30 |
// This must be called before we process any arguments
|
|
31 |
MPI::Init(argc,argv); |
|
32 |
||
33 |
// Undo some MPI init shenanigans
|
|
34 |
chdir(getenv("PWD")); |
|
35 |
#endif
|
|
36 |
||
37 |
#ifdef HAVE_PYTHON
|
|
38 |
// Initialize the Python Interpreter
|
|
39 |
python_init_(); |
|
40 |
#endif
|
|
41 |
||
42 |
#ifdef HAVE_PETSC
|
|
43 |
static char help[] = "Use -help to see the help.\n\n"; |
|
44 |
PetscErrorCode ierr = PetscInitialize(&argc, &argv, NULL, help); |
|
45 |
// PetscInitializeFortran needs to be called when initialising PETSc from C, but calling it from Fortran
|
|
46 |
// This sets all kinds of objects such as PETSC_NULL_OBJECT, PETSC_COMM_WORLD, etc., etc.
|
|
47 |
ierr = PetscInitializeFortran(); |
|
48 |
||
49 |
test_pressure_solve_(); |
|
50 |
PetscFinalize(); |
|
51 |
#ifdef HAVE_PYTHON
|
|
52 |
// Finalize the Python Interpreter
|
|
53 |
python_end_(); |
|
54 |
#endif
|
|
55 |
return 0; |
|
56 |
#else
|
|
57 |
cerr << "ERROR: Not configured with PETSc, so test_pressure_solve is not gonna work!" << endl; |
|
58 |
return 1; |
|
59 |
#endif
|
|
60 |
||
61 |
}
|