YetAnotherCoupler 3.2.0_a
Loading...
Searching...
No Matches
Functions
grid_cell.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "grid_cell.h"
#include "utils_core.h"
#include "ensure_array_size.h"
#include "geometry.h"
Include dependency graph for grid_cell.c:

Go to the source code of this file.

Functions

void yac_init_grid_cell (struct yac_grid_cell *cell)
 
static void ensure_grid_cell_size (struct yac_grid_cell *cell, size_t num_corners)
 
void yac_copy_grid_cell (struct yac_grid_cell in_cell, struct yac_grid_cell *out_cell)
 
void yac_free_grid_cell (struct yac_grid_cell *cell)
 
static void set_triangle (struct yac_grid_cell cell, struct yac_grid_cell *triangle, size_t idx[3])
 
void yac_triangulate_cell (struct yac_grid_cell cell, size_t start_corner, struct yac_grid_cell *triangles)
 
void yac_triangulate_cell_indices (size_t const *corner_indices, size_t num_corners, size_t start_corner, size_t(*triangle_indices)[3])
 

Function Documentation

◆ ensure_grid_cell_size()

static void ensure_grid_cell_size ( struct yac_grid_cell cell,
size_t  num_corners 
)
static

Definition at line 22 of file grid_cell.c.

Here is the caller graph for this function:

◆ set_triangle()

static void set_triangle ( struct yac_grid_cell  cell,
struct yac_grid_cell triangle,
size_t  idx[3] 
)
static

Definition at line 52 of file grid_cell.c.

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

◆ yac_copy_grid_cell()

void yac_copy_grid_cell ( struct yac_grid_cell  in_cell,
struct yac_grid_cell out_cell 
)

copies a given grid cell

Parameters
[in]in_cellcell to be copied
[out]out_cellcopied cell
Remarks
out_cell needs to be a cell that has previously been initialised or a cell that already contains valid data

Definition at line 34 of file grid_cell.c.

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

◆ yac_free_grid_cell()

void yac_free_grid_cell ( struct yac_grid_cell cell)

frees all memory associated with a grid_cell object and reinitialised the cell

Parameters
[in,out]cell
Examples
test_area.c, test_basic_grid_data.c, test_cell_bnd_circle.c, test_clipping.c, test_compute_overlap_area.c, test_grid2vtk.c, test_interp_grid_parallel.c, test_lat_clipping.c, test_partial_areas.c, and test_point_in_cell.c.

Definition at line 44 of file grid_cell.c.

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

◆ yac_init_grid_cell()

void yac_init_grid_cell ( struct yac_grid_cell cell)

initiates a grid_cell object before the first being used a grid_cell object has to be initialised

Parameters
[in]cellobject to be initialised
See also
free_grid_cell
get_grid_cell
Examples
test_area.c, test_basic_grid_data.c, test_clipping.c, test_interp_grid_parallel.c, and test_lat_clipping.c.

Definition at line 14 of file grid_cell.c.

Here is the caller graph for this function:

◆ yac_triangulate_cell()

void yac_triangulate_cell ( struct yac_grid_cell  cell,
size_t  start_corner,
struct yac_grid_cell triangles 
)

splits given cell into triangles

Parameters
[in]cellcell to be triangulated
[in]start_cornerstart algorithm at corner with this index (0 <= start_corner < n; with n being number of cell corners)
[out]trianglestriangles that are the result of the triangulation
Remarks
the user needs to provide (n-2) initialised grid_cells for the argument triangles (n being the number of cell corners of the cell)
this routine currently only works for convex grid cells
the algorithm ignores that actual edge types for cells with more than 3 corners and assumes them to be great circle edges

Definition at line 66 of file grid_cell.c.

Here is the call graph for this function:

◆ yac_triangulate_cell_indices()

void yac_triangulate_cell_indices ( size_t const *  corner_indices,
size_t  num_corners,
size_t  start_corner,
size_t(*)  triangle_indices[3] 
)

splits given indices of a cell into triangles

Parameters
[in]corner_indicescell corner indices to be triangulated
[in]num_cornersnumber of corners of the cell
[in]start_cornerstart algorithm at corner with this index (0 <= start_corner < n; with n being number of cell corners)
[out]triangle_indicestriangle indices that are the result of the triangulation
Remarks
the user needs to provide provide an array of size 3*(num_corners-2) for the argument triangle_indices

Definition at line 144 of file grid_cell.c.

Here is the caller graph for this function: