YetAnotherCoupler 3.2.0_a
Loading...
Searching...
No Matches
Data Structures | Functions
interp_grid.c File Reference
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <yaxt.h>
#include "dist_grid_internal.h"
#include "interp_grid_internal.h"
#include "yac_mpi_internal.h"
#include "geometry.h"
#include "utils_core.h"
#include "sphere_part.h"
Include dependency graph for interp_grid.c:

Go to the source code of this file.

Data Structures

struct  yac_interp_grid
 

Functions

struct yac_interp_gridyac_interp_grid_new (struct yac_dist_grid_pair *grid_pair, char const *src_grid_name, char const *tgt_grid_name, size_t num_src_fields, struct yac_interp_field const *src_fields, struct yac_interp_field const tgt_field)
 
struct yac_interp_gridyac_interp_grid_new_f2c (struct yac_dist_grid_pair *grid_pair, char const *src_grid_name, char const *tgt_grid_name, size_t num_src_fields, int const *src_field_locations, size_t const *src_field_coordinate_idxs, size_t const *src_field_masks_idxs, int tgt_field_location, size_t tgt_field_coordinate_idx, size_t tgt_field_masks_idx)
 
void yac_interp_grid_get_src_points (struct yac_interp_grid *interp_grid, size_t src_field_idx, size_t **src_indices, size_t *count)
 
void yac_interp_grid_get_tgt_points (struct yac_interp_grid *interp_grid, size_t **tgt_indices, size_t *count)
 
struct remote_pointyac_interp_grid_get_src_remote_points2 (struct yac_interp_grid *interp_grid, enum yac_location location, size_t *src_points, size_t count)
 
struct remote_pointyac_interp_grid_get_src_remote_points (struct yac_interp_grid *interp_grid, size_t src_field_idx, size_t *src_points, size_t count)
 
void yac_interp_grid_src_global_to_local (struct yac_interp_grid *interp_grid, size_t src_field_idx, yac_int *src_global_ids, size_t count, size_t *src_local_ids)
 
void yac_interp_grid_tgt_global_to_local (struct yac_interp_grid *interp_grid, yac_int *tgt_global_ids, size_t count, size_t *tgt_local_ids)
 
struct remote_pointyac_interp_grid_get_tgt_remote_points (struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count)
 
static yac_int const * get_tgt_grid_global_ids (struct yac_interp_grid *interp_grid)
 
enum yac_location yac_interp_grid_get_tgt_field_location (struct yac_interp_grid *interp_grid)
 
void yac_interp_grid_get_src_global_ids (struct yac_interp_grid *interp_grid, size_t *src_points, size_t count, size_t src_field_idx, yac_int *src_global_ids)
 
void yac_interp_grid_get_tgt_global_ids (struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, yac_int *tgt_global_ids)
 
static void yac_interp_grid_get_coordinates (size_t *points, size_t count, yac_coordinate_pointer coordinates, yac_const_coordinate_pointer grid_coordinates)
 
void yac_interp_grid_get_src_coordinates (struct yac_interp_grid *interp_grid, size_t *src_points, size_t count, size_t src_field_idx, yac_coordinate_pointer src_coordinates)
 
void yac_interp_grid_get_tgt_coordinates (struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, yac_coordinate_pointer tgt_coordinates)
 
size_t yac_interp_grid_get_num_src_fields (struct yac_interp_grid *interp_grid)
 
enum yac_location yac_interp_grid_get_src_field_location (struct yac_interp_grid *interp_grid, size_t src_field_idx)
 
const_yac_int_pointer yac_interp_grid_get_src_field_global_ids (struct yac_interp_grid *interp_grid, size_t src_field_idx)
 
yac_const_coordinate_pointer yac_interp_grid_get_src_field_coords (struct yac_interp_grid *interp_grid, size_t src_field_idx)
 
yac_const_coordinate_pointer yac_interp_grid_get_tgt_field_coords (struct yac_interp_grid *interp_grid)
 
const_int_pointer yac_interp_grid_get_src_field_mask (struct yac_interp_grid *interp_grid, size_t src_field_idx)
 
void yac_interp_grid_do_points_search (struct yac_interp_grid *interp_grid, yac_coordinate_pointer search_coords, size_t count, size_t *src_cells)
 
void yac_interp_grid_do_points_search_gc (struct yac_interp_grid *interp_grid, yac_coordinate_pointer search_coords, size_t count, size_t *src_cells)
 
void yac_interp_grid_do_nnn_search_src (struct yac_interp_grid *interp_grid, yac_coordinate_pointer search_coords, size_t count, size_t n, size_t *src_points)
 
void yac_interp_grid_do_nnn_search_tgt (struct yac_interp_grid *interp_grid, yac_coordinate_pointer search_coords, size_t count, size_t n, size_t *tgt_points)
 
void yac_interp_grid_do_bnd_circle_search_src (struct yac_interp_grid *interp_grid, const_bounding_circle_pointer bnd_circles, size_t count, size_t src_field_idx, size_t **src_cells, size_t *num_src_per_bnd_circle)
 
void yac_interp_grid_do_bnd_circle_search_tgt (struct yac_interp_grid *interp_grid, const_bounding_circle_pointer bnd_circles, size_t count, size_t **tgt_cells, size_t *num_tgt_per_bnd_circle)
 
void yac_interp_grid_do_cell_search_src (struct yac_interp_grid *interp_grid, size_t *tgt_cells, size_t count, size_t **src_cells, size_t *num_src_per_tgt)
 
void yac_interp_grid_do_cell_search_tgt (struct yac_interp_grid *interp_grid, size_t *src_cells, size_t count, size_t **tgt_cells, size_t *num_tgt_per_src)
 
MPI_Comm yac_interp_grid_get_MPI_Comm (struct yac_interp_grid *interp_grid)
 
struct yac_const_basic_grid_datayac_interp_grid_get_basic_grid_data_src (struct yac_interp_grid *interp_grid)
 
struct yac_const_basic_grid_datayac_interp_grid_get_basic_grid_data_tgt (struct yac_interp_grid *interp_grid)
 
void yac_interp_grid_get_src_cell_neighbours (struct yac_interp_grid *interp_grid, size_t *src_cells, size_t count, size_t *neighbours)
 
void yac_interp_grid_get_tgt_cell_neighbours (struct yac_interp_grid *interp_grid, size_t *tgt_cells, size_t count, size_t *neighbours)
 
void yac_interp_grid_get_src_corner_cells (struct yac_interp_grid *interp_grid, size_t *src_corners, size_t count, size_t **src_cells, size_t *num_cells_per_corner)
 
void yac_interp_grid_get_tgt_corner_cells (struct yac_interp_grid *interp_grid, size_t *tgt_corners, size_t count, size_t **tgt_cells, size_t *num_cells_per_corner)
 
void yac_interp_grid_get_aux_grid_src (struct yac_interp_grid *interp_grid, size_t *cells, size_t count, size_t **vertex_to_cell, size_t **vertex_to_cell_offsets, int **num_cells_per_vertex)
 
void yac_interp_grid_relocate_src_tgt_pairs (struct yac_interp_grid *interp_grid, int to_tgt_owner, size_t src_field_idx, size_t **src_points, size_t **tgt_points, double **weights, size_t *count)
 
void yac_interp_grid_determine_dist_tgt_owners (struct yac_interp_grid *interp_grid, size_t *tgt_indices, size_t count, int *owners)
 
void yac_interp_grid_get_tgt_vertex_neighbours (struct yac_interp_grid *interp_grid, size_t *vertices, size_t count, size_t **neigh_vertices, int *num_neighs_per_vertex)
 
void yac_interp_grid_relocate_src_tgt_pairs_orig (struct yac_interp_grid *interp_grid, int to_tgt_owner, enum yac_location src_location, size_t **src_points, size_t **tgt_points, double **weights, size_t *count)
 
void yac_interp_grid_delete (struct yac_interp_grid *interp_grid)
 

Function Documentation

◆ get_tgt_grid_global_ids()

static yac_int const * get_tgt_grid_global_ids ( struct yac_interp_grid interp_grid)
static

Definition at line 162 of file interp_grid.c.

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

◆ yac_interp_grid_delete()

void yac_interp_grid_delete ( struct yac_interp_grid interp_grid)

◆ yac_interp_grid_determine_dist_tgt_owners()

void yac_interp_grid_determine_dist_tgt_owners ( struct yac_interp_grid interp_grid,
size_t *  tgt_indices,
size_t  count,
int *  owners 
)

Gets the distributed owners of the given target indices

Parameters
[in]interp_gridinterpolation grid
[in]tgt_indiceslocal indices of target points
[in]countnumber of indices in tgt_indices
[out]ownersranks of processes to which the target points in tgt_indices are assigned to by the distributed grid decomposition
Remarks
the user has to ensure that owners is big enough to hold the results for all target points

Definition at line 536 of file interp_grid.c.

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

◆ yac_interp_grid_do_bnd_circle_search_src()

void yac_interp_grid_do_bnd_circle_search_src ( struct yac_interp_grid interp_grid,
const_bounding_circle_pointer  bnd_circles,
size_t  count,
size_t  src_field_idx,
size_t **  src_cells,
size_t *  num_src_per_bnd_circle 
)

