YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
interp_weights.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 INTERP_WEIGHTS_H
6#define INTERP_WEIGHTS_H
7
8#include "yac_types.h"
9#include "location.h"
11
12#include <mpi.h>
13
14// YAC PUBLIC HEADER START
15
17
18 double frac_mask_fallback_value; // user-defined fractional mask fallback value
19 double scaling_factor; // user-defined scaling factor
20 double scaling_summand; // user-defined scaling summand
21
22 size_t num_fixed_values; // number of fixed values
23 double * fixed_values; // fixed values
24 size_t * num_tgt_per_fixed_value; // number of target points per fixed value
25 size_t * tgt_idx_fixed; // local ids of fixed target points
26
27 size_t num_wgt_tgt; // number of target points that receive a
28 // weighted sum of source points
29 size_t * wgt_tgt_idx; // local ids of weighted target points
30 size_t * num_src_per_tgt; // number of source points per target
31 double * weights; // weights
32 size_t * src_field_idx; // source field index for each source point
33 size_t * src_idx; // index of source points in source field
34 // buffer
35 size_t num_src_fields; // number of source fields
36 size_t * src_field_buffer_size; // buffer sizes required for receiving all
37 // required source data
38 // (array size is num_src_fields)
39};
40
43
48
55
56#define YAC_WEIGHT_FILE_ON_EXISTING_DEFAULT_VALUE (YAC_WEIGHT_FILE_OVERWRITE)
57
59
69 MPI_Comm comm, enum yac_location tgt_location,
71
88 struct yac_interp_weights * weights, char const * filename,
89 char const * src_grid_name, char const * tgt_grid_name,
90 size_t src_grid_size, size_t tgt_grid_size,
91 enum yac_weight_file_on_existing on_existing);
92
123 struct yac_interp_weights * weights,
126 double scaling_factor, double scaling_summand,
127 char const * yaxt_exchanger_name, int is_source, int is_target);
128
139 struct yac_interp_weights const * weights,
140 struct yac_interpolation_gen_config const * interp_gen_config,
141 int is_source, int is_target);
142
173 struct yac_interp_weights * weights,
175 double scaling_factor, double scaling_summand,
176 char const * yaxt_exchanger_name,
177 struct yac_interpolation_exchange ** interpolation_exchange,
179 int is_source, int is_target);
180
208 struct yac_interp_weights const * weights,
209 struct yac_interpolation_gen_config const * interp_gen_config,
210 struct yac_interpolation_exchange ** interpolation_exchange,
212 int is_source, int is_target);
213
220 struct yac_interp_weights * weights);
221
229 struct yac_interp_weights * weights);
230
235void yac_interp_weights_delete(struct yac_interp_weights * weights);
236
243
251
260
261// YAC PUBLIC HEADER STOP
262
263#endif // INTERP_WEIGHTS_H
struct yac_interp_weights_data yac_interp_weights_data_copy(struct yac_interp_weights_data interp_weights_data)
struct yac_interpolation * yac_interp_weights_get_interpolation(struct yac_interp_weights *weights, enum yac_interp_weights_reorder_type reorder, size_t collection_size, double frac_mask_fallback_value, double scaling_factor, double scaling_summand, char const *yaxt_exchanger_name, int is_source, int is_target)
void yac_interp_weights_data_init(struct yac_interp_weights_data *interp_weights_data)
void yac_interp_weights_get_interpolation_raw_ext(struct yac_interp_weights const *weights, struct yac_interpolation_gen_config const *interp_gen_config, struct yac_interpolation_exchange **interpolation_exchange, struct yac_interp_weights_data *interp_weights_data, int is_source, int is_target)
struct yac_interpolation * yac_interp_weights_get_interpolation_ext(struct yac_interp_weights const *weights, struct yac_interpolation_gen_config const *interp_gen_config, int is_source, int is_target)
void yac_interp_weights_delete(struct yac_interp_weights *weights)
void yac_interp_weights_get_interpolation_raw(struct yac_interp_weights *weights, size_t collection_size, double frac_mask_fallback_value, double scaling_factor, double scaling_summand, char const *yaxt_exchanger_name, struct yac_interpolation_exchange **interpolation_exchange, struct yac_interp_weights_data *interp_weights_data, int is_source, int is_target)
void yac_interp_weights_data_free(struct yac_interp_weights_data interp_weights_data)
yac_int * yac_interp_weights_get_interp_tgt(struct yac_interp_weights *weights)
yac_interp_weights_reorder_type
@ YAC_MAPPING_ON_TGT
weights will be applied at target processes
@ YAC_MAPPING_ON_SRC
weights will be applied at source processes
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_weight_file_on_existing
@ YAC_WEIGHT_FILE_KEEP
keep existing weight file
@ YAC_WEIGHT_FILE_UNDEFINED
@ YAC_WEIGHT_FILE_OVERWRITE
overwrite existing weight file
@ YAC_WEIGHT_FILE_ERROR
error when weight file existis already
size_t yac_interp_weights_get_interp_count(struct yac_interp_weights *weights)
void yac_interp_weights_write_to_file(struct yac_interp_weights *weights, char const *filename, char const *src_grid_name, char const *tgt_grid_name, size_t src_grid_size, size_t tgt_grid_size, enum yac_weight_file_on_existing on_existing)
Public interface for interpolation execution in YAC.
yac_location
Definition location.h:12
enum yac_location tgt_location
enum yac_location * src_locations
Configuration structure for interpolation generation.
double frac_mask_fallback_value
int collection_size
char const src_grid_name[]
char const tgt_grid_name[]
YAC_INT yac_int
Definition yac_types.h:15