55 size_t const * src_field_coordinate_idxs,
56 size_t const * src_field_masks_idxs,
57 int tgt_field_location,
size_t tgt_field_coordinate_idx,
58 size_t tgt_field_masks_idx) {
62 for (
size_t i = 0; i < num_src_fields; ++i) {
65 src_fields[i].
masks_idx = src_field_masks_idxs[i];
69 tgt_field.
masks_idx = tgt_field_masks_idx;
73 grid_pair, src_grid_name, tgt_grid_name, num_src_fields,
74 src_fields, tgt_field);
89 size_t ** src_indices,
size_t * count) {
95 dist_grid, interp_grid->
src_fields[src_field_idx],
112 size_t * src_points,
size_t count) {
124 size_t * src_points,
size_t count) {
134 yac_int * src_global_ids,
size_t count,
size_t * src_local_ids) {
142 src_global_ids,
count, src_local_ids);
147 size_t count,
size_t * tgt_local_ids) {
155 tgt_global_ids,
count, tgt_local_ids);
159 struct yac_interp_grid * interp_grid,
size_t * tgt_points,
size_t count) {
183 "ERROR(get_tgt_grid_global_ids): invalide target location")
196 size_t src_field_idx,
yac_int * src_global_ids) {
201 for (
size_t i = 0; i <
count; ++i)
202 src_global_ids[i] = grid_global_ids[src_points[i]];
211 for (
size_t i = 0; i <
count; ++i)
212 tgt_global_ids[i] = grid_global_ids[tgt_points[i]];
220 (grid_coordinates != NULL) || (
count == 0),
221 "ERROR(yac_interp_grid_get_coordinates): grid_coordinates == NULL")
223 for (
size_t i = 0; i <
count; ++i)
224 for (
int j = 0; j < 3; ++j)
225 coordinates[i][j] = grid_coordinates[
points[i]][j];
233 src_points,
count, src_coordinates,
242 tgt_points,
count, tgt_coordinates,
256 src_field_idx < interp_grid->num_src_fields,
257 "ERROR(yac_interp_grid_get_src_field_location): invalid src_field_idx")
266 src_field_idx < interp_grid->num_src_fields,
267 "ERROR(yac_interp_grid_get_src_field_global_ids): invalid src_field_idx")
280 "ERROR(yac_interp_grid_get_src_field_global_ids): "
281 "invalid source field location")
289 src_field_idx < interp_grid->num_src_fields,
290 "ERROR(yac_interp_grid_get_src_field_coords): invalid src_field_idx")
299 dist_grid, interp_grid->
src_fields[src_field_idx]);
318 src_field_idx < interp_grid->num_src_fields,
319 "ERROR(yac_interp_grid_get_src_field_mask): invalid src_field_idx")
327 dist_grid, interp_grid->
src_fields[src_field_idx]);
332 size_t count,
size_t * src_cells) {
341 size_t count,
size_t * src_cells) {
350 size_t count,
size_t n,
size_t * src_points,
double max_search_distance) {
354 "ERROR(yac_interp_grid_do_nnn_search_src): invalid number of source fields")
358 src_points, n, interp_grid->
src_fields[0], max_search_distance);
363 size_t count,
size_t n,
size_t * tgt_points,
double max_search_distance) {
367 tgt_points, n, interp_grid->
tgt_field, max_search_distance);
373 size_t count,
size_t src_field_idx,
size_t ** src_cells,
374 size_t * num_src_per_bnd_circle) {
377 src_field_idx < interp_grid->num_src_fields,
378 "ERROR(yac_interp_grid_do_bnd_circle_search_src): invalid src_field_idx")
382 "ERROR(yac_interp_grid_do_bnd_circle_search_src): "
383 "invalid source field location; has to be YAC_LOC_CELL")
387 src_cells, num_src_per_bnd_circle, interp_grid->
src_fields[src_field_idx]);
393 size_t count,
size_t ** tgt_cells,
size_t * num_tgt_per_bnd_circle) {
397 "ERROR(yac_interp_grid_do_bnd_circle_search_tgt): "
398 "invalid target field location; has to be YAC_LOC_CELL")
402 tgt_cells, num_tgt_per_bnd_circle, interp_grid->
tgt_field);
407 size_t ** src_cells,
size_t * num_src_per_tgt) {
411 "ERROR(yac_interp_grid_do_cell_search_src): "
412 "invalid number of source fields")
416 "ERROR(yac_interp_grid_do_cell_search_src): "
417 "invalid source field location; has to be YAC_LOC_CELL")
421 "ERROR(yac_interp_grid_do_cell_search_src): "
422 "invalid target field location; has to be YAC_LOC_CELL")
432 size_t ** tgt_cells,
size_t * num_tgt_per_src) {
436 "ERROR(yac_interp_grid_do_cell_search_tgt): "
437 "invalid number of source fields")
441 "ERROR(yac_interp_grid_do_cell_search_tgt): "
442 "invalid source field location; has to be YAC_LOC_CELL")
446 "ERROR(yac_interp_grid_do_cell_search_tgt): "
447 "invalid target field location; has to be YAC_LOC_CELL")
452 num_tgt_per_src, interp_grid->
tgt_field);
480 size_t * neighbours) {
489 size_t * neighbours) {
498 size_t * src_corners,
size_t count,
size_t ** src_cells,
499 size_t * num_cells_per_corner) {
503 src_corners,
count, src_cells, num_cells_per_corner);
508 size_t * tgt_corners,
size_t count,
size_t ** tgt_cells,
509 size_t * num_cells_per_corner) {
513 tgt_corners,
count, tgt_cells, num_cells_per_corner);
518 size_t ** vertex_to_cell,
size_t ** vertex_to_cell_offsets,
519 int ** num_cells_per_vertex) {
523 "ERROR(yac_interp_grid_get_aux_grid_src): invalid number of source fields")
527 vertex_to_cell, vertex_to_cell_offsets, num_cells_per_vertex,
533 size_t src_field_idx,
size_t ** src_points,
534 size_t ** tgt_points,
double ** weights,
size_t *
count) {
537 interp_grid->
grid_pair, !to_tgt_owner, 1,
555 size_t ** neigh_vertices,
int * num_neighs_per_vertex) {
559 vertices,
count, neigh_vertices, num_neighs_per_vertex,
566 size_t ** tgt_points,
double ** weights,
size_t *
count) {
569 interp_grid->
grid_pair, !to_tgt_owner, 0,
577 if (interp_grid == NULL)
return;
void yac_dist_grid_pair_do_point_search_gc(struct yac_dist_grid_pair *grid_pair, char const *grid_name, yac_coordinate_pointer search_coords, size_t count, size_t *cells)
yac_const_coordinate_pointer yac_dist_grid_get_field_coords(struct yac_dist_grid *dist_grid, struct yac_interp_field field)
void yac_dist_grid_pair_determine_dist_owner(struct yac_dist_grid_pair *grid_pair, char const *grid_name, size_t *points, size_t count, enum yac_location location, int *ranks)
void yac_dist_grid_pair_do_point_search(struct yac_dist_grid_pair *grid_pair, char const *grid_name, yac_coordinate_pointer search_coords, size_t count, size_t *cells)
void yac_dist_grid_pair_do_nnn_search(struct yac_dist_grid_pair *grid_pair, char const *grid_name, yac_coordinate_pointer search_coords, size_t count, size_t *local_ids, size_t n, struct yac_interp_field field, double max_search_distance)
void yac_dist_grid_pair_get_vertex_neighbours(struct yac_dist_grid_pair *grid_pair, char const *grid_name, size_t *vertices, size_t count, size_t **neigh_vertices_, int *num_neighs_per_vertex, struct yac_interp_field field)
struct yac_dist_grid * yac_dist_grid_pair_get_dist_grid(struct yac_dist_grid_pair *grid_pair, char const *grid_name)
int const * yac_dist_grid_get_field_mask(struct yac_dist_grid *dist_grid, struct yac_interp_field field)
void yac_dist_grid_pair_get_cell_neighbours(struct yac_dist_grid_pair *grid_pair, char const *grid_name, size_t *cells, size_t count, size_t *neighbours)
void yac_dist_grid_get_local_unmasked_points(struct yac_dist_grid *dist_grid, struct yac_interp_field field, size_t **indices, size_t *num_indices)
struct remote_point * yac_dist_grid_get_remote_points(struct yac_dist_grid *dist_grid, enum yac_location location, size_t *points, size_t count)
struct yac_const_basic_grid_data * yac_dist_grid_get_basic_grid_data(struct yac_dist_grid *dist_grid)
void yac_dist_grid_pair_relocate_point_pairs(struct yac_dist_grid_pair *grid_pair, int a_is_ref, int to_dist_owner, char const *grid_name_a, size_t **points_a, enum yac_location location_a, char const *grid_name_b, size_t **points_b, enum yac_location location_b, double **weights, size_t *count)
void yac_dist_grid_pair_do_bnd_circle_search(struct yac_dist_grid_pair *grid_pair, char const *grid_name, const_bounding_circle_pointer bnd_circles, size_t count, size_t **cells, size_t *num_results_per_bnd_circle, struct yac_interp_field field)
void yac_dist_grid_pair_do_cell_search(struct yac_dist_grid_pair *grid_pair, char const *search_grid_name, char const *result_grid_name, size_t *search_cells, size_t count, size_t **result_cells, size_t *num_results_per_search_cell, struct yac_interp_field result_field)
MPI_Comm yac_dist_grid_pair_get_MPI_Comm(struct yac_dist_grid_pair *grid_pair)
void yac_dist_grid_global_to_local(struct yac_dist_grid *dist_grid, enum yac_location location, yac_int *global_ids, size_t count, size_t *local_ids)
void yac_dist_grid_pair_get_aux_grid(struct yac_dist_grid_pair *grid_pair, char const *grid_name, size_t *cells, size_t count, size_t **vertex_to_cell, size_t **vertex_to_cell_offsets_, int **num_cells_per_vertex_, struct yac_interp_field field)
void yac_dist_grid_pair_get_corner_cells(struct yac_dist_grid_pair *grid_pair, char const *grid_name, size_t *vertices, size_t count, size_t **vertex_to_cell, size_t *num_cells_per_vertex)
int const * const_int_pointer
struct bounding_circle const *const const_bounding_circle_pointer
yac_int const * const_yac_int_pointer
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_get_tgt_cell_neighbours(struct yac_interp_grid *interp_grid, size_t *tgt_cells, size_t count, size_t *neighbours)
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)
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)
enum yac_location yac_interp_grid_get_tgt_field_location(struct yac_interp_grid *interp_grid)
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)
size_t yac_interp_grid_get_num_src_fields(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)
char const * yac_interp_grid_get_src_grid_name(struct yac_interp_grid *interp_grid)
void yac_interp_grid_delete(struct yac_interp_grid *interp_grid)
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_get_tgt_points(struct yac_interp_grid *interp_grid, size_t **tgt_indices, size_t *count)
char const * yac_interp_grid_get_tgt_grid_name(struct yac_interp_grid *interp_grid)
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_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_global_ids(struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, yac_int *tgt_global_ids)
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)
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)
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)
const_yac_int_pointer yac_interp_grid_get_src_field_global_ids(struct yac_interp_grid *interp_grid, size_t src_field_idx)
MPI_Comm yac_interp_grid_get_MPI_Comm(struct yac_interp_grid *interp_grid)
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)
struct remote_point * yac_interp_grid_get_tgt_remote_points(struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count)
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)
enum yac_location yac_interp_grid_get_src_field_location(struct yac_interp_grid *interp_grid, size_t src_field_idx)
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)
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)
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, double max_search_distance)
yac_const_coordinate_pointer yac_interp_grid_get_src_field_coords(struct yac_interp_grid *interp_grid, size_t src_field_idx)
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_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_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_get_tgt_coordinates(struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, yac_coordinate_pointer tgt_coordinates)
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)
yac_const_coordinate_pointer yac_interp_grid_get_tgt_field_coords(struct yac_interp_grid *interp_grid)
struct yac_const_basic_grid_data * yac_interp_grid_get_basic_grid_data_tgt(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_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, double max_search_distance)
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)
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_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)
static yac_int const * get_tgt_grid_global_ids(struct yac_interp_grid *interp_grid)
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)
static void yac_interp_grid_get_coordinates(size_t *points, size_t count, yac_coordinate_pointer coordinates, yac_const_coordinate_pointer grid_coordinates)
struct yac_const_basic_grid_data * yac_interp_grid_get_basic_grid_data_src(struct yac_interp_grid *interp_grid)
enum yac_location yac_get_location(int const location)
algorithm for searching cells and points on a grid
information (global id and location) about a point that
enum yac_location location
struct yac_interp_field tgt_field
struct yac_dist_grid_pair * grid_pair
struct yac_interp_field src_fields[]
static struct user_input_data_points ** points
#define YAC_ASSERT(exp, msg)
double const (* yac_const_coordinate_pointer)[3]
double(* yac_coordinate_pointer)[3]