YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
read_cube_csv_grid.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "read_cube_csv_grid.h"
#include "geometry.h"
#include "utils_common.h"
Include dependency graph for read_cube_csv_grid.c:

Go to the source code of this file.

Macros

#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, ...)
 

Functions

static FILE * open_cube_csv_file (const char *filename)
 
static void close_cube_csv_file (FILE *file)
 
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)
 
struct yac_basic_grid_data yac_read_cube_csv_grid (char *filename)
 

Macro Definition Documentation

◆ _GET_NTH_ARG

#define _GET_NTH_ARG ( _1,
_2,
_3,
_4,
_5,
N,
... )   N

Definition at line 16 of file read_cube_csv_grid.c.

◆ COUNT_ARGS

#define COUNT_ARGS ( ...)    EXPAND(_GET_NTH_ARG(__VA_ARGS__, 5, 4, 3, 2, 1))

Definition at line 18 of file read_cube_csv_grid.c.

◆ EXPAND

#define EXPAND ( x)    x

Definition at line 17 of file read_cube_csv_grid.c.

◆ 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 COUNT_ARGS(...)
#define YAC_ASSERT_F(exp, format,...)
Definition yac_assert.h:19

Definition at line 19 of file read_cube_csv_grid.c.

Function Documentation

◆ close_cube_csv_file()

static void close_cube_csv_file ( FILE * file)
static

Definition at line 106 of file read_cube_csv_grid.c.

Here is the caller graph for this function:

◆ open_cube_csv_file()

static FILE * open_cube_csv_file ( const char * filename)
static

Definition at line 94 of file read_cube_csv_grid.c.

Here is the caller graph for this function:

◆ yac_read_cube_csv_grid()

struct yac_basic_grid_data yac_read_cube_csv_grid ( char * filename)

reads in an cube sphere grid csv file and generates a struct grid from it

Parameters
[in]filenamename 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.

Here is the call graph for this function:

◆ 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]filenamename of the cube sphere grid csv file
[out]nbr_verticesnumber of vertices in the grid
[out]nbr_cellsnumber of cells in the grid
[out]cell_to_vertexvertex indices for each cell
[out]x_verticeslongitudes of vertices
[out]y_verticeslatitudes of vertices

Definition at line 25 of file read_cube_csv_grid.c.

Here is the call graph for this function:
Here is the caller graph for this function: