YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
point_selection.c File Reference
#include "string.h"
#include "point_selection.h"
#include "utils_core.h"
#include "yac_mpi_internal.h"
#include "geometry.h"
Include dependency graph for point_selection.c:

Go to the source code of this file.

Data Structures

struct  yac_point_selection
 

Functions

struct yac_point_selectionyac_point_selection_bnd_circle_new (double center_lon, double center_lat, double inc_angle)
 
struct yac_point_selectionyac_point_selection_copy (struct yac_point_selection const *point_select)
 
void yac_point_selection_delete (struct yac_point_selection *point_select)
 
size_t yac_point_selection_get_pack_size (struct yac_point_selection const *point_select, MPI_Comm comm)
 
void yac_point_selection_pack (struct yac_point_selection const *point_select, void *buffer, int buffer_size, int *position, MPI_Comm comm)
 
struct yac_point_selectionyac_point_selection_unpack (void const *buffer, int buffer_size, int *position, MPI_Comm comm)
 
int yac_point_selection_compare (struct yac_point_selection const *a, struct yac_point_selection const *b)
 
static void flag_sort (size_t *array_size_t, yac_coordinate_pointer array_coord, int *flag, size_t false_count)
 
void yac_point_selection_apply (struct yac_point_selection const *point_select, yac_coordinate_pointer point_coords, size_t *point_indices, size_t num_points, size_t *num_selected_points)
 
enum yac_point_selection_type yac_point_selection_get_type (struct yac_point_selection const *point_select)
 
void yac_point_selection_bnd_circle_get_config (struct yac_point_selection const *point_selection, double *center_lon, double *center_lat, double *inc_angle)
 

Function Documentation

◆ flag_sort()

static void flag_sort ( size_t * array_size_t,
yac_coordinate_pointer array_coord,
int * flag,
size_t false_count )
static

Definition at line 221 of file point_selection.c.

Here is the caller graph for this function:

◆ yac_point_selection_apply()

void yac_point_selection_apply ( struct yac_point_selection const * point_select,
yac_coordinate_pointer point_coordinates,
size_t * point_indices,
size_t num_points,
size_t * num_selected_points )

Generates a list of points that match a given point selection criterion.

Parameters
[in]point_selectpoint selection criterion
[in,out]point_coordinatespoint coordinates
[in,out]point_indicesindices of point associated with the provided coordinates
[in]num_pointsnumber of entries in point_indices and point_coordinates
[out]num_selected_pointsnumber of entries in selected_point_indices
Remarks
coordinates and indices of selected points are moved to the end of the respective arrays

Definition at line 248 of file point_selection.c.

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

◆ yac_point_selection_bnd_circle_get_config()

void yac_point_selection_bnd_circle_get_config ( struct yac_point_selection const * point_selection,
double * center_lon,
double * center_lat,
double * inc_angle )

Gets the configuration of a bounding circle point selection

Parameters
[in]point_selectionpoint selection criterion
[out]center_lonlongitude coordinate of the center of the bounding circle (in radians)
[out]center_latlatitude coordinate of the center of the bounding circle (in radians)
[out]inc_anglethe angle between center vector and a vector pointing to any point on the bounding circle (in radians)

Definition at line 307 of file point_selection.c.

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

◆ yac_point_selection_bnd_circle_new()

struct yac_point_selection * yac_point_selection_bnd_circle_new ( double center_lon,
double center_lat,
double inc_angle )

Generates a point selection based on a bounding circle

Parameters
[in]center_lonlongitude coordinate of the center of the bounding circle (in radians)
[in]center_latlatitude coordinate of the center of the bounding circle (in radians)
[in]inc_anglethe angle between center vector and a vector pointing to any point on the bounding circle (in radians)
Returns
point selection
Remarks
use yac_point_selection_delete to delete yac_point_selection

Definition at line 23 of file point_selection.c.

Here is the caller graph for this function:

◆ yac_point_selection_compare()

int yac_point_selection_compare ( struct yac_point_selection const * a,
struct yac_point_selection const * b )

Compares two point selections

Parameters
[in]apoint selection a
[in]bpoint selection b
Returns
-1, 0, or 1 depending on a and b

Definition at line 179 of file point_selection.c.

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

◆ yac_point_selection_copy()

struct yac_point_selection * yac_point_selection_copy ( struct yac_point_selection const * point_select)

Copies a given point selection

Parameters
[in]point_selectpoint selection to be copied
Returns
copy of the provided point selection
Remarks
use yac_point_selection_delete to delete yac_point_selection

Definition at line 48 of file point_selection.c.

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

◆ yac_point_selection_delete()

void yac_point_selection_delete ( struct yac_point_selection * point_select)

Deletes a given point selection

Definition at line 73 of file point_selection.c.

Here is the caller graph for this function:

◆ yac_point_selection_get_pack_size()

size_t yac_point_selection_get_pack_size ( struct yac_point_selection const * point_select,
MPI_Comm comm )

Computes the minimum size required for packing a give point selection using MPI_Pack

Parameters
[in]point_selectpoint selection
[in]commMPI communicator going to be used for the packing
Returns
minimum packing size

Definition at line 77 of file point_selection.c.

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

◆ yac_point_selection_get_type()

enum yac_point_selection_type yac_point_selection_get_type ( struct yac_point_selection const * point_select)

Gets the type of a provided point selection

Parameters
[in]point_selectpoint selection criterion
Returns
point selection type

Definition at line 300 of file point_selection.c.

Here is the caller graph for this function:

◆ yac_point_selection_pack()

void yac_point_selection_pack ( struct yac_point_selection const * point_select,
void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

Packs a given point selection into a buffer using MPI_Pack

Parameters
[in]point_selectpoint selection
[in,out]bufferpacking buffer
[in]buffer_sizesize of packing buffer
[in,out]positioncurrent packing position
[in]commMPI communicator used to communicate the buffer

Definition at line 106 of file point_selection.c.

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

◆ yac_point_selection_unpack()

struct yac_point_selection * yac_point_selection_unpack ( void const * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

Unpack a point selection from a given buffer using MPI_Unpack

Parameters
[in]bufferpacking buffer
[in]buffer_sizebuffer size
[in,out]positioncurrent unpacking position
[in]commMPI communicator used to receive the buffer
Returns
unpacked point selection

Definition at line 140 of file point_selection.c.

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