YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
interp_grid.c
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifdef HAVE_CONFIG_H
6// Get the definition of the 'restrict' keyword.
7#include "config.h"
8#endif
9
10#include <stdlib.h>
11#include <string.h>
12#include <assert.h>
13#include <yaxt.h>
14
15#include "dist_grid_internal.h"
17#include "yac_mpi_internal.h"
18#include "geometry.h"
19#include "utils_core.h"
20#include "sphere_part.h"
21
30
33 char const * src_grid_name, char const * tgt_grid_name,
34 size_t num_src_fields, struct yac_interp_field const * src_fields,
35 struct yac_interp_field const tgt_field) {
36
37 struct yac_interp_grid * interp_grid =
38 xmalloc(1 * sizeof(*interp_grid) + num_src_fields * sizeof(*src_fields));
39
40 interp_grid->src_grid_name = strdup(src_grid_name);
41 interp_grid->tgt_grid_name = strdup(tgt_grid_name);
42 interp_grid->grid_pair = grid_pair;
43 interp_grid->num_src_fields = num_src_fields;
44 memcpy(&interp_grid->tgt_field, &tgt_field, 1 * sizeof(tgt_field));
45 memcpy(
46 interp_grid->src_fields, src_fields, num_src_fields * sizeof(*src_fields));
47
48 return interp_grid;
49}
50
53 char const * src_grid_name, char const * tgt_grid_name,
54 size_t num_src_fields, int const * src_field_locations,
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) {
59
60 struct yac_interp_field src_fields[num_src_fields];
61 struct yac_interp_field tgt_field;
62 for (size_t i = 0; i < num_src_fields; ++i) {
63 src_fields[i].location = yac_get_location(src_field_locations[i]);
64 src_fields[i].coordinates_idx = src_field_coordinate_idxs[i];
65 src_fields[i].masks_idx = src_field_masks_idxs[i];
66 }
67 tgt_field.location = yac_get_location(tgt_field_location);
68 tgt_field.coordinates_idx = tgt_field_coordinate_idx;
69 tgt_field.masks_idx = tgt_field_masks_idx;
70
71 return
73 grid_pair, src_grid_name, tgt_grid_name, num_src_fields,
74 src_fields, tgt_field);
75}
76
78 struct yac_interp_grid * interp_grid) {
79 return interp_grid->src_grid_name;
80}
81
83 struct yac_interp_grid * interp_grid) {
84 return interp_grid->tgt_grid_name;
85}
86
88 struct yac_interp_grid * interp_grid, size_t src_field_idx,
89 size_t ** src_indices, size_t * count) {
90
91 struct yac_dist_grid * dist_grid =
93 interp_grid->grid_pair, interp_grid->src_grid_name);
95 dist_grid, interp_grid->src_fields[src_field_idx],
96 src_indices, count);
97}
98
100 struct yac_interp_grid * interp_grid, size_t ** tgt_indices,
101 size_t * count) {
102
103 struct yac_dist_grid * dist_grid =
105 interp_grid->grid_pair, interp_grid->tgt_grid_name);
107 dist_grid, interp_grid->tgt_field, tgt_indices, count);
108}
109
111 struct yac_interp_grid * interp_grid, enum yac_location location,
112 size_t * src_points, size_t count) {
113
114 struct yac_dist_grid * dist_grid =
116 interp_grid->grid_pair, interp_grid->src_grid_name);
117
118 return
119 yac_dist_grid_get_remote_points(dist_grid, location, src_points, count);
120}
121
123 struct yac_interp_grid * interp_grid, size_t src_field_idx,
124 size_t * src_points, size_t count) {
125
126 return
128 interp_grid, interp_grid->src_fields[src_field_idx].location,
129 src_points, count);
130}
131
133 struct yac_interp_grid * interp_grid, size_t src_field_idx,
134 yac_int * src_global_ids, size_t count, size_t * src_local_ids) {
135
136 struct yac_dist_grid * dist_grid =
138 interp_grid->grid_pair, interp_grid->src_grid_name);
139
141 dist_grid, interp_grid->src_fields[src_field_idx].location,
142 src_global_ids, count, src_local_ids);
143}
144
146 struct yac_interp_grid * interp_grid, yac_int * tgt_global_ids,
147 size_t count, size_t * tgt_local_ids) {
148
149 struct yac_dist_grid * dist_grid =
151 interp_grid->grid_pair, interp_grid->tgt_grid_name);
152
154 dist_grid, interp_grid->tgt_field.location,
155 tgt_global_ids, count, tgt_local_ids);
156}
157
159 struct yac_interp_grid * interp_grid, size_t * tgt_points, size_t count) {
160
161 struct yac_dist_grid * dist_grid =
163 interp_grid->grid_pair, interp_grid->tgt_grid_name);
164
165 return
167 dist_grid, interp_grid->tgt_field.location, tgt_points, count);
168}
169
171 struct yac_interp_grid * interp_grid) {
172
176 interp_grid->grid_pair, interp_grid->tgt_grid_name));
177
178 enum yac_location location = interp_grid->tgt_field.location;
180 (location == YAC_LOC_CELL) ||
181 (location == YAC_LOC_CORNER) ||
182 (location == YAC_LOC_EDGE),
183 "ERROR(get_tgt_grid_global_ids): invalide target location")
184
185 return yac_basic_grid_data->ids[location];
186}
187
189 struct yac_interp_grid * interp_grid) {
190
191 return interp_grid->tgt_field.location;
192}
193
195 struct yac_interp_grid * interp_grid, size_t * src_points, size_t count,
196 size_t src_field_idx, yac_int * src_global_ids) {
197
198 const_yac_int_pointer grid_global_ids =
199 yac_interp_grid_get_src_field_global_ids(interp_grid, src_field_idx);
200
201 for (size_t i = 0; i < count; ++i)
202 src_global_ids[i] = grid_global_ids[src_points[i]];
203}
204
206 struct yac_interp_grid * interp_grid, size_t * tgt_points, size_t count,
207 yac_int * tgt_global_ids) {
208
209 yac_int const * grid_global_ids = get_tgt_grid_global_ids(interp_grid);
210
211 for (size_t i = 0; i < count; ++i)
212 tgt_global_ids[i] = grid_global_ids[tgt_points[i]];
213}
214
216 size_t * points, size_t count, yac_coordinate_pointer coordinates,
217 yac_const_coordinate_pointer grid_coordinates) {
218
220 (grid_coordinates != NULL) || (count == 0),
221 "ERROR(yac_interp_grid_get_coordinates): grid_coordinates == NULL")
222
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];
226}
227
229 struct yac_interp_grid * interp_grid, size_t * src_points, size_t count,
230 size_t src_field_idx, yac_coordinate_pointer src_coordinates) {
231
233 src_points, count, src_coordinates,
234 yac_interp_grid_get_src_field_coords(interp_grid, src_field_idx));
235}
236
238 struct yac_interp_grid * interp_grid, size_t * tgt_points, size_t count,
239 yac_coordinate_pointer tgt_coordinates) {
240
242 tgt_points, count, tgt_coordinates,
244}
245
247 struct yac_interp_grid * interp_grid) {
248
249 return interp_grid->num_src_fields;
250}
251
253 struct yac_interp_grid * interp_grid, size_t src_field_idx) {
254
256 src_field_idx < interp_grid->num_src_fields,
257 "ERROR(yac_interp_grid_get_src_field_location): invalid src_field_idx")
258
259 return interp_grid->src_fields[src_field_idx].location;
260}
261
263 struct yac_interp_grid * interp_grid, size_t src_field_idx) {
264
266 src_field_idx < interp_grid->num_src_fields,
267 "ERROR(yac_interp_grid_get_src_field_global_ids): invalid src_field_idx")
268
272 interp_grid->grid_pair, interp_grid->src_grid_name));
273
274 enum yac_location location =
275 interp_grid->src_fields[src_field_idx].location;
277 (location == YAC_LOC_CORNER) ||
278 (location == YAC_LOC_CELL) ||
279 (location == YAC_LOC_EDGE),
280 "ERROR(yac_interp_grid_get_src_field_global_ids): "
281 "invalid source field location")
282 return yac_basic_grid_data->ids[location];
283}
284
286 struct yac_interp_grid * interp_grid, size_t src_field_idx) {
287
289 src_field_idx < interp_grid->num_src_fields,
290 "ERROR(yac_interp_grid_get_src_field_coords): invalid src_field_idx")
291
292 struct yac_dist_grid * dist_grid =
294 interp_grid->grid_pair, interp_grid->src_grid_name);
295
296 return
299 dist_grid, interp_grid->src_fields[src_field_idx]);
300}
301
303 struct yac_interp_grid * interp_grid) {
304
305 struct yac_dist_grid * dist_grid =
307 interp_grid->grid_pair, interp_grid->tgt_grid_name);
308
309 return
311 yac_dist_grid_get_field_coords(dist_grid, interp_grid->tgt_field);
312}
313
315 struct yac_interp_grid * interp_grid, size_t src_field_idx) {
316
318 src_field_idx < interp_grid->num_src_fields,
319 "ERROR(yac_interp_grid_get_src_field_mask): invalid src_field_idx")
320
321 struct yac_dist_grid * dist_grid =
323 interp_grid->grid_pair, interp_grid->src_grid_name);
324
325 return
327 dist_grid, interp_grid->src_fields[src_field_idx]);
328}
329
331 struct yac_interp_grid * interp_grid, yac_coordinate_pointer search_coords,
332 size_t count, size_t * src_cells) {
333
335 interp_grid->grid_pair, interp_grid->src_grid_name, search_coords, count,
336 src_cells);
337}
338
340 struct yac_interp_grid * interp_grid, yac_coordinate_pointer search_coords,
341 size_t count, size_t * src_cells) {
342
344 interp_grid->grid_pair, interp_grid->src_grid_name, search_coords, count,
345 src_cells);
346}
347
349 struct yac_interp_grid * interp_grid, yac_coordinate_pointer search_coords,
350 size_t count, size_t n, size_t * src_points, double max_search_distance) {
351
353 interp_grid->num_src_fields == 1,
354 "ERROR(yac_interp_grid_do_nnn_search_src): invalid number of source fields")
355
357 interp_grid->grid_pair, interp_grid->src_grid_name, search_coords, count,
358 src_points, n, interp_grid->src_fields[0], max_search_distance);
359}
360
362 struct yac_interp_grid * interp_grid, yac_coordinate_pointer search_coords,
363 size_t count, size_t n, size_t * tgt_points, double max_search_distance) {
364
366 interp_grid->grid_pair, interp_grid->tgt_grid_name, search_coords, count,
367 tgt_points, n, interp_grid->tgt_field, max_search_distance);
368}
369
371 struct yac_interp_grid * interp_grid,
373 size_t count, size_t src_field_idx, size_t ** src_cells,
374 size_t * num_src_per_bnd_circle) {
375
377 src_field_idx < interp_grid->num_src_fields,
378 "ERROR(yac_interp_grid_do_bnd_circle_search_src): invalid src_field_idx")
379
381 interp_grid->src_fields[src_field_idx].location == YAC_LOC_CELL,
382 "ERROR(yac_interp_grid_do_bnd_circle_search_src): "
383 "invalid source field location; has to be YAC_LOC_CELL")
384
386 interp_grid->grid_pair, interp_grid->src_grid_name, bnd_circles, count,
387 src_cells, num_src_per_bnd_circle, interp_grid->src_fields[src_field_idx]);
388}
389
391 struct yac_interp_grid * interp_grid,
393 size_t count, size_t ** tgt_cells, size_t * num_tgt_per_bnd_circle) {
394
396 interp_grid->tgt_field.location == YAC_LOC_CELL,
397 "ERROR(yac_interp_grid_do_bnd_circle_search_tgt): "
398 "invalid target field location; has to be YAC_LOC_CELL")
399
401 interp_grid->grid_pair, interp_grid->tgt_grid_name, bnd_circles, count,
402 tgt_cells, num_tgt_per_bnd_circle, interp_grid->tgt_field);
403}
404
406 struct yac_interp_grid * interp_grid, size_t * tgt_cells, size_t count,
407 size_t ** src_cells, size_t * num_src_per_tgt) {
408
410 interp_grid->num_src_fields == 1,
411 "ERROR(yac_interp_grid_do_cell_search_src): "
412 "invalid number of source fields")
413
415 interp_grid->src_fields[0].location == YAC_LOC_CELL,
416 "ERROR(yac_interp_grid_do_cell_search_src): "
417 "invalid source field location; has to be YAC_LOC_CELL")
418
420 interp_grid->tgt_field.location == YAC_LOC_CELL,
421 "ERROR(yac_interp_grid_do_cell_search_src): "
422 "invalid target field location; has to be YAC_LOC_CELL")
423
425 interp_grid->grid_pair, interp_grid->tgt_grid_name,
426 interp_grid->src_grid_name, tgt_cells, count, src_cells,
427 num_src_per_tgt, interp_grid->src_fields[0]);
428}
429
431 struct yac_interp_grid * interp_grid, size_t * src_cells, size_t count,
432 size_t ** tgt_cells, size_t * num_tgt_per_src) {
433
435 interp_grid->num_src_fields == 1,
436 "ERROR(yac_interp_grid_do_cell_search_tgt): "
437 "invalid number of source fields")
438
440 interp_grid->src_fields[0].location == YAC_LOC_CELL,
441 "ERROR(yac_interp_grid_do_cell_search_tgt): "
442 "invalid source field location; has to be YAC_LOC_CELL")
443
445 interp_grid->tgt_field.location == YAC_LOC_CELL,
446 "ERROR(yac_interp_grid_do_cell_search_tgt): "
447 "invalid target field location; has to be YAC_LOC_CELL")
448
450 interp_grid->grid_pair, interp_grid->src_grid_name,
451 interp_grid->tgt_grid_name, src_cells, count, tgt_cells,
452 num_tgt_per_src, interp_grid->tgt_field);
453}
454
455MPI_Comm yac_interp_grid_get_MPI_Comm(struct yac_interp_grid * interp_grid) {
456
457 return yac_dist_grid_pair_get_MPI_Comm(interp_grid->grid_pair);
458}
459
468
477
479 struct yac_interp_grid * interp_grid, size_t * src_cells, size_t count,
480 size_t * neighbours) {
481
483 interp_grid->grid_pair, interp_grid->src_grid_name, src_cells, count,
484 neighbours);
485}
486
488 struct yac_interp_grid * interp_grid, size_t * tgt_cells, size_t count,
489 size_t * neighbours) {
490
492 interp_grid->grid_pair, interp_grid->tgt_grid_name, tgt_cells, count,
493 neighbours);
494}
495
497 struct yac_interp_grid * interp_grid,
498 size_t * src_corners, size_t count, size_t ** src_cells,
499 size_t * num_cells_per_corner) {
500
502 interp_grid->grid_pair, interp_grid->src_grid_name,
503 src_corners, count, src_cells, num_cells_per_corner);
504}
505
507 struct yac_interp_grid * interp_grid,
508 size_t * tgt_corners, size_t count, size_t ** tgt_cells,
509 size_t * num_cells_per_corner) {
510
512 interp_grid->grid_pair, interp_grid->tgt_grid_name,
513 tgt_corners, count, tgt_cells, num_cells_per_corner);
514}
515
517 struct yac_interp_grid * interp_grid, size_t * cells, size_t count,
518 size_t ** vertex_to_cell, size_t ** vertex_to_cell_offsets,
519 int ** num_cells_per_vertex) {
520
522 interp_grid->num_src_fields == 1,
523 "ERROR(yac_interp_grid_get_aux_grid_src): invalid number of source fields")
524
526 interp_grid->grid_pair, interp_grid->src_grid_name, cells, count,
527 vertex_to_cell, vertex_to_cell_offsets, num_cells_per_vertex,
528 interp_grid->src_fields[0]);
529}
530
532 struct yac_interp_grid * interp_grid, int to_tgt_owner,
533 size_t src_field_idx, size_t ** src_points,
534 size_t ** tgt_points, double ** weights, size_t * count) {
535
537 interp_grid->grid_pair, !to_tgt_owner, 1,
538 interp_grid->src_grid_name, src_points,
539 interp_grid->src_fields[src_field_idx].location,
540 interp_grid->tgt_grid_name, tgt_points,
541 interp_grid->tgt_field.location, weights, count);
542}
543
545 struct yac_interp_grid * interp_grid, size_t * tgt_indices, size_t count,
546 int * owners) {
547
549 interp_grid->grid_pair, interp_grid->tgt_grid_name,
550 tgt_indices, count, interp_grid->tgt_field.location, owners);
551}
552
554 struct yac_interp_grid * interp_grid, size_t * vertices, size_t count,
555 size_t ** neigh_vertices, int * num_neighs_per_vertex) {
556
558 interp_grid->grid_pair, interp_grid->tgt_grid_name,
559 vertices, count, neigh_vertices, num_neighs_per_vertex,
560 interp_grid->tgt_field);
561}
562
564 struct yac_interp_grid * interp_grid, int to_tgt_owner,
565 enum yac_location src_location, size_t ** src_points,
566 size_t ** tgt_points, double ** weights, size_t * count) {
567
569 interp_grid->grid_pair, !to_tgt_owner, 0,
570 interp_grid->src_grid_name, src_points, src_location,
571 interp_grid->tgt_grid_name, tgt_points,
572 interp_grid->tgt_field.location, weights, count);
573}
574
575void yac_interp_grid_delete(struct yac_interp_grid * interp_grid) {
576
577 if (interp_grid == NULL) return;
578
579 free(interp_grid->src_grid_name);
580 free(interp_grid->tgt_grid_name);
581 free(interp_grid);
582}
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)
Definition dist_grid.c:4245
yac_const_coordinate_pointer yac_dist_grid_get_field_coords(struct yac_dist_grid *dist_grid, struct yac_interp_field field)
Definition dist_grid.c:2545
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)
Definition dist_grid.c:6416
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)
Definition dist_grid.c:4237
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)
Definition dist_grid.c:4414
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)
Definition dist_grid.c:5996
struct yac_dist_grid * yac_dist_grid_pair_get_dist_grid(struct yac_dist_grid_pair *grid_pair, char const *grid_name)
Definition dist_grid.c:2429
int const * yac_dist_grid_get_field_mask(struct yac_dist_grid *dist_grid, struct yac_interp_field field)
Definition dist_grid.c:2533
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)
Definition dist_grid.c:5458
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)
Definition dist_grid.c:2500
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)
Definition dist_grid.c:5467
struct yac_const_basic_grid_data * yac_dist_grid_get_basic_grid_data(struct yac_dist_grid *dist_grid)
Definition dist_grid.c:2441
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)
Definition dist_grid.c:6467
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)
Definition dist_grid.c:4731
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)
Definition dist_grid.c:5045
MPI_Comm yac_dist_grid_pair_get_MPI_Comm(struct yac_dist_grid_pair *grid_pair)
Definition dist_grid.c:2424
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)
Definition dist_grid.c:5549
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)
Definition dist_grid.c:6132
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)
Definition dist_grid.c:6082
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)
Definition interp_grid.c:77
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)
Definition interp_grid.c:99
char const * yac_interp_grid_get_tgt_grid_name(struct yac_interp_grid *interp_grid)
Definition interp_grid.c:82
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)
Definition interp_grid.c:31
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)
Definition interp_grid.c:51
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)
Definition interp_grid.c:87
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)
Definition location.c:44
yac_location
Definition location.h:12
@ YAC_LOC_CORNER
Definition location.h:15
@ YAC_LOC_EDGE
Definition location.h:16
@ YAC_LOC_CELL
Definition location.h:14
#define xmalloc(size)
Definition ppm_xfuncs.h:66
algorithm for searching cells and points on a grid
information (global id and location) about a point that
size_t count[3]
Definition dist_grid.c:111
enum yac_location location
Definition basic_grid.h:18
size_t coordinates_idx
Definition basic_grid.h:19
struct yac_interp_field tgt_field
Definition interp_grid.c:26
size_t num_src_fields
Definition interp_grid.c:27
struct yac_dist_grid_pair * grid_pair
Definition interp_grid.c:25
char * src_grid_name
Definition interp_grid.c:23
struct yac_interp_field src_fields[]
Definition interp_grid.c:28
char * tgt_grid_name
Definition interp_grid.c:24
static struct user_input_data_points ** points
Definition yac.c:136
#define YAC_ASSERT(exp, msg)
Definition yac_assert.h:16
Xt_int yac_int
Definition yac_types.h:15
double const (* yac_const_coordinate_pointer)[3]
Definition yac_types.h:20
double(* yac_coordinate_pointer)[3]
Definition yac_types.h:19