5#ifndef INTERP_METHOD_UTILS_H
6#define INTERP_METHOD_UTILS_H
23 size_t const n,
double * weights,
double const scale);
36 double * weights,
double const dummy);
49 double * weights,
double const dummy);
62 double * weights,
double const gauss_scale);
75 double * weights,
double const rbf_scale);
80#define CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID) \
81 YAC_INTERP_GRID_ASSERT( \
82 INTERP_GRID, yac_interp_grid_get_num_src_fields(INTERP_GRID) != 0, \
83 "Number of source fields is 0.")
85#define CHECK_SRC_FIELD_COUNT_SINGLE(INTERP_GRID) \
86 CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID) \
87 YAC_INTERP_GRID_FIELD_ASSERT_F( \
88 INTERP_GRID, yac_interp_grid_get_num_src_fields(INTERP_GRID) == 1, \
89 "Invalid number of source fields. Got %zu, expected 1.", \
90 yac_interp_grid_get_num_src_fields(INTERP_GRID))
92#define CHECK_SRC_FIELD_LOCATION_CORNER_OR_CELL(INTERP_GRID) \
93 CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID) \
94 YAC_INTERP_GRID_FIELD_ASSERT( \
96 (yac_interp_grid_get_src_field_location(INTERP_GRID, 0) == YAC_LOC_CORNER) || \
97 (yac_interp_grid_get_src_field_location(INTERP_GRID, 0) == YAC_LOC_CELL), \
98 "This interpolation method only supports source fields defined as CORNER or CELL")
100#define CHECK_SRC_FIELD_LOCATION_CELL(INTERP_GRID) \
101 CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID) \
102 YAC_INTERP_GRID_FIELD_ASSERT( \
104 yac_interp_grid_get_src_field_location(INTERP_GRID, 0) == YAC_LOC_CELL, \
105 "This interpolation method only supports source fields defined as CELL")
107#define CHECK_TGT_FIELD_LOCATION_CELL(INTERP_GRID) \
108 YAC_INTERP_GRID_FIELD_ASSERT( \
110 yac_interp_grid_get_tgt_field_location(INTERP_GRID) == YAC_LOC_CELL, \
111 "This interpolation method only supports target fields defined as CELL")
void yac_interp_compute_weights_gauss(double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const gauss_scale)
void yac_interp_compute_weights_avg(double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const dummy)
void(* yac_interp_compute_weights_func)(double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const scale)
void yac_interp_compute_weights_dist(double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const dummy)
void yac_interp_compute_weights_rbf(double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const rbf_scale)
Utility macros and functions for interpolation operators. This file contains utility macros for targe...
double const (* yac_const_coordinate_pointer)[3]