YAC 3.8.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"
10#include "interpolation.h"
11
12// YAC PUBLIC HEADER START
13
15
16 double frac_mask_fallback_value; // user-defined fractional mask fallback value
17 double scaling_factor; // user-defined scaling factor
18 double scaling_summand; // user-defined scaling summand
19
20 size_t num_fixed_values; // number of fixed values
21 double * fixed_values; // fixed values
22 size_t * num_tgt_per_fixed_value; // number of target points per fixed value
23 size_t * tgt_idx_fixed; // local ids of fixed target points
24
25 size_t num_wgt_tgt; // number of target points that receive a
26 // weighted sum of source points
27 size_t * wgt_tgt_idx; // local ids of weighted target points
28 size_t * num_src_per_tgt; // number of source points per target
29 double * weights; // weights
30 size_t * src_field_idx; // source field index for each source point
31 size_t * src_idx; // index of source points in source field
32 // buffer
33 size_t num_src_fields; // number of source fields
34 size_t * src_field_buffer_size; // buffer sizes required for receiving all
35 // required source data
36 // (array size is num_src_fields)
37};
38
40
45
52
53#define YAC_WEIGHT_FILE_ON_EXISTING_DEFAULT_VALUE (YAC_WEIGHT_FILE_OVERWRITE)
54
56
66 MPI_Comm comm, enum yac_location tgt_location,
68
85 struct yac_interp_weights * weights, char const * filename,
86 char const * src_grid_name, char const * tgt_grid_name,
87 size_t src_grid_size, size_t tgt_grid_size,
88 enum yac_weight_file_on_existing on_existing);
89
120 struct yac_interp_weights * weights,
123 double scaling_factor, double scaling_summand,
124 char const * yaxt_exchanger_name, int is_source, int is_target);
125
156 struct yac_interp_weights * weights,
158 double scaling_factor, double scaling_summand,
159 char const * yaxt_exchanger_name,
160 struct yac_interpolation_exchange ** interpolation_exchange,
162 int is_source, int is_target);
163
170 struct yac_interp_weights * weights);
171
179 struct yac_interp_weights * weights);
180
185void yac_interp_weights_delete(struct yac_interp_weights * weights);
186
193
201
210
211// YAC PUBLIC HEADER STOP
212
213#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_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)
yac_location
Definition location.h:12
enum yac_location tgt_location
enum yac_location * src_locations
double frac_mask_fallback_value
int collection_size
char const src_grid_name[]
char const tgt_grid_name[]
Xt_int yac_int
Definition yac_types.h:15