YetAnotherCoupler 3.2.0
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) {
65 src_fields[i].masks_idx = src_field_masks_idxs[i];
66 }
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, size_t src_field_idx,
79 size_t ** src_indices, size_t * count) {
80
81 struct yac_dist_grid * dist_grid =
83 interp_grid->grid_pair, interp_grid->src_grid_name);
85 dist_grid, interp_grid->src_fields[src_field_idx],
86 src_indices, count);
87}
88
90 struct yac_interp_grid * interp_grid, size_t ** tgt_indices,
91 size_t * count) {
92
93 struct yac_dist_grid * dist_grid =
95 interp_grid->grid_pair, interp_grid->tgt_grid_name);
97 dist_grid, interp_grid->tgt_field, tgt_indices, count);
98}
99
101 struct yac_interp_grid * interp_grid, enum yac_location location,
102 size_t * src_points, size_t count) {
103
104 struct yac_dist_grid * dist_grid =
106 interp_grid->grid_pair, interp_grid->src_grid_name);
107
108 return
109 yac_dist_grid_get_remote_points(dist_grid, location, src_points, count);
110}
111
113 struct yac_interp_grid * interp_grid, size_t src_field_idx,
114 size_t * src_points, size_t count) {
115
116 return
118 interp_grid, interp_grid->src_fields[src_field_idx].location,
119 src_points, count);
120}
121
123 struct yac_interp_grid * interp_grid, size_t src_field_idx,
124 yac_int * src_global_ids, size_t count, size_t * src_local_ids) {
125
126 struct yac_dist_grid * dist_grid =
128 interp_grid->grid_pair, interp_grid->src_grid_name);
129
131 dist_grid, interp_grid->src_fields[src_field_idx].location,
132 src_global_ids, count, src_local_ids);
133}
134
136 struct yac_interp_grid * interp_grid, yac_int * tgt_global_ids,
137 size_t count, size_t * tgt_local_ids) {
138
139 struct yac_dist_grid * dist_grid =
141 interp_grid->grid_pair, interp_grid->tgt_grid_name);
142
144 dist_grid, interp_grid->tgt_field.location,
145 tgt_global_ids, count, tgt_local_ids);
146}
147
149 struct yac_interp_grid * interp_grid, size_t * tgt_points, size_t count) {
150
151 struct yac_dist_grid * dist_grid =
153 interp_grid->grid_pair, interp_grid->tgt_grid_name);
154
155 return
157 dist_grid, interp_grid->tgt_field.location, tgt_points, count);
158}
159
161 struct yac_interp_grid * interp_grid) {
162
166 interp_grid->grid_pair, interp_grid->tgt_grid_name));
167
168 enum yac_location location = interp_grid->tgt_field.location;
170 (location == YAC_LOC_CELL) ||
171 (location == YAC_LOC_CORNER) ||
172 (location == YAC_LOC_EDGE),
173 "ERROR(get_tgt_grid_global_ids): invalide target location")
174
175 return yac_basic_grid_data->ids[location];
176}
177
179 struct yac_interp_grid * interp_grid) {
180
181 return interp_grid->tgt_field.location;
182}
183
185 struct yac_interp_grid * interp_grid, size_t * src_points, size_t count,
186 size_t src_field_idx, yac_int * src_global_ids) {
187
188 const_yac_int_pointer grid_global_ids =
189 yac_interp_grid_get_src_field_global_ids(interp_grid, src_field_idx);
190
191 for (size_t i = 0; i < count; ++i)
192 src_global_ids[i] = grid_global_ids[src_points[i]];
193}
194
196 struct yac_interp_grid * interp_grid, size_t * tgt_points, size_t count,
197 yac_int * tgt_global_ids) {
198
199 yac_int const * grid_global_ids = get_tgt_grid_global_ids(interp_grid);
200
201 for (size_t i = 0; i < count; ++i)
202 tgt_global_ids[i] = grid_global_ids[tgt_points[i]];
203}
204
206 size_t * points, size_t count, yac_coordinate_pointer coordinates,
207 yac_const_coordinate_pointer grid_coordinates) {
208
210 (grid_coordinates != NULL) || (count == 0),
211 "ERROR(yac_interp_grid_get_coordinates): grid_coordinates == NULL")
212
213 for (size_t i = 0; i < count; ++i)
214 for (int j = 0; j < 3; ++j)
215 coordinates[i][j] = grid_coordinates[points[i]][j];
216}
217
219 struct yac_interp_grid * interp_grid, size_t * src_points, size_t count,
220 size_t src_field_idx, yac_coordinate_pointer src_coordinates) {
221
223 src_points, count, src_coordinates,
224 yac_interp_grid_get_src_field_coords(interp_grid, src_field_idx));
225}
226
228 struct yac_interp_grid * interp_grid, size_t * tgt_points, size_t count,
229 yac_coordinate_pointer tgt_coordinates) {
230
232 tgt_points, count, tgt_coordinates,
234}
235
237 struct yac_interp_grid * interp_grid) {
238
239 return interp_grid->num_src_fields;
240}
241
243 struct yac_interp_grid * interp_grid, size_t src_field_idx) {
244
246 src_field_idx < interp_grid->num_src_fields,
247 "ERROR(yac_interp_grid_get_src_field_location): invalid src_field_idx")
248
249 return interp_grid->src_fields[src_field_idx].location;
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_global_ids): invalid src_field_idx")
258
262 interp_grid->grid_pair, interp_grid->src_grid_name));
263
264 enum yac_location location =
265 interp_grid->src_fields[src_field_idx].location;
267 (location == YAC_LOC_CORNER) ||
268 (location == YAC_LOC_CELL) ||
269 (location == YAC_LOC_EDGE),
270 "ERROR(yac_interp_grid_get_src_field_global_ids): "
271 "invalid source field location")
272 return yac_basic_grid_data->ids[location];
273}
274
276 struct yac_interp_grid * interp_grid, size_t src_field_idx) {
277
279 src_field_idx < interp_grid->num_src_fields,
280 "ERROR(yac_interp_grid_get_src_field_coords): invalid src_field_idx")
281
282 struct yac_dist_grid * dist_grid =
284 interp_grid->grid_pair, interp_grid->src_grid_name);
285
286 return
289 dist_grid, interp_grid->src_fields[src_field_idx]);
290}
291
293 struct yac_interp_grid * interp_grid) {
294
295 struct yac_dist_grid * dist_grid =
297 interp_grid->grid_pair, interp_grid->tgt_grid_name);
298
299 return
301 yac_dist_grid_get_field_coords(dist_grid, interp_grid->tgt_field);
302}
303
305 struct yac_interp_grid * interp_grid, size_t src_field_idx) {
306
308 src_field_idx < interp_grid->num_src_fields,
309 "ERROR(yac_interp_grid_get_src_field_mask): invalid src_field_idx")
310
311 struct yac_dist_grid * dist_grid =
313 interp_grid->grid_pair, interp_grid->src_grid_name);
314
315 return
317 dist_grid, interp_grid->src_fields[src_field_idx]);
318}
319
321 struct yac_interp_grid * interp_grid, yac_coordinate_pointer search_coords,
322 size_t count, size_t * src_cells) {
323
325 interp_grid->grid_pair, interp_grid->src_grid_name, search_coords, count,
326 src_cells);
327}
328
330 struct yac_interp_grid * interp_grid, yac_coordinate_pointer search_coords,
331 size_t count, size_t * src_cells) {
332
334 interp_grid->grid_pair, interp_grid->src_grid_name, search_coords, count,
335 src_cells);
336}
337
339 struct yac_interp_grid * interp_grid, yac_coordinate_pointer search_coords,
340 size_t count, size_t n, size_t * src_points) {
341
343 interp_grid->num_src_fields == 1,
344 "ERROR(yac_interp_grid_do_nnn_search_src): invalid number of source fields")
345
347 interp_grid->grid_pair, interp_grid->src_grid_name, search_coords, count,
348 src_points, n, interp_grid->src_fields[0]);
349}
350
352 struct yac_interp_grid * interp_grid, yac_coordinate_pointer search_coords,
353 size_t count, size_t n, size_t * tgt_points) {
354
356 interp_grid->grid_pair, interp_grid->tgt_grid_name, search_coords, count,
357 tgt_points, n, interp_grid->tgt_field);
358}
359
361 struct yac_interp_grid * interp_grid,
363 size_t count, size_t src_field_idx, size_t ** src_cells,
364 size_t * num_src_per_bnd_circle) {
365
367 src_field_idx < interp_grid->num_src_fields,
368 "ERROR(yac_interp_grid_do_bnd_circle_search_src): invalid src_field_idx")
369
371 interp_grid->src_fields[src_field_idx].location == YAC_LOC_CELL,
372 "ERROR(yac_interp_grid_do_bnd_circle_search_src): "
373 "invalid source field location; has to be YAC_LOC_CELL")
374
376 interp_grid->grid_pair, interp_grid->src_grid_name, bnd_circles, count,
377 src_cells, num_src_per_bnd_circle, interp_grid->src_fields[src_field_idx]);
378}
379
381 struct yac_interp_grid * interp_grid,
383 size_t count, size_t ** tgt_cells, size_t * num_tgt_per_bnd_circle) {
384
386 interp_grid->tgt_field.location == YAC_LOC_CELL,
387 "ERROR(yac_interp_grid_do_bnd_circle_search_tgt): "
388 "invalid target field location; has to be YAC_LOC_CELL")
389
391 interp_grid->grid_pair, interp_grid->tgt_grid_name, bnd_circles, count,
392 tgt_cells, num_tgt_per_bnd_circle, interp_grid->tgt_field);
393}
394
396 struct yac_interp_grid * interp_grid, size_t * tgt_cells, size_t count,
397 size_t ** src_cells, size_t * num_src_per_tgt) {
398
400 interp_grid->num_src_fields == 1,
401 "ERROR(yac_interp_grid_do_cell_search_src): "
402 "invalid number of source fields")
403
405 interp_grid->src_fields[0].location == YAC_LOC_CELL,
406 "ERROR(yac_interp_grid_do_cell_search_src): "
407 "invalid source field location; has to be YAC_LOC_CELL")
408
410 interp_grid->tgt_field.location == YAC_LOC_CELL,
411 "ERROR(yac_interp_grid_do_cell_search_src): "
412 "invalid target field location; has to be YAC_LOC_CELL")
413
415 interp_grid->grid_pair, interp_grid->tgt_grid_name,
416 interp_grid->src_grid_name, tgt_cells, count, src_cells,
417 num_src_per_tgt, interp_grid->src_fields[0]);
418}
419
421 struct yac_interp_grid * interp_grid, size_t * src_cells, size_t count,
422 size_t ** tgt_cells, size_t * num_tgt_per_src) {
423
425 interp_grid->num_src_fields == 1,
426 "ERROR(yac_interp_grid_do_cell_search_tgt): "
427 "invalid number of source fields")
428
430 interp_grid->src_fields[0].location == YAC_LOC_CELL,
431 "ERROR(yac_interp_grid_do_cell_search_tgt): "
432 "invalid source field location; has to be YAC_LOC_CELL")
433
435 interp_grid->tgt_field.location == YAC_LOC_CELL,
436 "ERROR(yac_interp_grid_do_cell_search_tgt): "
437 "invalid target field location; has to be YAC_LOC_CELL")
438
440 interp_grid->grid_pair, interp_grid->src_grid_name,
441 interp_grid->tgt_grid_name, src_cells, count, tgt_cells,
442 num_tgt_per_src, interp_grid->tgt_field);
443}
444
445MPI_Comm yac_interp_grid_get_MPI_Comm(struct yac_interp_grid * interp_grid) {
446
447 return yac_dist_grid_pair_get_MPI_Comm(interp_grid->grid_pair);
448}
449
458
467
469 struct yac_interp_grid * interp_grid, size_t * src_cells, size_t count,
470 size_t * neighbours) {
471
473 interp_grid->grid_pair, interp_grid->src_grid_name, src_cells, count,
474 neighbours);
475}
476
478 struct yac_interp_grid * interp_grid, size_t * tgt_cells, size_t count,
479 size_t * neighbours) {
480
482 interp_grid->grid_pair, interp_grid->tgt_grid_name, tgt_cells, count,
483 neighbours);
484}
485
487 struct yac_interp_grid * interp_grid,
488 size_t * src_corners, size_t count, size_t ** src_cells,
489 size_t * num_cells_per_corner) {
490
492 interp_grid->grid_pair, interp_grid->src_grid_name,
493 src_corners, count, src_cells, num_cells_per_corner);
494}
495
497 struct yac_interp_grid * interp_grid,
498 size_t * tgt_corners, size_t count, size_t ** tgt_cells,
499 size_t * num_cells_per_corner) {
500
502 interp_grid->grid_pair, interp_grid->tgt_grid_name,
503 tgt_corners, count, tgt_cells, num_cells_per_corner);
504}
505
507 struct yac_interp_grid * interp_grid, size_t * cells, size_t count,
508 size_t ** vertex_to_cell, size_t ** vertex_to_cell_offsets,
509 int ** num_cells_per_vertex) {
510
512 interp_grid->num_src_fields == 1,
513 "ERROR(yac_interp_grid_get_aux_grid_src): invalid number of source fields")
514
516 interp_grid->grid_pair, interp_grid->src_grid_name, cells, count,
517 vertex_to_cell, vertex_to_cell_offsets, num_cells_per_vertex,
518 interp_grid->src_fields[0]);
519}
520
522 struct yac_interp_grid * interp_grid, int to_tgt_owner,
523 size_t src_field_idx, size_t ** src_points,
524 size_t ** tgt_points, double ** weights, size_t * count) {
525
527 interp_grid->grid_pair, !to_tgt_owner, 1,
528 interp_grid->src_grid_name, src_points,
529 interp_grid->src_fields[src_field_idx].location,
530 interp_grid->tgt_grid_name, tgt_points,
531 interp_grid->tgt_field.location, weights, count);
532}
533
535 struct yac_interp_grid * interp_grid, size_t * tgt_indices, size_t count,
536 int * owners) {
537
539 interp_grid->grid_pair, interp_grid->tgt_grid_name,
540 tgt_indices, count, interp_grid->tgt_field.location, owners);
541}
542
544 struct yac_interp_grid * interp_grid, size_t * vertices, size_t count,
545 size_t ** neigh_vertices, int * num_neighs_per_vertex) {
546
548 interp_grid->grid_pair, interp_grid->tgt_grid_name,
549 vertices, count, neigh_vertices, num_neighs_per_vertex,
550 interp_grid->tgt_field);
551}
552
554 struct yac_interp_grid * interp_grid, int to_tgt_owner,
555 enum yac_location src_location, size_t ** src_points,
556 size_t ** tgt_points, double ** weights, size_t * count) {
557
559 interp_grid->grid_pair, !to_tgt_owner, 0,
560 interp_grid->src_grid_name, src_points, src_location,
561 interp_grid->tgt_grid_name, tgt_points,
562 interp_grid->tgt_field.location, weights, count);
563}
564
565void yac_interp_grid_delete(struct yac_interp_grid * interp_grid) {
566
567 if (interp_grid == NULL) return;
568
569 free(interp_grid->src_grid_name);
570 free(interp_grid->tgt_grid_name);
571 free(interp_grid);
572}
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:4563
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:2897
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:6719
void yac_dist_grid_get_local_unmasked_points(struct yac_dist_grid *dist_grid, struct yac_interp_field field, size_t **indices, size_t *count)
Definition dist_grid.c:2852
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:4555
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:6299
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:2783
int const * yac_dist_grid_get_field_mask(struct yac_dist_grid *dist_grid, struct yac_interp_field field)
Definition dist_grid.c:2885
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:5750
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:5759
struct yac_const_basic_grid_data * yac_dist_grid_get_basic_grid_data(struct yac_dist_grid *dist_grid)
Definition dist_grid.c:2795
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:6778
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:5037
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:5325
MPI_Comm yac_dist_grid_pair_get_MPI_Comm(struct yac_dist_grid_pair *grid_pair)
Definition dist_grid.c:2778
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:5845
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:6435
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:6385
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)
Definition dist_grid.c:4704
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)
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:89
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_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:77
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)
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_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_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_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
size_t count[3]
Definition dist_grid.c:102
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:120
#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