109 xmalloc(1 *
sizeof(*interp_stack_copy));
110 interp_stack_copy->
size = interp_stack->
size;
111 interp_stack_copy->
config =
113 for (
size_t i = 0; i < interp_stack_copy->
size; ++i)
115 interp_stack_copy->
config + i, interp_stack->
config + i);
116 return interp_stack_copy;
136 "ERROR(%s): invalid interpolation type", routine)
140 struct yac_spmap_cell_area_config a,
struct yac_spmap_cell_area_config b) {
143 if ((ret = ((
int)(a.cell_area_provider) > (
int)(b.cell_area_provider)) -
144 ((
int)(a.cell_area_provider) < (
int)(b.cell_area_provider))))
147 switch (a.cell_area_provider) {
151 ((
int)(a.sphere_radius) > (
int)(b.sphere_radius)) -
152 ((int)(a.sphere_radius) < (int)(b.sphere_radius));
155 if ((ret = strcmp(a.file_config.filename, b.file_config.filename)))
157 if ((ret = strcmp(a.file_config.varname, b.file_config.varname)))
160 ((
int)(a.file_config.min_global_id) >
161 (
int)(b.file_config.min_global_id)) -
162 ((int)(a.file_config.min_global_id) <
163 (int)(b.file_config.min_global_id));
172 if ((ret = ((
int)(a.
type) > (
int)(b.
type)) - ((
int)(a.
type) < (
int)(b.
type))))
180 void const * a_,
void const * b_) {
188 a->
general.
type,
"yac_interp_stack_config_entry_compare");
190 b->
general.
type,
"yac_interp_stack_config_entry_compare");
193 "ERROR(yac_interp_stack_config_entry_compare): "
194 "interpolation type is undefined");
354 size_t stack_size = a->
size;
355 for (
size_t method_idx = 0; method_idx < stack_size; ++method_idx)
366 size_t interp_stack_size = interp_stack->
size;
368 xmalloc((interp_stack_size + 1) *
sizeof(*method_stack));
369 method_stack[interp_stack_size] = NULL;
371 for (
size_t i = 0; i < interp_stack_size; ++i) {
377 "ERROR(yac_interp_stack_config_generate): "
378 "unsupported interpolation method")
384 int partial_coverage =
393 int enforced_conserv =
395 int partial_coverage =
402 order, enforced_conserv, partial_coverage, normalisation);
425 void * constructor_user_data;
427 void * do_search_user_data;
431 &constructor_callback, &constructor_user_data);
438 constructor_callback, constructor_user_data,
446 n_nearest_neighbor.
config);
458 radial_basis_function.
config);
501 char const *
string, MPI_Comm comm) {
503 int strlen_pack_size, string_pack_size;
504 yac_mpi_call(MPI_Pack_size(1, MPI_INT, comm, &strlen_pack_size), comm);
507 string != NULL,
"ERROR(yac_interp_stack_config_get_string_pack_size): "
512 (
int)(strlen(
string)), MPI_CHAR, comm, &string_pack_size), comm);
514 return (
size_t)strlen_pack_size + (size_t)string_pack_size;
518 struct yac_spmap_cell_area_config cell_area_config, MPI_Comm comm) {
520 int int_pack_size, dbl_pack_size;
521 yac_mpi_call(MPI_Pack_size(1, MPI_INT, comm, &int_pack_size), comm);
522 yac_mpi_call(MPI_Pack_size(1, MPI_DOUBLE, comm, &dbl_pack_size), comm);
524 size_t pack_size = (size_t)int_pack_size;
526 switch (cell_area_config.cell_area_provider) {
529 pack_size += (size_t)dbl_pack_size;
535 cell_area_config.file_config.filename, comm) +
537 cell_area_config.file_config.varname, comm) +
549 int int_pack_size, dbl_pack_size;
550 yac_mpi_call(MPI_Pack_size(1, MPI_INT, comm, &int_pack_size), comm);
551 yac_mpi_call(MPI_Pack_size(1, MPI_DOUBLE, comm, &dbl_pack_size), comm);
555 "yac_interp_stack_config_get_entry_pack_size");
558 "ERROR(yac_interp_stack_config_get_entry_pack_size): "
559 "invalid interpolation type")
563 return (
size_t)int_pack_size +
564 (size_t)int_pack_size +
565 (
size_t)int_pack_size;
568 return (
size_t)int_pack_size +
569 (size_t)int_pack_size +
570 (
size_t)int_pack_size +
571 (size_t)dbl_pack_size +
572 (
size_t)dbl_pack_size;
574 return (
size_t)int_pack_size +
575 (size_t)int_pack_size +
576 (
size_t)int_pack_size +
577 (size_t)int_pack_size +
578 (
size_t)int_pack_size;
580 return (
size_t)int_pack_size +
581 (size_t)dbl_pack_size +
582 (
size_t)dbl_pack_size +
583 (size_t)int_pack_size +
584 (
size_t)int_pack_size +
590 return (
size_t)int_pack_size +
591 (size_t)dbl_pack_size;
593 return (
size_t)int_pack_size;
595 return (
size_t)int_pack_size +
596 (size_t)int_pack_size +
597 (
size_t)int_pack_size +
601 return (
size_t)int_pack_size +
607 return (
size_t)int_pack_size +
608 (size_t)int_pack_size;
610 return (
size_t)int_pack_size +
615 return (
size_t)int_pack_size +
616 (size_t)int_pack_size +
617 (
size_t)int_pack_size;
625 yac_mpi_call(MPI_Pack_size(1, MPI_INT, comm, &size_pack_size), comm);
627 size_t config_pack_size = 0;
629 for (
size_t i = 0; i < interp_stack->
size; ++i)
632 interp_stack->
config + i, comm);
634 return (
size_t)size_pack_size + config_pack_size;
638 char const *
string,
void *
buffer,
int buffer_size,
int * position,
641 size_t len = (
string == NULL)?0:strlen(
string);
644 len <= INT_MAX,
"ERROR(yac_interp_stack_config_pack_string): string too long")
646 int len_int = (int)len;
650 &len_int, 1, MPI_INT,
buffer, buffer_size, position, comm), comm);
655 string, len_int, MPI_CHAR,
buffer, buffer_size, position, comm),
660 struct yac_spmap_cell_area_config cell_area_config,
661 void *
buffer,
int buffer_size,
int * position, MPI_Comm comm) {
663 int cell_area_provider = (int)(cell_area_config.cell_area_provider);
666 &cell_area_provider, 1, MPI_INT,
buffer, buffer_size, position, comm), comm);
668 switch (cell_area_config.cell_area_provider) {
673 &(cell_area_config.sphere_radius), 1, MPI_DOUBLE,
674 buffer, buffer_size, position, comm), comm);
679 cell_area_config.file_config.filename,
680 buffer, buffer_size, position, comm);
682 cell_area_config.file_config.varname,
683 buffer, buffer_size, position, comm);
685 (cell_area_config.file_config.min_global_id >= -INT_MAX) &&
686 (cell_area_config.file_config.min_global_id <= INT_MAX),
687 "ERRROR(yac_spmap_cell_area_config_pack): invalid minimum global id");
688 int min_global_id = (int)(cell_area_config.file_config.min_global_id);
691 &min_global_id, 1, MPI_INT,
buffer, buffer_size, position, comm),
700 void *
buffer,
int buffer_size,
int * position, MPI_Comm comm) {
704 MPI_Pack(&
type, 1, MPI_INT,
buffer, buffer_size, position, comm), comm);
708 "yac_interp_stack_config_pack_entry");
711 "ERROR(yac_interp_stack_config_pack_entry): "
712 "invalid interpolation type")
719 &reduction_type, 1, MPI_INT,
buffer, buffer_size, position, comm),
724 buffer, buffer_size, position, comm), comm);
731 "ERROR(yac_interp_stack_config_pack_entry): "
732 "n_nearest_neighbor.config.n bigger than INT_MAX")
736 &
type, 1, MPI_INT,
buffer, buffer_size, position, comm), comm);
740 &n, 1, MPI_INT,
buffer, buffer_size, position, comm), comm);
744 MPI_DOUBLE,
buffer, buffer_size, position, comm), comm);
748 buffer, buffer_size, position, comm), comm);
755 buffer, buffer_size, position, comm), comm);
759 buffer, buffer_size, position, comm), comm);
763 buffer, buffer_size, position, comm), comm);
767 &normalisation, 1, MPI_INT,
buffer, buffer_size, position, comm),
775 buffer, buffer_size, position, comm), comm);
779 buffer, buffer_size, position, comm), comm);
788 &scale_type, 1, MPI_INT,
buffer, buffer_size, position, comm),
800 buffer, buffer_size, position, comm), comm);
831 buffer, buffer_size, position, comm), comm);
837 buffer, buffer_size, position, comm);
849 buffer, buffer_size, position, comm), comm);
857 void *
buffer,
int buffer_size,
int * position, MPI_Comm comm) {
859 int stack_size = (int)(interp_stack->
size);
862 &stack_size, 1, MPI_INT,
863 buffer, buffer_size, position, comm), comm);
865 for (
size_t i = 0; i < interp_stack->
size; ++i)
867 interp_stack->
config + i,
buffer, buffer_size, position, comm);
871 void *
buffer,
int buffer_size,
int * position,
872 char *
string,
int max_string_len, MPI_Comm comm) {
877 buffer, buffer_size, position, &string_len, 1, MPI_INT, comm), comm);
881 "ERROR(yac_interp_stack_config_unpack_n_string): invalid string length")
884 string_len < max_string_len,
885 "ERROR(yac_interp_stack_config_unpack_n_string): string length to long")
890 buffer, buffer_size, position,
string, string_len, MPI_CHAR, comm),
892 string[string_len] =
'\0';
896 void *
buffer,
int buffer_size,
int * position, MPI_Comm comm) {
901 buffer, buffer_size, position, &string_len, 1, MPI_INT, comm), comm);
905 "ERROR(yac_interp_stack_config_unpack_string): invalid string length")
907 char *
string = NULL;
908 if (string_len > 0) {
909 string =
xmalloc((
size_t)(string_len + 1) *
sizeof(*
string));
912 buffer, buffer_size, position,
string, string_len, MPI_CHAR, comm),
914 string[string_len] =
'\0';
920 void *
buffer,
int buffer_size,
int * position,
921 struct yac_spmap_cell_area_config * cell_area_config, MPI_Comm comm) {
923 int cell_area_provider;
926 buffer, buffer_size, position, &cell_area_provider, 1, MPI_INT, comm),
928 cell_area_config->cell_area_provider =
931 switch (cell_area_config->cell_area_provider) {
936 buffer, buffer_size, position,
937 &(cell_area_config->sphere_radius), 1, MPI_DOUBLE, comm), comm);
938 cell_area_config->file_config.filename = NULL;
939 cell_area_config->file_config.varname = NULL;
940 cell_area_config->file_config.min_global_id = 0;
944 cell_area_config->sphere_radius = 0.0;
945 cell_area_config->file_config.filename =
947 buffer, buffer_size, position, comm);
948 cell_area_config->file_config.varname =
950 buffer, buffer_size, position, comm);
954 buffer, buffer_size, position, &min_global_id, 1, MPI_INT, comm),
956 cell_area_config->file_config.min_global_id = (size_t)min_global_id;
962 void *
buffer,
int buffer_size,
int * position,
968 buffer, buffer_size, position, &
type, 1, MPI_INT, comm), comm);
974 "yac_interp_stack_config_unpack_entry");
977 "ERROR(yac_interp_stack_config_unpack_entry): "
978 "invalid interpolation type")
985 buffer, buffer_size, position, &reduction_type, 1, MPI_INT, comm),
992 1, MPI_INT, comm), comm);
1000 buffer, buffer_size, position, &
type, 1, MPI_INT, comm), comm);
1006 buffer, buffer_size, position, &n, 1, MPI_INT, comm), comm);
1009 "ERROR(yac_interp_stack_config_unpack_entry): "
1010 "invalid n_nearest_neighbor.config.n")
1014 buffer, buffer_size, position,
1016 1, MPI_DOUBLE, comm), comm);
1019 buffer, buffer_size, position,
1021 1, MPI_DOUBLE, comm), comm);
1027 buffer, buffer_size, position,
1031 buffer, buffer_size, position,
1035 buffer, buffer_size, position,
1040 buffer, buffer_size, position, &normalisation, 1, MPI_INT, comm),
1049 buffer, buffer_size, position,
1053 buffer, buffer_size, position,
1065 buffer, buffer_size, position, &scale_type, 1, MPI_INT, comm),
1078 buffer, buffer_size, position,
1079 &(entry->
fixed.
value), 1, MPI_DOUBLE, comm), comm);
1100 buffer, buffer_size, position,
1106 buffer, buffer_size, position,
1109 buffer, buffer_size, position,
1116 buffer, buffer_size, position,
1122 buffer, buffer_size, position,
1137 buffer, buffer_size, position,
1139 1, MPI_INT, comm), comm);
1146 void *
buffer,
int buffer_size,
int * position, MPI_Comm comm) {
1151 buffer, buffer_size, position, &stack_size, 1, MPI_INT, comm), comm);
1155 "ERROR(yac_interp_stack_config_unpack_interp_stack): invalid stack size")
1160 interp_stack->
size = (size_t)stack_size;
1162 xmalloc((
size_t)stack_size *
sizeof(*interp_stack->
config));
1164 for (
int i = 0; i < stack_size; ++i)
1166 buffer, buffer_size, position, interp_stack->
config + (
size_t)i, comm);
1168 return interp_stack;
1174 xmalloc(1 *
sizeof(*interp_stack_config));
1175 interp_stack_config->
config = NULL;
1176 interp_stack_config->
size = 0;
1178 return interp_stack_config;
1194 for (
size_t i = 0; i < interp_stack_config->
size; ++i)
1196 free(interp_stack_config->
config);
1197 free(interp_stack_config);
1204 interp_stack_config->
size++;
1205 interp_stack_config->
config =
1207 interp_stack_config->
config,
1208 interp_stack_config->
size *
sizeof(*(interp_stack_config->
config)));
1210 return interp_stack_config->
config + (interp_stack_config->
size - 1);
1233 "ERROR(yac_interp_stack_config_add_average_f2c): "
1234 "reduction_type must be one of "
1235 "YAC_INTERP_AVG_ARITHMETIC/YAC_INTERP_AVG_DIST/YAC_INTERP_AVG_BARY");
1261 "ERROR(yac_interp_stack_config_add_ncc_f2c): "
1262 "weight_type must be one of "
1263 "YAC_INTERP_NCC_AVG/YAC_INTERP_NCC_DIST");
1284 .data.rbf_scale = scale};
1290 .data.rbf_scale = scale};
1296 size_t n,
double max_search_distance,
double scale) {
1303 int type,
size_t n,
double max_search_distance,
double scale) {
1311 "ERROR(yac_interp_stack_config_add_nnn_f2c): "
1312 "type must be one of YAC_INTERP_NNN_AVG/YAC_INTERP_NNN_DIST/"
1313 "YAC_INTERP_NNN_GAUSS/YAC_INTERP_NNN_RBF/YAC_INTERP_NNN_ZERO.")
1317 max_search_distance, scale);
1322 int order,
int enforced_conserv,
int partial_coverage,
1343 "ERROR(yac_interp_stack_config_add_conservative_f2c): "
1344 "type must be one of "
1345 "YAC_INTERP_CONSERV_DESTAREA/YAC_INTERP_CONSERV_FRACAREA.")
1353 double sphere_radius, char const * filename,
1354 char const * varname,
int min_global_id,
char const *
type) {
1357 (sphere_radius == 0.0) ||
1358 ((sphere_radius != 0.0) &&
1359 ((filename == NULL) && (varname == NULL))),
1360 "ERROR(yac_spmap_cell_area_config_set): "
1361 "%s sphere_radius != 0.0, but filename and varname are not NULL",
type);
1363 (sphere_radius != 0.0) ||
1364 ((sphere_radius == 0.0) &&
1365 ((filename != NULL) && (strlen(filename) > 0) && (filename[0] !=
'\0') &&
1366 (varname != NULL) && (strlen(varname) > 0) && (varname[0] !=
'\0'))),
1367 "ERROR(yac_spmap_cell_area_config_set): "
1368 "%s sphere_radius == 0.0, but filename and/or varname are invalid",
type);
1370 struct yac_spmap_cell_area_config cell_area_config;
1371 if (sphere_radius != 0.0)
1376 switch (cell_area_config.cell_area_provider) {
1381 sphere_radius > 0.0,
1382 "ERROR(yac_spmap_cell_area_config_set): "
1383 "invalid %s sphere_radius (%.6lf)",
type, sphere_radius)
1384 cell_area_config.sphere_radius = sphere_radius;
1385 cell_area_config.file_config.filename = NULL;
1386 cell_area_config.file_config.varname = NULL;
1387 cell_area_config.file_config.min_global_id = 0;
1392 cell_area_config.sphere_radius = 0.0;
1393 cell_area_config.file_config.filename = strdup(filename);
1394 cell_area_config.file_config.varname = strdup(varname);
1395 cell_area_config.file_config.min_global_id = (
yac_int)min_global_id;
1399 return cell_area_config;
1404 double spread_distance,
double max_search_distance,
1407 double src_sphere_radius,
char const * src_filename,
1408 char const * src_varname,
int src_min_global_id,
1409 double tgt_sphere_radius,
char const * tgt_filename,
1410 char const * tgt_varname,
int tgt_min_global_id) {
1422 src_sphere_radius, src_filename,
1423 src_varname, src_min_global_id,
"source");
1426 tgt_sphere_radius, tgt_filename,
1427 tgt_varname, tgt_min_global_id,
"target");
1434 double src_sphere_radius,
char const * src_filename,
1435 char const * src_varname,
int src_min_global_id,
1436 double tgt_sphere_radius,
char const * tgt_filename,
1437 char const * tgt_varname,
int tgt_min_global_id) {
1442 "ERROR(yac_interp_stack_config_add_spmap_f2c): "
1443 "weight_type must be one of "
1444 "YAC_INTERP_SPMAP_AVG/YAC_INTERP_SPMAP_DIST.")
1451 "ERROR(yac_interp_stack_config_add_spmap_f2c): "
1452 "scale_type must be one of "
1453 "YAC_INTERP_SPMAP_NONE/YAC_INTERP_SPMAP_SRCAREA/"
1454 "YAC_INTERP_SPMAP_INVTGTAREA/YAC_INTERP_SPMAP_FRACAREA.")
1456 if (src_filename && (src_filename[0] ==
'\0')) src_filename = NULL;
1457 if (src_varname && (src_varname[0] ==
'\0')) src_varname = NULL;
1458 if (tgt_filename && (tgt_filename[0] ==
'\0')) tgt_filename = NULL;
1459 if (tgt_varname && (tgt_varname[0] ==
'\0')) tgt_varname = NULL;
1465 src_sphere_radius, src_filename, src_varname, src_min_global_id,
1466 tgt_sphere_radius, tgt_filename, tgt_varname, tgt_min_global_id);
1479 char const *
string,
char const * file,
int line,
char const * routine,
1480 char const * variable) {
1483 string != NULL,
"ERROR(%s:%d:%s): %s is NULL",
1484 file, line, routine, variable)
1487 "ERROR(%s:%d:%s): %s is too long", file, line, routine, variable)
1498 "yac_interp_stack_config_add_user_file",
"filename");
1517 "ERROR(yac_interp_stack_config_add_user_file_f2c): "
1518 "on_missing_file must be one of "
1519 "YAC_INTERP_FILE_MISSING_ERROR/YAC_INTERP_FILE_MISSING_CONT.")
1523 "ERROR(yac_interp_stack_config_add_user_file_f2c): "
1524 "on_success must be one of "
1525 "YAC_INTERP_FILE_SUCCESS_STOP/YAC_INTERP_FILE_SUCCESS_CONT.")
1549 "ERROR(yac_interp_stack_config_add_check): "
1550 "constructor_key name \"%s\" is too long "
1554 "ERROR(yac_interp_stack_config_add_check): "
1555 "do_search_key name \"%s\" is too long "
1592 "yac_interp_stack_config_add_user_callback",
1593 "func_compute_weights_key");
1606 return interp_stack->
size;
1612 size_t interp_stack_idx) {
1615 interp_stack_idx < interp_stack->size,
1616 "ERROR(yac_interp_stack_config_get_entry): "
1617 "invalid interpolation stack index");
1619 return interp_stack->
config + interp_stack_idx;
1636 "ERROR(yac_interp_stack_config_entry_get_average): "
1637 "wrong interpolation stack entry type");
1649 "ERROR(yac_interp_stack_config_entry_get_ncc): "
1650 "wrong interpolation stack entry type");
1665 "ERROR(yac_interp_stack_config_entry_get_nnn): "
1666 "wrong interpolation stack entry type");
1682 "ERROR(yac_interp_stack_config_entry_get_conservative): "
1683 "wrong interpolation stack entry type");
1696 double * src_sphere_radius,
char const ** src_filename,
1697 char const ** src_varname,
int * src_min_global_id,
1698 double * tgt_sphere_radius,
char const ** tgt_filename,
1699 char const ** tgt_varname,
int * tgt_min_global_id) {
1703 "ERROR(yac_interp_stack_config_entry_get_spmap): "
1704 "wrong interpolation stack entry type");
1715 *src_min_global_id =
1722 *tgt_min_global_id =
1734 "ERROR(yac_interp_stack_config_entry_get_user_file): "
1735 "wrong interpolation stack entry type");
1748 "ERROR(yac_interp_stack_config_entry_get_fixed): "
1749 "wrong interpolation stack entry type");
1760 "ERROR(yac_interp_stack_config_entry_get_check): "
1761 "wrong interpolation stack entry type");
1773 "ERROR(yac_interp_stack_config_entry_get_creep): "
1774 "wrong interpolation stack entry type");
1785 "ERROR(yac_interp_stack_config_entry_get_user_callback): "
1786 "wrong interpolation stack entry type");
#define YAC_ASSERT(exp, msg)
enum yac_interp_file_on_missing_file on_missing_file
enum yac_interp_file_on_success on_success
struct interp_method * yac_interp_method_avg_new(enum yac_interp_avg_weight_type weight_type, int partial_coverage)
yac_interp_avg_weight_type
@ YAC_INTERP_AVG_ARITHMETIC
void yac_interp_method_callback_get_compute_weights_callback(char const *key, yac_func_compute_weights *compute_weights_callback, void **user_data)
struct interp_method * yac_interp_method_callback_new(yac_func_compute_weights compute_weights_callback, void *user_data)
static size_t do_search_callback(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights, int *interpolation_complete)
void(* yac_func_compute_weights)(double const tgt_coords[3], int src_cell_id, size_t src_cell_idx, int const **global_results_points, double **result_weights, size_t *result_count, void *user_data)
void yac_interp_method_check_get_do_search_callback(char const *key, func_do_search *do_search_callback, void **user_data)
void yac_interp_method_check_get_constructor_callback(char const *key, func_constructor *constructor_callback, void **user_data)
struct interp_method * yac_interp_method_check_new(func_constructor constructor_callback, void *constructor_user_data, func_do_search do_search_callback, void *do_search_user_data)
void(* func_do_search)(yac_int const *global_ids, double const (*coordinates_xyz)[3], size_t count, void *user_data)
void(* func_constructor)(void *user_data)
struct interp_method * yac_interp_method_conserv_new(int order, int enforced_conserv, int partial_coverage, enum yac_interp_method_conserv_normalisation normalisation)
yac_interp_method_conserv_normalisation
@ YAC_INTERP_CONSERV_DESTAREA
@ YAC_INTERP_CONSERV_FRACAREA
struct interp_method * yac_interp_method_creep_new(int creep_distance)
struct interp_method * yac_interp_method_file_new(char const *weight_file_name, enum yac_interp_file_on_missing_file on_missing_file, enum yac_interp_file_on_success on_success)
yac_interp_file_on_missing_file
@ YAC_INTERP_FILE_MISSING_CONT
continue on missing file
@ YAC_INTERP_FILE_MISSING_ERROR
abort on missing file
yac_interp_file_on_success
@ YAC_INTERP_FILE_SUCCESS_CONT
@ YAC_INTERP_FILE_SUCCESS_STOP
struct interp_method * yac_interp_method_fixed_new(double value)
struct interp_method * yac_interp_method_hcsbb_new()
struct interp_method * yac_interp_method_ncc_new(enum yac_interp_ncc_weight_type weight_type, int partial_coverage)
yac_interp_ncc_weight_type
@ YAC_INTERP_NCC_DIST
distance weighted average of n source points
@ YAC_INTERP_NCC_AVG
average of n source points
struct interp_method * yac_interp_method_nnn_new(struct yac_nnn_config config)
yac_interp_nnn_weight_type
@ YAC_INTERP_NNN_GAUSS
distance with Gauss weights of n source points
@ YAC_INTERP_NNN_RBF
radial basis functions
@ YAC_INTERP_NNN_AVG
average of n source points
@ YAC_INTERP_NNN_DIST
distance weighted average of n source points
@ YAC_INTERP_NNN_ZERO
all weights are set to zero
struct interp_method * yac_interp_method_spmap_new(double spread_distance, double max_search_distance, enum yac_interp_spmap_weight_type weight_type, struct yac_spmap_scale_config scale_config)
yac_interp_spmap_scale_type
@ YAC_INTERP_SPMAP_NONE
weights are not scaled
@ YAC_INTERP_SPMAP_INVTGTAREA
@ YAC_INTERP_SPMAP_SRCAREA
@ YAC_INTERP_SPMAP_FRACAREA
yac_interp_spmap_cell_area_provider
@ YAC_INTERP_SPMAP_CELL_AREA_FILE
@ YAC_INTERP_SPMAP_CELL_AREA_YAC
yac_interp_spmap_weight_type
void yac_interp_stack_config_entry_get_creep(union yac_interp_stack_config_entry const *interp_stack_entry, int *creep_distance)
void yac_interp_stack_config_add_check(struct yac_interp_stack_config *interp_stack_config, char const *constructor_key, char const *do_search_key)
size_t yac_interp_stack_config_get_size(struct yac_interp_stack_config *interp_stack)
int yac_interp_stack_config_compare(void const *a_, void const *b_)
static union yac_interp_stack_config_entry * yac_interp_stack_config_add_entry(struct yac_interp_stack_config *interp_stack_config)
static void yac_spmap_cell_area_config_unpack(void *buffer, int buffer_size, int *position, struct yac_spmap_cell_area_config *cell_area_config, MPI_Comm comm)
static void yac_spmap_cell_area_config_pack(struct yac_spmap_cell_area_config cell_area_config, void *buffer, int buffer_size, int *position, MPI_Comm comm)
static struct yac_spmap_cell_area_config yac_spmap_cell_area_config_set(double sphere_radius, char const *filename, char const *varname, int min_global_id, char const *type)
union yac_interp_stack_config_entry const * yac_interp_stack_config_get_entry(struct yac_interp_stack_config *interp_stack, size_t interp_stack_idx)
static void yac_interp_stack_config_pack_string(char const *string, void *buffer, int buffer_size, int *position, MPI_Comm comm)
enum yac_interpolation_list yac_interp_stack_config_entry_get_type(union yac_interp_stack_config_entry const *interp_stack_entry)
void yac_interp_stack_config_add_spmap(struct yac_interp_stack_config *interp_stack_config, double spread_distance, double max_search_distance, enum yac_interp_spmap_weight_type weight_type, enum yac_interp_spmap_scale_type scale_type, double src_sphere_radius, char const *src_filename, char const *src_varname, int src_min_global_id, double tgt_sphere_radius, char const *tgt_filename, char const *tgt_varname, int tgt_min_global_id)
void yac_interp_stack_config_add_fixed(struct yac_interp_stack_config *interp_stack_config, double value)
void yac_interp_stack_config_add_hcsbb(struct yac_interp_stack_config *interp_stack_config)
void yac_interp_stack_config_add_rbf(struct yac_interp_stack_config *interp_stack_config, size_t n, double max_search_distance, double scale)
void yac_interp_stack_config_add_average(struct yac_interp_stack_config *interp_stack_config, enum yac_interp_avg_weight_type reduction_type, int partial_coverage)
static void yac_interp_stack_config_pack_entry(union yac_interp_stack_config_entry *entry, void *buffer, int buffer_size, int *position, MPI_Comm comm)
void yac_interp_stack_config_add_creep(struct yac_interp_stack_config *interp_stack_config, int creep_distance)
static size_t yac_interp_stack_config_get_string_pack_size(char const *string, MPI_Comm comm)
void yac_interp_stack_config_entry_get_user_file(union yac_interp_stack_config_entry const *interp_stack_entry, char const **filename, enum yac_interp_file_on_missing_file *on_missing_file, enum yac_interp_file_on_success *on_success)
static int yac_spmap_cell_area_config_compare(struct yac_spmap_cell_area_config a, struct yac_spmap_cell_area_config b)
static size_t yac_spmap_cell_area_config_get_pack_size(struct yac_spmap_cell_area_config cell_area_config, MPI_Comm comm)
static int yac_spmap_scale_config_compare(struct yac_spmap_scale_config a, struct yac_spmap_scale_config b)
void yac_interp_stack_config_add_nnn(struct yac_interp_stack_config *interp_stack_config, enum yac_interp_nnn_weight_type type, size_t n, double max_search_distance, double scale)
void yac_interp_stack_config_add_spmap_f2c(struct yac_interp_stack_config *interp_stack_config, double spread_distance, double max_search_distance, int weight_type, int scale_type, double src_sphere_radius, char const *src_filename, char const *src_varname, int src_min_global_id, double tgt_sphere_radius, char const *tgt_filename, char const *tgt_varname, int tgt_min_global_id)
void yac_interp_stack_config_entry_get_ncc(union yac_interp_stack_config_entry const *interp_stack_entry, enum yac_interp_ncc_weight_type *type, int *partial_coverage)
void yac_interp_stack_config_add_conservative_f2c(struct yac_interp_stack_config *interp_stack_config, int order, int enforced_conserv, int partial_coverage, int normalisation)
static void yac_interp_stack_config_unpack_entry(void *buffer, int buffer_size, int *position, union yac_interp_stack_config_entry *entry, MPI_Comm comm)
struct yac_interp_stack_config * yac_interp_stack_config_unpack(void *buffer, int buffer_size, int *position, MPI_Comm comm)
void yac_interp_stack_config_add_ncc_f2c(struct yac_interp_stack_config *interp_stack_config, int weight_type, int partial_coverage)
static void check_interpolation_type(enum yac_interpolation_list type, char const *routine)
void yac_interp_stack_config_delete(struct yac_interp_stack_config *interp_stack_config)
void yac_interp_stack_config_entry_get_user_callback(union yac_interp_stack_config_entry const *interp_stack_entry, char const **func_compute_weights_key)
struct yac_interp_stack_config * yac_interp_stack_config_copy(struct yac_interp_stack_config *interp_stack)
void yac_interp_stack_config_add_conservative(struct yac_interp_stack_config *interp_stack_config, int order, int enforced_conserv, int partial_coverage, enum yac_interp_method_conserv_normalisation normalisation)
void yac_interp_stack_config_entry_get_check(union yac_interp_stack_config_entry const *interp_stack_entry, char const **constructor_key, char const **do_search_key)
static int yac_interp_stack_config_entry_compare(void const *a_, void const *b_)
struct interp_method ** yac_interp_stack_config_generate(struct yac_interp_stack_config *interp_stack)
void yac_interp_stack_config_entry_get_conservative(union yac_interp_stack_config_entry const *interp_stack_entry, int *order, int *enforced_conserv, int *partial_coverage, enum yac_interp_method_conserv_normalisation *normalisation)
static char * yac_interp_stack_config_unpack_string(void *buffer, int buffer_size, int *position, MPI_Comm comm)
void yac_interp_stack_config_entry_get_average(union yac_interp_stack_config_entry const *interp_stack_entry, enum yac_interp_avg_weight_type *reduction_type, int *partial_coverage)
size_t yac_interp_stack_config_get_pack_size(struct yac_interp_stack_config *interp_stack, MPI_Comm comm)
void yac_interp_stack_config_add_average_f2c(struct yac_interp_stack_config *interp_stack_config, int reduction_type, int partial_coverage)
void yac_interp_stack_config_add_ncc(struct yac_interp_stack_config *interp_stack_config, enum yac_interp_ncc_weight_type weight_type, int partial_coverage)
void yac_interp_stack_config_add_nnn_f2c(struct yac_interp_stack_config *interp_stack_config, int type, size_t n, double max_search_distance, double scale)
void yac_interp_stack_config_add_user_file(struct yac_interp_stack_config *interp_stack_config, char const *filename, enum yac_interp_file_on_missing_file on_missing_file, enum yac_interp_file_on_success on_success)
void yac_interp_stack_config_entry_get_nnn(union yac_interp_stack_config_entry const *interp_stack_entry, enum yac_interp_nnn_weight_type *type, size_t *n, double *max_search_distance, double *scale)
void yac_interp_stack_config_add_user_callback(struct yac_interp_stack_config *interp_stack_config, char const *func_compute_weights_key)
static void yac_interp_stack_config_unpack_n_string(void *buffer, int buffer_size, int *position, char *string, int max_string_len, MPI_Comm comm)
struct yac_interp_stack_config * yac_interp_stack_config_new()
static void yac_interp_stack_config_entry_free(union yac_interp_stack_config_entry *entry)
void yac_interp_stack_config_pack(struct yac_interp_stack_config *interp_stack, void *buffer, int buffer_size, int *position, MPI_Comm comm)
static void check_string(char const *string, char const *file, int line, char const *routine, char const *variable)
static void yac_interp_stack_config_entry_copy(union yac_interp_stack_config_entry *to, union yac_interp_stack_config_entry *from)
void yac_interp_stack_config_entry_get_fixed(union yac_interp_stack_config_entry const *interp_stack_entry, double *value)
void yac_interp_stack_config_entry_get_spmap(union yac_interp_stack_config_entry const *interp_stack_entry, double *spread_distance, double *max_search_distance, enum yac_interp_spmap_weight_type *weight_type, enum yac_interp_spmap_scale_type *scale_type, double *src_sphere_radius, char const **src_filename, char const **src_varname, int *src_min_global_id, double *tgt_sphere_radius, char const **tgt_filename, char const **tgt_varname, int *tgt_min_global_id)
static size_t yac_interp_stack_config_get_entry_pack_size(union yac_interp_stack_config_entry *entry, MPI_Comm comm)
void yac_interp_stack_config_add_user_file_f2c(struct yac_interp_stack_config *interp_stack_config, char const *filename, int on_missing_file, int on_success)
@ YAC_SOURCE_TO_TARGET_MAP
@ YAC_NEAREST_CORNER_CELLS
@ YAC_RADIAL_BASIS_FUNCTION
#define YAC_MAX_ROUTINE_NAME_LENGTH
#define YAC_MAX_FILE_NAME_LENGTH
#define xrealloc(ptr, size)
union yac_interp_stack_config_entry * config
double max_search_distance
union yac_nnn_config::@28 data
enum yac_interp_nnn_weight_type type
struct yac_spmap_scale_config::yac_spmap_cell_area_config::yac_spmap_cell_area_file_config file_config
struct yac_spmap_scale_config::yac_spmap_cell_area_config src
struct yac_spmap_scale_config::yac_spmap_cell_area_config tgt
enum yac_interp_spmap_scale_type type
char const * weight_file_name
static void compute_weights_callback(double const tgt_coords[3], int src_cell_id, size_t src_cell_idx, int const **global_results_points, double **result_weights, size_t *result_count, void *user_data)
struct yac_interp_stack_config_entry::@30 average
enum yac_interp_ncc_weight_type weight_type
char do_search_key[YAC_MAX_ROUTINE_NAME_LENGTH]
double max_search_distance
struct yac_interp_stack_config_entry::@33 spmap
enum yac_interpolation_list type
struct yac_interp_stack_config_entry::@38 creep
struct yac_nnn_config config
struct yac_interp_stack_config_entry::@40 nearest_corner_cells
enum yac_interp_file_on_missing_file on_missing_file
struct yac_interp_stack_config_entry::@29 general
struct yac_interp_stack_config_entry::@31 n_nearest_neighbor
char constructor_key[YAC_MAX_ROUTINE_NAME_LENGTH]
enum yac_interp_avg_weight_type reduction_type
enum yac_interp_method_conserv_normalisation normalisation
struct yac_interp_stack_config_entry::@36 fixed
char filename[YAC_MAX_FILE_NAME_LENGTH]
enum yac_interp_spmap_weight_type weight_type
struct yac_interp_stack_config_entry::@34 hcsbb
struct yac_interp_stack_config_entry::@35 user_file
enum yac_interp_file_on_success on_success
struct yac_interp_stack_config_entry::@31 radial_basis_function
struct yac_interp_stack_config_entry::@32 conservative
struct yac_interp_stack_config_entry::@37 check
struct yac_interp_stack_config_entry::@39 user_callback
char func_compute_weights_key[YAC_MAX_ROUTINE_NAME_LENGTH]
struct yac_spmap_scale_config scale_config
#define YAC_ASSERT_F(exp, format,...)
#define yac_mpi_call(call, comm)