search for all source cells matching the provided bounding circles

Parameters
[in]interp_gridinterpolation grid
[in]bnd_circlessearch bounding circles
[in]countnumber of search bounding circles
[in]src_field_idxindex of the source field
[out]src_cellslocal ids of result source points
[out]num_src_per_bnd_circlenumber of result source points per bounding circle
Examples
test_interp_grid_parallel.c.

Definition at line 362 of file interp_grid.c.

Here is the call graph for this function:

◆ yac_interp_grid_do_bnd_circle_search_tgt()

void yac_interp_grid_do_bnd_circle_search_tgt ( struct yac_interp_grid interp_grid,
const_bounding_circle_pointer  bnd_circles,
size_t  count,
size_t **  tgt_cells,
size_t *  num_tgt_per_bnd_circle 
)

search for all target cells matching the provided bounding circles

Parameters
[in]interp_gridinterpolation grid
[in]bnd_circlessearch bounding circles
[in]countnumber of search bounding circles
[out]tgt_cellslocal ids of result target points
[out]num_tgt_per_bnd_circlenumber of result target points per bounding circle

Definition at line 382 of file interp_grid.c.

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

◆ yac_interp_grid_do_cell_search_src()

void yac_interp_grid_do_cell_search_src ( struct yac_interp_grid interp_grid,
size_t *  tgt_cells,
size_t  count,
size_t **  src_cells,
size_t *  num_src_per_tgt 
)

search for all source cells matching the provided target cells

Parameters
[in]interp_gridinterpolation grid
[in]tgt_cellslocal ids of target cells
[in]countnumber of target cells
[out]src_cellslocal ids of result source points
[out]num_src_per_tgtnumber of result source points per target cell

Definition at line 397 of file interp_grid.c.

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

◆ yac_interp_grid_do_cell_search_tgt()

void yac_interp_grid_do_cell_search_tgt ( struct yac_interp_grid interp_grid,
size_t *  src_cells,
size_t  count,
size_t **  tgt_cells,
size_t *  num_tgt_per_src 
)

search for all target cells matching the provided source cells

Parameters
[in]interp_gridinterpolation grid
[in]src_cellslocal ids of source cells
[in]countnumber of source cells
[out]tgt_cellslocal ids of result target points
[out]num_tgt_per_srcnumber of result target points per source cell

Definition at line 422 of file interp_grid.c.

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

◆ yac_interp_grid_do_nnn_search_src()

void yac_interp_grid_do_nnn_search_src ( struct yac_interp_grid interp_grid,
yac_coordinate_pointer  search_coords,
size_t  count,
size_t  n,
size_t *  src_points 
)

does a n-nearest-neighbour search on the source grid

Parameters
[in]interp_gridinterpolation grid
[in]search_coordssearch coordinates
[in]countnumber of search coordinates
[in]nnumber of source points per search coordinate
[out]src_pointslocal ids of result source points
Examples
test_interp_grid_parallel.c.

Definition at line 340 of file interp_grid.c.

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

◆ yac_interp_grid_do_nnn_search_tgt()

void yac_interp_grid_do_nnn_search_tgt ( struct yac_interp_grid interp_grid,
yac_coordinate_pointer  search_coords,
size_t  count,
size_t  n,
size_t *  tgt_points 
)

does a n-nearest-neighbour search on the target grid

Parameters
[in]interp_gridinterpolation grid
[in]search_coordssearch coordinates
[in]countnumber of search coordinates
[in]nnumber of target points per search coordinate
[out]tgt_pointslocal ids of result target points

Definition at line 353 of file interp_grid.c.

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

◆ yac_interp_grid_do_points_search()

void yac_interp_grid_do_points_search ( struct yac_interp_grid interp_grid,
yac_coordinate_pointer  search_coords,
size_t  count,
size_t *  src_cells 
)

search for source cells that map to the provided search coordinates

Parameters
[in]interp_gridinterpolation grid
[in]search_coordssearch coordinates
[in]countnumber of search coordinates
[out]src_cellslocal ids of matching source cells
Remarks
in case for a search coordinate no matching source cell was found, the respective entry in src_cells is SIZE_MAX
Examples
test_interp_grid_parallel.c.

Definition at line 322 of file interp_grid.c.

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

◆ yac_interp_grid_do_points_search_gc()

void yac_interp_grid_do_points_search_gc ( struct yac_interp_grid interp_grid,
yac_coordinate_pointer  search_coords,
size_t  count,
size_t *  src_cells 
)

search for source cells that map to the provided search coordinates

