Neko 1.99.2
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
cylinder.c
Go to the documentation of this file.
1#include <string.h>
2#include <jansson.h>
3#include <neko.h>
4
5int main(int argc, char **argv) {
6
7 /* Initialise Neko */
8 neko_init();
10
11 /* Create a Neko case from a JSON file */
12 json_error_t json_error;
13 const char *case_json = json_dumps(json_load_file("cylinder.case", 0,
14 &json_error), JSON_COMPACT);
15 int *neko_case = NULL;
16 neko_case_init(&case_json, strlen(case_json), &neko_case);
17
18 /* To solve the entire case we can call neko_solve() */
19 /* neko_solve(&neko_case); */
20
21 /* To manually step forward in time, call neko_step() */
22 while (neko_case_time(&neko_case) < neko_case_end_time(&neko_case)) {
23 neko_step(&neko_case);
24 }
25
26 /*
27 * To retrive a pointer to the data in a field from Neko's field
28 * registry use neko_field()
29 */
30 neko_real *u = neko_field("u");
31
32 /* Cleanup */
33 neko_case_free(&neko_case);
35}
__global__ void T *__restrict__ T *__restrict__ const T *__restrict__ u
int main(int argc, char **argv)
Definition cylinder.c:5
void neko_step(int **case_iptr)
double neko_real
Definition neko.h:9
void neko_finalize()
void neko_case_init(const char **case_json, int case_len, int **case_iptr)
void neko_init()
void neko_job_info()
void neko_case_free(int **case_iptr)
neko_real * neko_field(char *field_name)
double neko_case_end_time(int **case_iptr)
double neko_case_time(int **case_iptr)