#include <stdlib.h>
#include <stdio.h>
#include "read_cube_csv_grid.h"
#include "geometry.h"
#include "utils_common.h"
Go to the source code of this file.
|
#define | _GET_NTH_ARG(_1, _2, _3, _4, _5, N, ...) N |
|
#define | EXPAND(x) x |
|
#define | COUNT_ARGS(...) EXPAND(_GET_NTH_ARG(__VA_ARGS__, 5, 4, 3, 2, 1)) |
|
#define | READ_LINE(format, ...) |
|
◆ _GET_NTH_ARG
#define _GET_NTH_ARG |
( |
| _1, |
|
|
| _2, |
|
|
| _3, |
|
|
| _4, |
|
|
| _5, |
|
|
| N, |
|
|
| ... ) N |
◆ COUNT_ARGS
◆ EXPAND
◆ READ_LINE
#define READ_LINE |
( |
| format, |
|
|
| ... ) |
Value:
fscanf(file, format, __VA_ARGS__) ==
COUNT_ARGS(__VA_ARGS__), \
"ERROR(yac_read_cube_csv_grid_information): " \
"failed while reading a line from file %s", filename)
#define YAC_ASSERT_F(exp, format,...)
Definition at line 19 of file read_cube_csv_grid.c.
◆ close_cube_csv_file()
static void close_cube_csv_file |
( |
FILE * | file | ) |
|
|
static |
◆ open_cube_csv_file()
static FILE * open_cube_csv_file |
( |
const char * | filename | ) |
|
|
static |
◆ yac_read_cube_csv_grid()
reads in an cube sphere grid csv file and generates a struct grid from it
- Parameters
-
[in] | filename | name of the cube sphere grid csv file |
- Returns
- grid structure that contains the cube sphere grid
- Examples
- test_read_cube_csv.c.
Definition at line 64 of file read_cube_csv_grid.c.
◆ yac_read_cube_csv_grid_information()
void yac_read_cube_csv_grid_information |
( |
const char * | filename, |
|
|
int * | nbr_vertices, |
|
|
int * | nbr_cells, |
|
|
int ** | cell_to_vertex, |
|
|
double ** | x_vertices, |
|
|
double ** | y_vertices ) |
reads in an cube sphere grid csv file and return the grid information in a format that is supported by the YAC user interface.
- Parameters
-
[in] | filename | name of the cube sphere grid csv file |
[out] | nbr_vertices | number of vertices in the grid |
[out] | nbr_cells | number of cells in the grid |
[out] | cell_to_vertex | vertex indices for each cell |
[out] | x_vertices | longitudes of vertices |
[out] | y_vertices | latitudes of vertices |
Definition at line 25 of file read_cube_csv_grid.c.