Parameters
[in]interp_gridinterpolation grid
[in]search_coordssearch coordinates
[in]countnumber of search coordinates
[out]src_cellslocal ids of matching source cells
Remarks
in case for a search coordinate no matching source cell was found, the respective entry in src_cells is SIZE_MAX
assumes that all grid edges are on great circle edges

Definition at line 331 of file interp_grid.c.

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

◆ yac_interp_grid_get_aux_grid_src()

void yac_interp_grid_get_aux_grid_src ( struct yac_interp_grid interp_grid,
size_t *  cells,
size_t  count,
size_t **  vertex_to_cell,
size_t **  vertex_to_cell_offsets,
int **  num_cells_per_vertex 
)

generates for all vertices of the source grid the list of all cells surrounding the vertices
vertices not belonging to the selected cells will have a zero entry in num_cells_per_vertex

Parameters
[in]interp_gridinterpolation grid
[in]cellsselected source cells
[in]countnumber of entries in cells
[out]vertex_to_celllist of result cells for all vertices associated to the selected cells
[out]vertex_to_cell_offsetsthe results cells for vertex i can be found at:
vertex_to_cell + vertex_to_cell_offsets[i]
[out]num_cells_per_vertexnumber of result cells for each vertex
Remarks
the result cells for a vertex are sorted in clock- or counter clockwise order
in case a vertex is not fully surrounded by unmasked cells, the respective entry in num_cells_per_vertex is 0
the user is responsible to free the memory returned through the out arrays

Definition at line 508 of file interp_grid.c.

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

◆ yac_interp_grid_get_basic_grid_data_src()

struct yac_const_basic_grid_data * yac_interp_grid_get_basic_grid_data_src ( struct yac_interp_grid interp_grid)

gets the basic grid data of the source grid

Parameters
[in]interp_gridinterpolation grid
Returns
basic grid data
Remarks
the contents of the basic grid data may change by some calls (for example by yac_interp_grid_do_bnd_circle_search_src)
Examples
test_interp_grid_parallel.c.

Definition at line 452 of file interp_grid.c.

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

◆ yac_interp_grid_get_basic_grid_data_tgt()

struct yac_const_basic_grid_data * yac_interp_grid_get_basic_grid_data_tgt ( struct yac_interp_grid interp_grid)

gets the basic grid data of the target grid

Parameters
[in]interp_gridinterpolation grid
Returns
basic grid data
Remarks
the contents of the basic grid data may change by some calls (for example by yac_interp_grid_do_bnd_circle_search_src)
Examples
test_interp_grid_parallel.c.

Definition at line 461 of file interp_grid.c.

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

◆ yac_interp_grid_get_coordinates()

static void yac_interp_grid_get_coordinates ( size_t *  points,
size_t  count,
yac_coordinate_pointer  coordinates,
yac_const_coordinate_pointer  grid_coordinates 
)
static

Definition at line 207 of file interp_grid.c.

Here is the caller graph for this function:

◆ yac_interp_grid_get_MPI_Comm()

MPI_Comm yac_interp_grid_get_MPI_Comm ( struct yac_interp_grid interp_grid)

gets a communicator containing all ranks of the interpolation grid

Parameters
[in]interp_gridinterpolation grid
Returns
comm communicator

Definition at line 447 of file interp_grid.c.

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

◆ yac_interp_grid_get_num_src_fields()

size_t yac_interp_grid_get_num_src_fields ( struct yac_interp_grid interp_grid)

gets the number of source fields in the provided interpolation grid

Parameters
[in]interp_gridinterpolation grid
Returns
number of source fields
Examples
test_interp_grid_parallel.c.

Definition at line 238 of file interp_grid.c.

Here is the caller graph for this function:

◆ yac_interp_grid_get_src_cell_neighbours()

void yac_interp_grid_get_src_cell_neighbours ( struct yac_interp_grid interp_grid,
size_t *  src_cells,
size_t  count,
size_t *  neighbours 
)

gets neighbouring source grid cells for all provided source cells

Parameters
[in]interp_gridinterpolation grid
[in]src_cellslocal ids of source cells for which the neighbours are to be determined
[in]countnumber for entries in src_cells
[out]neighboursneighbours for all edges of all provided source cells
Remarks
the user has to ensure that the array neighbours has the appropriate size, which is the sum of the number of edges for each provided cell
for each provided source cell, this routine sets the neighbours for all edges of the cells
in case there is no neighbour of an edge, the respective entry contains SIZE_MAX
the result cells are sorted in clock- or counter clockwise order

Definition at line 470 of file interp_grid.c.

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

◆ yac_interp_grid_get_src_coordinates()

