YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
interp_method_spmap.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_METHOD_SPMAP_H
6#define INTERP_METHOD_SPMAP_H
7
9#include "point_selection.h"
10
11// YAC PUBLIC HEADER START
12
14 YAC_INTERP_SPMAP_AVG = 0, // simple average
15 YAC_INTERP_SPMAP_DIST = 1, // distance weighted
16};
17
30
32 YAC_INTERP_SPMAP_CELL_AREA_FILE = 0, // read cell areas from file
33 YAC_INTERP_SPMAP_CELL_AREA_YAC = 1, // YAC computes the cell areas
34};
35
40
41#define YAC_INTERP_SPMAP_SPREAD_DISTANCE_DEFAULT (0.0)
42#define YAC_INTERP_SPMAP_MAX_SEARCH_DISTANCE_DEFAULT (0.0)
43#define YAC_INTERP_SPMAP_WEIGHTED_DEFAULT (YAC_INTERP_SPMAP_AVG)
44#define YAC_INTERP_SPMAP_SCALE_TYPE_DEFAULT (YAC_INTERP_SPMAP_NONE)
45#define YAC_INTERP_SPMAP_SPHERE_RADIUS_DEFAULT (1.0)
46#define YAC_INTERP_SPMAP_FILENAME_DEFAULT (NULL)
47#define YAC_INTERP_SPMAP_VARNAME_DEFAULT (NULL)
48#define YAC_INTERP_SPMAP_MIN_GLOBAL_ID_DEFAULT (0)
49#define YAC_INTERP_SPMAP_CELL_AREA_CONFIG_DEFAULT (NULL)
50#define YAC_INTERP_SPMAP_SCALE_CONFIG_DEFAULT (NULL)
51#define YAC_INTERP_SPMAP_DEFAULT_CONFIG (NULL)
52#define YAC_INTERP_SPMAP_OVERWRITE_DEFAULT (NULL)
53
83 struct yac_interp_spmap_config const * default_config,
84 struct yac_spmap_overwrite_config const * const * overwrite_configs);
85
99
105 struct yac_interp_spmap_config * spmap_config);
106
113 struct yac_interp_spmap_config const * spmap_config);
114
122 struct yac_interp_spmap_config const * spmap_config);
123
130 struct yac_interp_spmap_config const * spmap_config);
131
139 struct yac_interp_spmap_config const * spmap_config);
140
150 enum yac_interp_spmap_scale_type scale_type,
151 struct yac_spmap_cell_area_config const * source_cell_area_config,
152 struct yac_spmap_cell_area_config const * target_cell_area_config);
153
159 struct yac_spmap_scale_config * scale_config);
160
167 struct yac_spmap_scale_config const * scale_config);
168
175struct yac_spmap_cell_area_config const *
177 struct yac_spmap_scale_config const * scale_config);
178
185struct yac_spmap_cell_area_config const *
187 struct yac_spmap_scale_config const * scale_config);
188
197 double sphere_radius);
198
211 char const * filename, char const * varname, yac_int min_global_id);
212
219 struct yac_spmap_cell_area_config * cell_area_config);
220
227 struct yac_spmap_cell_area_config const * cell_area_config);
228
237 struct yac_spmap_cell_area_config const * cell_area_config);
238
247 struct yac_spmap_cell_area_config const * cell_area_config);
248
257 struct yac_spmap_cell_area_config const * cell_area_config);
258
267 struct yac_spmap_cell_area_config const * cell_area_config);
268
277 struct yac_interp_spmap_config const * config);
278
285 struct yac_spmap_overwrite_config * overwrite_config);
286
294 struct yac_spmap_overwrite_config ** overwrite_configs);
295
303struct yac_point_selection const *
305 struct yac_spmap_overwrite_config const * overwrite_config);
306
314struct yac_interp_spmap_config const *
316 struct yac_spmap_overwrite_config const * overwrite_config);
317
318// YAC PUBLIC HEADER STOP
319
320//------------------------------------------------------------------------------
321// some utility rouines for datatypes associated with spmap
322//------------------------------------------------------------------------------
323
325 struct yac_interp_spmap_config const * spmap_config);
327 struct yac_spmap_overwrite_config const * const * overwrite_configs);
328
330 struct yac_interp_spmap_config const * a,
331 struct yac_interp_spmap_config const * b);
333 struct yac_spmap_overwrite_config const * a,
334 struct yac_spmap_overwrite_config const * b);
336 struct yac_interp_spmap_config const * spmap_config, MPI_Comm comm);
338 struct yac_spmap_overwrite_config const * const * overwrite_configs,
339 MPI_Comm comm);
341 struct yac_interp_spmap_config const * spmap_config,
342 void * buffer, int buffer_size, int * position, MPI_Comm comm);
344 struct yac_spmap_overwrite_config const * const * overwrite_configs,
345 void * buffer, int buffer_size, int * position, MPI_Comm comm);
347 void * buffer, int buffer_size, int * position,
348 struct yac_interp_spmap_config ** spmap_config, MPI_Comm comm);
350 void * buffer, int buffer_size, int * position,
351 struct yac_spmap_overwrite_config *** overwrite_configs, MPI_Comm comm);
352
353#endif // INTERP_METHOD_SPMAP_H
char const * yac_spmap_cell_area_config_get_filename(struct yac_spmap_cell_area_config const *cell_area_config)
size_t yac_spmap_overwrite_configs_get_pack_size(struct yac_spmap_overwrite_config const *const *overwrite_configs, MPI_Comm comm)
struct yac_spmap_cell_area_config const * yac_spmap_scale_config_get_tgt_cell_area_config(struct yac_spmap_scale_config const *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
void yac_interp_spmap_config_unpack(void *buffer, int buffer_size, int *position, struct yac_interp_spmap_config **spmap_config, MPI_Comm comm)
struct yac_interp_spmap_config const * yac_spmap_overwrite_config_get_spmap_config(struct yac_spmap_overwrite_config const *overwrite_config)
double yac_spmap_cell_area_config_get_sphere_radius(struct yac_spmap_cell_area_config const *cell_area_config)
void yac_interp_spmap_config_delete(struct yac_interp_spmap_config *spmap_config)
struct yac_spmap_cell_area_config * yac_spmap_cell_area_config_file_new(char const *filename, char const *varname, yac_int min_global_id)
struct yac_spmap_overwrite_config * yac_spmap_overwrite_config_new(struct yac_point_selection const *src_point_selection, struct yac_interp_spmap_config const *config)
void yac_spmap_overwrite_configs_delete(struct yac_spmap_overwrite_config **overwrite_configs)
struct yac_point_selection const * yac_spmap_overwrite_config_get_src_point_selection(struct yac_spmap_overwrite_config const *overwrite_config)
int yac_interp_spmap_config_compare(struct yac_interp_spmap_config const *a, struct yac_interp_spmap_config const *b)
yac_interp_spmap_cell_area_provider
@ YAC_INTERP_SPMAP_CELL_AREA_FILE
@ YAC_INTERP_SPMAP_CELL_AREA_YAC
yac_int yac_spmap_cell_area_config_get_min_global_id(struct yac_spmap_cell_area_config const *cell_area_config)
void yac_spmap_overwrite_configs_unpack(void *buffer, int buffer_size, int *position, struct yac_spmap_overwrite_config ***overwrite_configs, MPI_Comm comm)
enum yac_interp_spmap_cell_area_provider yac_spmap_cell_area_config_get_type(struct yac_spmap_cell_area_config const *cell_area_config)
yac_interp_spmap_weight_type
@ YAC_INTERP_SPMAP_AVG
@ YAC_INTERP_SPMAP_DIST
int yac_spmap_overwrite_config_compare(struct yac_spmap_overwrite_config const *a, struct yac_spmap_overwrite_config const *b)
void yac_spmap_overwrite_configs_pack(struct yac_spmap_overwrite_config const *const *overwrite_configs, void *buffer, int buffer_size, int *position, MPI_Comm comm)
double yac_interp_spmap_config_get_max_search_distance(struct yac_interp_spmap_config const *spmap_config)
struct yac_spmap_cell_area_config const * yac_spmap_scale_config_get_src_cell_area_config(struct yac_spmap_scale_config const *scale_config)
char const * yac_spmap_cell_area_config_get_varname(struct yac_spmap_cell_area_config const *cell_area_config)
void yac_interp_spmap_config_pack(struct yac_interp_spmap_config const *spmap_config, void *buffer, int buffer_size, int *position, MPI_Comm comm)
struct interp_method * yac_interp_method_spmap_new(struct yac_interp_spmap_config const *default_config, struct yac_spmap_overwrite_config const *const *overwrite_configs)
struct yac_interp_spmap_config * yac_interp_spmap_config_new(double spread_distance, double max_search_distance, enum yac_interp_spmap_weight_type weight_type, struct yac_spmap_scale_config const *scale_config)
void yac_spmap_scale_config_delete(struct yac_spmap_scale_config *scale_config)
struct yac_spmap_scale_config const * yac_interp_spmap_config_get_scale_config(struct yac_interp_spmap_config const *spmap_config)
size_t yac_interp_spmap_config_get_pack_size(struct yac_interp_spmap_config const *spmap_config, MPI_Comm comm)
struct yac_interp_spmap_config * yac_interp_spmap_config_copy(struct yac_interp_spmap_config const *spmap_config)
double yac_interp_spmap_config_get_spread_distance(struct yac_interp_spmap_config const *spmap_config)
void yac_spmap_cell_area_config_delete(struct yac_spmap_cell_area_config *cell_area_config)
enum yac_interp_spmap_scale_type yac_spmap_scale_config_get_type(struct yac_spmap_scale_config const *scale_config)
struct yac_spmap_overwrite_config ** yac_spmap_overwrite_configs_copy(struct yac_spmap_overwrite_config const *const *overwrite_configs)
struct yac_spmap_cell_area_config * yac_spmap_cell_area_config_yac_new(double sphere_radius)
enum yac_interp_spmap_weight_type yac_interp_spmap_config_get_weight_type(struct yac_interp_spmap_config const *spmap_config)
void yac_spmap_overwrite_config_delete(struct yac_spmap_overwrite_config *overwrite_config)
struct yac_spmap_scale_config * yac_spmap_scale_config_new(enum yac_interp_spmap_scale_type scale_type, struct yac_spmap_cell_area_config const *source_cell_area_config, struct yac_spmap_cell_area_config const *target_cell_area_config)
struct yac_spmap_scale_config * scale_config
struct yac_point_selection * src_point_selection
struct yac_interp_spmap_config * config
double * buffer
YAC_INT yac_int
Definition yac_types.h:15