YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
interp_method.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
11#include "interp_method_check.h"
13
15 struct interp_method ** method, struct yac_interp_grid * interp_grid) {
16
18 enum yac_location src_field_locations[num_src_fields];
19 for (size_t i = 0; i < num_src_fields; ++i)
20 src_field_locations[i] =
22 struct yac_interp_weights * weights =
26 src_field_locations, num_src_fields);
27
28 if (*method == NULL) return weights;
29
30 size_t temp_count;
31 size_t * tgt_points;
32 yac_interp_grid_get_tgt_points(interp_grid, &tgt_points, &temp_count);
33
34 size_t final_count = 0;
35 while (*method != NULL) {
36 final_count +=
37 (*method)->vtable->do_search(
38 *method, interp_grid, tgt_points + final_count, temp_count - final_count,
39 weights);
40 ++method;
41 }
42
43 free(tgt_points);
44
45 return weights;
46}
47
49
50 while (*method != NULL) {
51 struct interp_method * curr_method = *method;
52 curr_method->vtable->delete(curr_method);
53 ++method;
54 }
55}
56
enum yac_location yac_interp_grid_get_tgt_field_location(struct yac_interp_grid *interp_grid)
size_t yac_interp_grid_get_num_src_fields(struct yac_interp_grid *interp_grid)
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
MPI_Comm yac_interp_grid_get_MPI_Comm(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)
void yac_interp_method_cleanup()
void yac_interp_method_delete(struct interp_method **method)
struct yac_interp_weights * yac_interp_method_do_search(struct interp_method **method, struct yac_interp_grid *interp_grid)
void yac_interp_method_callback_buf_free()
void yac_interp_method_check_buf_free()
struct yac_interp_weights * yac_interp_weights_new(MPI_Comm comm, enum yac_location tgt_location, enum yac_location *src_locations, size_t num_src_fields)
yac_location
Definition location.h:12
void(* delete)(struct interp_method *method)
struct interp_method_vtable * vtable