void yac_interp_grid_get_src_coordinates ( struct yac_interp_grid interp_grid,
size_t *  src_points,
size_t  count,
size_t  src_field_idx,
yac_coordinate_pointer  src_coordinates 
)

gets the coordinates of the selected source points

Parameters
[in]interp_gridinterpolation grid
[in]src_pointslocal ids of the selected source points
[in]countnumber of entries in src_points
[in]src_field_idxindex of the source field
[in]src_coordinatescoordinates of selected source points
Remarks
the user has to ensure that the array associated to src_coordinates is big enough to hold enough elements
if the source field location is YAC_LOC_CORNER and no field coordinates are available/defined, this routine will return a pointer to the vertex coordinates of the source grid

Definition at line 220 of file interp_grid.c.

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

◆ yac_interp_grid_get_src_corner_cells()

void yac_interp_grid_get_src_corner_cells ( struct yac_interp_grid interp_grid,
size_t *  src_corners,
size_t  count,
size_t **  src_cells,
size_t *  num_cells_per_corner 
)

gets for each provided source corner all cells connected to them

Parameters
[in]interp_gridinterpolation grid
[in]src_cornerslocal ids of source corners for which the connected cells are to be determined
[in]countnumber of entries in src_corners
[out]src_cellssource cells connected to the provided source corners
[out]num_cells_per_cornernumber of cells per corner
Remarks
the user has to ensure that the num_cells_per_corner is at least of size "count"
the source cells returned for each source corner are sorted by their global ids
the user is responsible for freeing the src_cells array
Examples
test_interp_grid_parallel.c.

Definition at line 488 of file interp_grid.c.

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

◆ yac_interp_grid_get_src_field_coords()

yac_const_coordinate_pointer yac_interp_grid_get_src_field_coords ( struct yac_interp_grid interp_grid,
size_t  src_field_idx 
)

gets the coordinates of the selected field of all points in the local part of the distributed source grid

Parameters
[in]interp_gridinterpolation grid
[in]src_field_idxindex of the source field
Returns
coordinates for the selected source field
Remarks
if the source field location is YAC_LOC_CORNER and no field coordinates are available/defined, this routine will return a pointer to the vertex coordinates of the source grid
if the source field location is not YAC_LOC_CORNER and no field coordinates are available/defined, this routine will return NULL

Definition at line 277 of file interp_grid.c.

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

◆ yac_interp_grid_get_src_field_global_ids()

const_yac_int_pointer yac_interp_grid_get_src_field_global_ids ( struct yac_interp_grid interp_grid,
size_t  src_field_idx 
)

gets the global ids of the selected field of all points in the local part of the distributed source grid

Parameters
[in]interp_gridinterpolation grid
[in]src_field_idxindex of the source field
Returns
global ids for the selected source field

Definition at line 254 of file interp_grid.c.

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

◆ yac_interp_grid_get_src_field_location()

enum yac_location yac_interp_grid_get_src_field_location ( struct yac_interp_grid interp_grid,
size_t  src_field_idx 
)

gets the location of a source field

Parameters
[in]interp_gridinterpolation grid
[in]src_field_idxindex of the source field
Returns
location of selected source field
Examples
test_interp_grid_parallel.c.

Definition at line 244 of file interp_grid.c.

Here is the caller graph for this function:

◆ yac_interp_grid_get_src_field_mask()

const_int_pointer yac_interp_grid_get_src_field_mask ( struct yac_interp_grid interp_grid,
size_t  src_field_idx 
)

gets the mask of the selected field of all points in the local part of the distributed source grid

Parameters
[in]interp_gridinterpolation grid
[in]src_field_idxindex of the source field
Returns
mask for the selected source field
Remarks
if for the selected field no mask is available/defined, NULL is returned

Definition at line 306 of file interp_grid.c.

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

◆ yac_interp_grid_get_src_global_ids()

void yac_interp_grid_get_src_global_ids ( struct yac_interp_grid interp_grid,
size_t *  src_points,
size_t  count,
size_t  src_field_idx,
yac_int src_global_ids 
)

gets the global ids of the selected source points

Parameters
[in]interp_gridinterpolation grid
[in]src_pointslocal ids of the selected source points
[in]countnumber of entries in src_points
[in]src_field_idxindex of the source field
[in]src_global_idsglobal ids of selected source points
Remarks
the user has to ensure that the array associated to src_global_ids is big enough to hold enough elements
Examples
test_interp_grid_parallel.c.

Definition at line 186 of file interp_grid.c.

Here is the call graph for this function:

◆ yac_interp_grid_get_src_points()

void yac_interp_grid_get_src_points ( struct yac_interp_grid interp_grid,
size_t  src_field_idx,
size_t **  src_indices,
size_t *  count 
)

