YAC 3.7.1
Yet Another Coupler
Loading...
Searching...
No Matches
interpolation.h
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef INTERPOLATION_H
6#define INTERPOLATION_H
7
8// YAC PUBLIC HEADER START
9
10#include <yaxt.h>
11#include <math.h>
12
13extern double const YAC_FRAC_MASK_NO_VALUE;
14extern double const YAC_FRAC_MASK_UNDEF;
15
16// nan is a valid value for frac_mask_fallback_value, therefore when
17// comparing against it the result can change depending on compiler
18// optimisation
19#define YAC_FRAC_MASK_VALUE_IS_SET(value) \
20 (!isnormal(value) || ((value) != YAC_FRAC_MASK_UNDEF))
21#define YAC_FRAC_MASK_VALUE_IS_VALID(value) \
22 (!isnormal(value) || \
23 (((value) != YAC_FRAC_MASK_UNDEF) && ((value) != YAC_FRAC_MASK_NO_VALUE)))
24
26
29 double scale_factor, double scale_summand);
30
31void yac_interpolation_inc_ref_count(struct yac_interpolation * interpolation);
32
33int yac_interpolation_with_frac_mask(struct yac_interpolation * interpolation);
34
36 struct yac_interpolation * interp, double value, size_t count, size_t * pos);
37
39 struct yac_interpolation * interp, Xt_redist redist);
40
42 struct yac_interpolation * interp, Xt_redist * redists, size_t num_src_fields);
43
44/*
45 * The target points consist of the sum of a number of source points. The sum
46 * can be computed on the source or target processes.
47 */
49 struct yac_interpolation * interp, Xt_redist * halo_redists,
50 size_t tgt_count, size_t * num_src_per_tgt,
51 size_t * src_field_idx, size_t * src_idx,
52 size_t num_src_fields, Xt_redist result_redist);
53
55 struct yac_interpolation * interp, Xt_redist * src_redists,
56 size_t * tgt_pos, size_t tgt_count, size_t * num_src_per_tgt,
57 size_t * src_field_idx, size_t * src_idx,
58 size_t num_src_fields);
59
60/*
61 * The target points consist of a weighted sum of a number of source points. The
62 * operation can be expressed as a distributed Matrix-Vector-Product. This
63 * Product can be computed on the source or target processes.
64 */
66 struct yac_interpolation * interp, Xt_redist * halo_redists,
67 size_t tgt_count, size_t * num_src_per_tgt, double * weights,
68 size_t * src_field_idx, size_t * src_idx,
69 size_t num_src_fields, Xt_redist result_redist);
70
72 struct yac_interpolation * interp, Xt_redist * src_redists,
73 size_t * tgt_pos, size_t tgt_count, size_t * num_src_per_tgt,
74 double * weights, size_t * src_field_idx, size_t * src_idx,
75 size_t num_src_fields);
76
78 struct yac_interpolation * interp);
79
80// src_fields dimensions [collection_idx]
81// [field index]
82// [local_idx]
83// tgt_field dimensions [collection_idx]
84// [local_idx]
86 struct yac_interpolation * interp, double *** src_fields,
87 double ** tgt_field);
89 struct yac_interpolation * interp, double *** src_fields,
90 double *** src_frac_masks, double ** tgt_field);
91
92// src_fields dimensions [collection_idx]
93// [field index]
94// [local_idx]
96 struct yac_interpolation * interp, double *** src_fields);
98 struct yac_interpolation * interp, double *** src_fields,
99 double *** src_frac_masks);
100
101// tgt_field dimensions [collection_idx]
102// [local_idx]
104 struct yac_interpolation * interp, double ** tgt_field);
106 struct yac_interpolation * interp, double ** tgt_field);
107
110
112
113void yac_interpolation_delete(struct yac_interpolation * interp);
114
115// YAC PUBLIC HEADER STOP
116
117#endif // INTERPOLATION_H
struct @14::@15 value
void yac_interpolation_add_sum_at_src(struct yac_interpolation *interp, Xt_redist *halo_redists, size_t tgt_count, size_t *num_src_per_tgt, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields, Xt_redist result_redist)
struct yac_interpolation * yac_interpolation_copy(struct yac_interpolation *interp)
void yac_interpolation_inc_ref_count(struct yac_interpolation *interpolation)
void yac_interpolation_add_weight_sum_mvp_at_tgt(struct yac_interpolation *interp, Xt_redist *src_redists, size_t *tgt_pos, size_t tgt_count, size_t *num_src_per_tgt, double *weights, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields)
struct yac_interpolation * yac_interpolation_new(size_t collection_size, double frac_mask_fallback_value, double scale_factor, double scale_summand)
void yac_interpolation_execute(struct yac_interpolation *interp, double ***src_fields, double **tgt_field)
int yac_interpolation_with_frac_mask(struct yac_interpolation *interpolation)
void yac_interpolation_add_direct_mf(struct yac_interpolation *interp, Xt_redist *redists, size_t num_src_fields)
void yac_interpolation_delete(struct yac_interpolation *interp)
void yac_interpolation_add_sum_at_tgt(struct yac_interpolation *interp, Xt_redist *src_redists, size_t *tgt_pos, size_t tgt_count, size_t *num_src_per_tgt, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields)
int yac_interpolation_execute_put_test(struct yac_interpolation *interp)
void yac_interpolation_add_fixed(struct yac_interpolation *interp, double value, size_t count, size_t *pos)
void yac_interpolation_execute_wait(struct yac_interpolation *interp)
void yac_interpolation_execute_frac(struct yac_interpolation *interp, double ***src_fields, double ***src_frac_masks, double **tgt_field)
void yac_interpolation_execute_get(struct yac_interpolation *interp, double **tgt_field)
void yac_interpolation_execute_get_async(struct yac_interpolation *interp, double **tgt_field)
double const YAC_FRAC_MASK_UNDEF
void yac_interpolation_add_direct(struct yac_interpolation *interp, Xt_redist redist)
void yac_interpolation_execute_put_frac(struct yac_interpolation *interp, double ***src_fields, double ***src_frac_masks)
void yac_interpolation_execute_put(struct yac_interpolation *interp, double ***src_fields)
void yac_interpolation_add_weight_sum_mvp_at_src(struct yac_interpolation *interp, Xt_redist *halo_redists, size_t tgt_count, size_t *num_src_per_tgt, double *weights, size_t *src_field_idx, size_t *src_idx, size_t num_src_fields, Xt_redist result_redist)
int yac_interpolation_execute_get_test(struct yac_interpolation *interp)
double const YAC_FRAC_MASK_NO_VALUE
double frac_mask_fallback_value
int collection_size