-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtrixi_controller_simple.c
More file actions
42 lines (32 loc) · 1.22 KB
/
Copy pathtrixi_controller_simple.c
File metadata and controls
42 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdio.h>
#include <trixi.h>
int main ( int argc, char *argv[] ) {
if ( argc < 2 ) {
fprintf(stderr, "ERROR: missing arguments: PROJECT_DIR LIBELIXIR_PATH\n\n");
fprintf(stderr, "usage: %s PROJECT_DIR LIBELIXIR_PATH\n", argv[0]);
return 2;
} else if ( argc < 3 ) {
fprintf(stderr, "ERROR: missing argument: LIBELIXIR_PATH\n\n");
fprintf(stderr, "usage: %s PROJECT_DIR LIBELIXIR_PATH\n", argv[0]);
return 2;
}
// Initialize Trixi
printf("\n*** Trixi controller *** Initialize Trixi\n");
trixi_initialize( argv[1], NULL );
// Set up the Trixi simulation
// We get a handle to use subsequently
printf("\n*** Trixi controller *** Set up Trixi simulation\n");
int handle = trixi_initialize_simulation( argv[2] );
// Main loop
printf("\n*** Trixi controller *** Entering main loop\n");
while ( !trixi_is_finished( handle ) ) {
trixi_step( handle );
}
// Finalize Trixi simulation
printf("\n*** Trixi controller *** Finalize Trixi simulation\n");
trixi_finalize_simulation( handle );
// Finalize Trixi
printf("\n*** Trixi controller *** Finalize Trixi\n");
trixi_finalize();
return 0;
}