gets all unmasked points available in the local part of the distributed source grids

Parameters
[in]interp_gridinterpolation grid
[in]src_field_idxindex of the source field
[out]src_indiceslocal indices of all unmasked local source cells
[out]countnumber of entries in src_indices
Remarks
each unmask point of the global source grid is returned only by a single process
Examples
test_interp_grid_parallel.c.

Definition at line 77 of file interp_grid.c.

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

◆ yac_interp_grid_get_src_remote_points()

struct remote_point * yac_interp_grid_get_src_remote_points ( struct yac_interp_grid interp_grid,
size_t  src_field_idx,
size_t *  src_points,
size_t  count 
)

allocates and returns remote_point informations for a list of selected source points

Parameters
[in]interp_gridinterpolation grid
[in]src_field_idxindex of the source field
[in]src_pointslocal ids of selected source points
[in]countnumber of entries in src_points
Returns
remote_point information for the selected source points
Remarks
the user is responsible for freeing the memory allocated for the remote_point information
Examples
test_interp_weights_parallel.c.

Definition at line 112 of file interp_grid.c.

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

◆ yac_interp_grid_get_src_remote_points2()

struct remote_point * yac_interp_grid_get_src_remote_points2 ( struct yac_interp_grid interp_grid,
enum yac_location  location,
size_t *  src_points,
size_t  count 
)

allocates and returns remote_point informations for a list of selected source points

Parameters
[in]interp_gridinterpolation grid
[in]locationlocation for which the remote point info is requested
[in]src_pointslocal ids of selected source points
[in]countnumber of entries in src_points
Returns
remote_point information for the selected source points
Remarks
the user is responsible for freeing the memory allocated for the remote_point information

Definition at line 100 of file interp_grid.c.

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

◆ yac_interp_grid_get_tgt_cell_neighbours()

void yac_interp_grid_get_tgt_cell_neighbours ( struct yac_interp_grid interp_grid,
size_t *  tgt_cells,
size_t  count,
size_t *  neighbours 
)

gets neighbouring target grid cells for all provided target cells

Parameters
[in]interp_gridinterpolation grid
[in]tgt_cellslocal ids of target cells for which the neighbours are to be determined
[in]countnumber for entries in tgt_cells
[out]neighboursneighbours for all edges of all provided target cells
Remarks
the user has to ensure that the array neighbours has the appropriate size, which is the sum of the number of edges for each provided cell
for each provided source cell, this routine sets the neighbours for all edges of the cells
in case there is no neighbour of an edge, the respective entry contains SIZE_MAX
the result cells are sorted in clock- or counter clockwise order

Definition at line 479 of file interp_grid.c.

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

◆ yac_interp_grid_get_tgt_coordinates()

void yac_interp_grid_get_tgt_coordinates ( struct yac_interp_grid interp_grid,
size_t *  tgt_points,
size_t  count,
yac_coordinate_pointer  tgt_coordinates 
)

gets the coordinates of the selected target points

Parameters
[in]interp_gridinterpolation grid
[in]tgt_pointslocal ids of the selected target points
[in]countnumber of entries in tgt_points
[in]tgt_coordinatescoordinates of selected target points
Remarks
the user has to ensure that the array associated to tgt_coordinates is big enough to hold enough elements
if the target field location is YAC_LOC_CORNER and no field coordinates are available/defined, this routine will return a pointer to the vertex coordinates of the source grid
Examples
test_interp_grid_parallel.c.

Definition at line 229 of file interp_grid.c.

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

◆ yac_interp_grid_get_tgt_corner_cells()

void yac_interp_grid_get_tgt_corner_cells ( struct yac_interp_grid interp_grid,
size_t *  tgt_corners,
size_t  count,
size_t **  tgt_cells,
size_t *  num_cells_per_corner 
)

gets for each provided target corner all cells connected to them

Parameters
[in]interp_gridinterpolation grid
[in]tgt_cornerslocal ids of target corners for which the connected cells are to be determined
[in]countnumber of entries in tgt_corners
[out]tgt_cellstarget cells connected to the provided target corners
[out]num_cells_per_cornernumber of cells per corner
Remarks
the user has to ensure that the num_cells_per_corner is at least of size "count"
the target cells returned for each target corner are sorted by their global ids
the user is responsible for freeing the tgt_cells array
Examples
test_interp_grid_parallel.c.

Definition at line 498 of file interp_grid.c.

Here is the call graph for this function:

◆ yac_interp_grid_get_tgt_field_coords()

yac_const_coordinate_pointer yac_interp_grid_get_tgt_field_coords ( struct yac_interp_grid interp_grid)

gets the coordinates of the target field of all points in the local part of the distributed target grid

Parameters
[in]interp_gridinterpolation grid
Returns
coordinates for the target field
Remarks
if the target field location is YAC_LOC_CORNER and no field coordinates are available/defined, this routine will return a pointer to the vertex coordinates of the target grid
if the target field location is not YAC_LOC_CORNER and no field coordinates are available/defined, this routine will return NULL

Definition at line 294 of file interp_grid.c.

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

◆ yac_interp_grid_get_tgt_field_location()

enum yac_location yac_interp_grid_get_tgt_field_location ( struct yac_interp_grid interp_grid)

gets the location of the target field

Parameters
[in]interp_gridinterpolation grid
Returns
location of the target field

Definition at line 180 of file interp_grid.c.

Here is the caller graph for this function:

◆ yac_interp_grid_get_tgt_global_ids()

void yac_interp_grid_get_tgt_global_ids ( struct yac_interp_grid interp_grid,
size_t *  tgt_points,
size_t  count,
yac_int tgt_global_ids 
)

gets the global ids of the selected target points

Parameters
[in]interp_gridinterpolation grid
[in]tgt_pointslocal ids of the selected target points
[in]countnumber of entries in tgt_points
[in]tgt_global_idsglobal ids of selected target points
Remarks
the user has to ensure that the array associated to tgt_global_ids is big enough to hold enough elements
Examples
test_interp_grid_parallel.c, and test_interp_weights_parallel.c.

Definition at line 197 of file interp_grid.c.

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

◆ yac_interp_grid_get_tgt_points()

void yac_interp_grid_get_tgt_points ( struct yac_interp_grid interp_grid,
size_t **  tgt_indices,
size_t *  count 
)

gets all unmasked points available in the local part of the distributed target grids

Parameters
[in]interp_gridinterpolation grid
[out]tgt_indiceslocal indices of all unmasked local target cells
[out]countnumber of entries in tgt_indices
Remarks
each unmask point of the global target grid is returned only by a single process
Examples
test_interp_grid_parallel.c, and test_interp_weights_parallel.c.

Definition at line 89 of file interp_grid.c.

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

◆ yac_interp_grid_get_tgt_remote_points()

struct remote_point * yac_interp_grid_get_tgt_remote_points ( struct yac_interp_grid interp_grid,
size_t *  tgt_points,
size_t  count 
)

allocates and returns remote_point informations for a list of selected target points

Parameters
[in]interp_gridinterpolation grid
[in]tgt_pointslocal ids of selected target points
[in]countnumber of entries in tgt_points
Returns
remote_point information for the selected target points
Remarks
the user is responsible for freeing the memory allocated for the remote_point information
Examples
test_interp_weights_parallel.c.

Definition at line 150 of file interp_grid.c.

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

◆ yac_interp_grid_get_tgt_vertex_neighbours()

void yac_interp_grid_get_tgt_vertex_neighbours ( struct yac_interp_grid interp_grid,
size_t *  vertices,
size_t  count,
size_t **  neigh_vertices,
int *  num_neighs_per_vertex 
)

Determines all non-masked neighour vertices for the selected target vertices

Parameters
[in]interp_gridinterpolation grid
[in]verticeslocal ids of selected vertices
[in]countnumber of entries in vertices
[out]neigh_verticesneighbour vertices
[out]num_neighs_per_vertexnumber of neighbours per vertex
Remarks
the user has to ensure that num_neighs_per_vertex is allocated big enough
the user is responsible for freeing memory associated to neigh_vertices

Definition at line 545 of file interp_grid.c.

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

◆ yac_interp_grid_new()

struct yac_interp_grid * yac_interp_grid_new ( struct yac_dist_grid_pair grid_pair,
char const *  src_grid_name,
char const *  tgt_grid_name,
size_t  num_src_fields,
struct yac_interp_field const *  src_fields,
struct yac_interp_field const  tgt_field 
)

generate a interpolation grid

Parameters
[in]grid_pairdistributed grid pair
[in]src_grid_namename of the source grid
[in]tgt_grid_namename of the target grid
[in]num_src_fieldsnumber of source fields
[in]src_fieldsspecifies the source fields
[in]tgt_fieldspecifies the target field
Returns
interpolation grid
Examples
test_interp_grid_parallel.c, test_interp_method_avg_parallel.c, test_interp_method_callback_parallel.c, test_interp_method_conserv_parallel.c, test_interp_method_creep_parallel.c, test_interp_method_file_parallel.c, test_interp_method_hcsbb_parallel.c, test_interp_method_ncc_parallel.c, test_interp_method_nnn_parallel.c, test_interp_method_nnn_parallel2.c, test_interp_method_rbf_parallel.c, test_interp_method_spmap_parallel.c, test_interp_weights_parallel.c, test_interpolation_parallel1_c.c, test_interpolation_parallel2.c, test_interpolation_parallel3.c, test_interpolation_parallel4.c, and test_interpolation_parallel5.c.

Definition at line 31 of file interp_grid.c.

Here is the caller graph for this function:

◆ yac_interp_grid_new_f2c()

struct yac_interp_grid * yac_interp_grid_new_f2c ( struct yac_dist_grid_pair grid_pair,
char const *  src_grid_name,
char const *  tgt_grid_name,
size_t  num_src_fields,
int const *  src_field_locations,
size_t const *  src_field_coordinate_idxs,
size_t const *  src_field_masks_idxs,
int  tgt_field_location,
size_t  tgt_field_coordinate_idx,
size_t  tgt_field_masks_idx 
)

Definition at line 51 of file interp_grid.c.

Here is the call graph for this function:

◆ yac_interp_grid_relocate_src_tgt_pairs()

void yac_interp_grid_relocate_src_tgt_pairs ( struct yac_interp_grid interp_grid,
int  to_tgt_owner,
size_t  src_field_idx,
size_t **  src_points,
size_t **  tgt_points,
double **  weights,
size_t *  count 
)

Relocates source-target-point-pairs. The flag "to_tgt_owner" determines whether the pairs go to the dist owner process of the target or source points for each pair.

Parameters
[in]interp_gridinterpolation grid
[in]to_tgt_ownerdetermines whether the pairs go to the dist owner process of the target or source points
[in]src_field_idxindex of the source field
[in,out]src_pointslocal ids of the source-part of the point pairs
[in,out]tgt_pointslocal ids of the target-part of the point pairs
[in,out]weightsweights for all point pairs
[in,out]countnumber of point pairs before and after this routine
Remarks
if the pointer weights points to NULL on all processes, no weights will be exchanged

Definition at line 523 of file interp_grid.c.

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

◆ yac_interp_grid_relocate_src_tgt_pairs_orig()

void yac_interp_grid_relocate_src_tgt_pairs_orig ( struct yac_interp_grid interp_grid,
int  to_tgt_owner,
enum yac_location  src_location,
size_t **  src_points,
size_t **  tgt_points,
double **  weights,
size_t *  count 
)

Relocates source-target-point-pairs. The flag "to_tgt_owner" determines whether the pairs go to the orig owner process of the target or source points for each pair.

Parameters
[in]interp_gridinterpolation grid
[in]to_tgt_ownerdetermines whether the pairs go to the dist owner process of the target or source points
[in]src_locationlocation of the source points
[in,out]src_pointslocal ids of the source-part of the point pairs
[in,out]tgt_pointslocal ids of the target-part of the point pairs
[in,out]weightsweights for all point pairs
[in,out]countnumber of point pairs before and after this routine
Remarks
if the pointer weights points to NULL on all processes, no weights will be exchanged
Examples
test_interp_grid_parallel.c.

Definition at line 555 of file interp_grid.c.

Here is the call graph for this function:

◆ yac_interp_grid_src_global_to_local()

void yac_interp_grid_src_global_to_local ( struct yac_interp_grid interp_grid,
size_t  src_field_idx,
yac_int src_global_ids,
size_t  count,
size_t *  src_local_ids 
)

returns the local ids for the provided global source ids

Parameters
[in]interp_gridinterpolation grid
[in]src_field_idxindex of the source field
[in]src_global_idsglobal ids of the selected source points
[in]countnumber of entries in src_global_ids
[out]src_local_idslocal ids of the selected source points
Remarks
the user has to ensure that the array associated to src_local_ids is big enough to hold enough elements
in case one or more selected global source ids are not available in the local data, the local source data will be extended accordingly
Examples
test_interp_weights_parallel.c.

Definition at line 122 of file interp_grid.c.

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

◆ yac_interp_grid_tgt_global_to_local()

void yac_interp_grid_tgt_global_to_local ( struct yac_interp_grid interp_grid,
yac_int tgt_global_ids,
size_t  count,
size_t *  tgt_local_ids 
)

returns the local ids for the provided global target ids

Parameters
[in]interp_gridinterpolation grid
[in]tgt_global_idsglobal ids of the selected target points
[in]countnumber of entries in tgt_global_ids
[out]tgt_local_idslocal ids of the selected target points
Remarks
the user has to ensure that the array associated to tgt_local_ids is big enough to hold enough elements
in case one or more selected global target ids are not available in the local data, the local target data will be extended accordingly

Definition at line 136 of file interp_grid.c.

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