YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
interpolation_gen_config.c File Reference
Include dependency graph for interpolation_gen_config.c:

Go to the source code of this file.

Data Structures

struct  yac_interpolation_gen_config
 Configuration structure for interpolation generation. More...
 

Functions

struct yac_interpolation_gen_configyac_interpolation_gen_config_new (void)
 Allocate and initialise an interpolation generation configuration structure.
 
void yac_interpolation_gen_config_delete (struct yac_interpolation_gen_config *config)
 Release a interpolation generation configuration structure allocated by yac_interpolation_gen_config_new.
 
struct yac_interpolation_gen_configyac_interpolation_gen_config_copy (struct yac_interpolation_gen_config const *src)
 Create a copy of an interpolation generation configuration.
 
void yac_interpolation_gen_config_set_reorder (struct yac_interpolation_gen_config *config, enum yac_interp_weights_reorder_type reorder)
 Set the reordering strategy for interpolation weights.
 
void yac_interpolation_gen_config_set_reorder_f2c (struct yac_interpolation_gen_config *config, int reorder)
 
void yac_interpolation_gen_config_set_collection_size (struct yac_interpolation_gen_config *config, size_t collection_size)
 Set the number of contiguous fields (starting at "0") in the field collection.
 
void yac_interpolation_gen_config_set_collection_selection (struct yac_interpolation_gen_config *config, struct yac_collection_selection const *collection_selection)
 Set the collection selection of source field in the source field collection.
 
void yac_interpolation_gen_config_set_frac_mask_fallback_value (struct yac_interpolation_gen_config *config, double frac_mask_fallback_value)
 Set the fractional mask fallback value.
 
void yac_interpolation_gen_config_set_scaling_factor (struct yac_interpolation_gen_config *config, double scaling_factor)
 Set the multiplicative scaling factor.
 
void yac_interpolation_gen_config_set_scaling_summand (struct yac_interpolation_gen_config *config, double scaling_summand)
 Set the additive scaling summand.
 
void yac_interpolation_gen_config_set_yaxt_exchanger_name (struct yac_interpolation_gen_config *config, char const *name)
 Set the name of the Yaxt exchanger.
 
void yac_interpolation_gen_config_set_yaxt_exchanger_name_f2c (struct yac_interpolation_gen_config *config, char const *name)
 
enum yac_interp_weights_reorder_type yac_interpolation_gen_config_get_reorder (struct yac_interpolation_gen_config const *config)
 Get the configured reordering strategy.
 
struct yac_collection_selection const * yac_interpolation_gen_config_get_collection_selection (struct yac_interpolation_gen_config const *config)
 Get the configured collection selection.
 
double yac_interpolation_gen_config_get_frac_mask_fallback_value (struct yac_interpolation_gen_config const *config)
 Get the configured fractional mask fallback value.
 
double yac_interpolation_gen_config_get_scaling_factor (struct yac_interpolation_gen_config const *config)
 Get the configured scaling factor.
 
double yac_interpolation_gen_config_get_scaling_summand (struct yac_interpolation_gen_config const *config)
 Get the configured scaling summand.
 
const char * yac_interpolation_gen_config_get_yaxt_exchanger_name (struct yac_interpolation_gen_config const *config)
 Get the configured Yaxt exchanger name.
 
int yac_interpolation_gen_config_compare (struct yac_interpolation_gen_config const *a, struct yac_interpolation_gen_config const *b)
 Compare two interpolation configuration structures.
 
size_t yac_interpolation_gen_config_get_pack_size (struct yac_interpolation_gen_config const *cfg, MPI_Comm comm)
 Get the MPI packing size of an interpolation generation configuration.
 
void yac_interpolation_gen_config_pack (struct yac_interpolation_gen_config const *cfg, void *buffer, int buffer_size, int *position, MPI_Comm comm)
 Pack an interpolation generation configuration into an MPI buffer.
 
struct yac_interpolation_gen_configyac_interpolation_gen_config_unpack (void const *buffer, int buffer_size, int *position, MPI_Comm comm)
 Unpack an interpolation generation configuration from an MPI buffer.
 

Function Documentation

◆ yac_interpolation_gen_config_compare()

int yac_interpolation_gen_config_compare ( struct yac_interpolation_gen_config const * a,
struct yac_interpolation_gen_config const * b )

Compare two interpolation configuration structures.

Compares two yac_interpolation_gen_config objects and returns an integer describing their relative order.

Rules:

  • 0 if both configurations are equivalent or both are NULL
  • <0 if a is considered less than b
  • >0 if a is considered greater than b

Property: compare(a, b) == -compare(b, a)

Parameters
[in]aFirst configuration selection (may be NULL)
[in]bSecond configuration selection (may be NULL)
Returns
0 if equal, negative if a<b, positive if a>b

Definition at line 312 of file interpolation_gen_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_interpolation_gen_config_copy()

struct yac_interpolation_gen_config * yac_interpolation_gen_config_copy ( struct yac_interpolation_gen_config const * src)

Create a copy of an interpolation generation configuration.

Allocates and returns a new configuration structure containing the same parameter values as the provided source. The string pointer yaxt_exchanger_name is copied by reference (not duplicated).

The returned configuration must be released using yac_interpolation_gen_config_delete.

Parameters
[in]srcPointer to a valid source configuration.
Returns
Pointer to a newly allocated copy of the configuration.

Definition at line 82 of file interpolation_gen_config.c.

Here is the call graph for this function:

◆ yac_interpolation_gen_config_delete()

void yac_interpolation_gen_config_delete ( struct yac_interpolation_gen_config * config)

Release a interpolation generation configuration structure allocated by yac_interpolation_gen_config_new.

Parameters
[in,out]configPointer to interpolation generation configuration structure. May be NULL.

Definition at line 73 of file interpolation_gen_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_interpolation_gen_config_get_collection_selection()

struct yac_collection_selection const * yac_interpolation_gen_config_get_collection_selection ( struct yac_interpolation_gen_config const * config)

Get the configured collection selection.

Parameters
[in]configPointer to a valid configuration structure.
Returns
The collection selection.
Note
The value must have been explicitly set before querying.

Definition at line 255 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_get_frac_mask_fallback_value()

double yac_interpolation_gen_config_get_frac_mask_fallback_value ( struct yac_interpolation_gen_config const * config)

Get the configured fractional mask fallback value.

Parameters
[in]configPointer to a valid configuration structure.
Returns
The fractional mask fallback value.

Definition at line 270 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_get_pack_size()

size_t yac_interpolation_gen_config_get_pack_size ( struct yac_interpolation_gen_config const * config,
MPI_Comm comm )

Get the MPI packing size of an interpolation generation configuration.

Computes the number of bytes required to pack a yac_interpolation_gen_config structure for MPI communication using yac_interpolation_gen_config_pack.

The returned size accounts for all structure members, including nested objects such as the yac_collection_selection and the optional exchanger name string.

Parameters
[in]configPointer to the configuration structure (must not be NULL)
[in]commMPI communicator used for datatype size computation
Returns
Total number of bytes required to pack the configuration.

Definition at line 368 of file interpolation_gen_config.c.

Here is the call graph for this function:

◆ yac_interpolation_gen_config_get_reorder()

enum yac_interp_weights_reorder_type yac_interpolation_gen_config_get_reorder ( struct yac_interpolation_gen_config const * config)

Get the configured reordering strategy.

Parameters
[in]configPointer to a valid configuration structure.
Returns
The configured reorder type.

Definition at line 244 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_get_scaling_factor()

double yac_interpolation_gen_config_get_scaling_factor ( struct yac_interpolation_gen_config const * config)

Get the configured scaling factor.

Parameters
[in]configPointer to a valid configuration structure.
Returns
The scaling factor.

Definition at line 281 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_get_scaling_summand()

double yac_interpolation_gen_config_get_scaling_summand ( struct yac_interpolation_gen_config const * config)

Get the configured scaling summand.

Parameters
[in]configPointer to a valid configuration structure.
Returns
The scaling summand.

Definition at line 291 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_get_yaxt_exchanger_name()

const char * yac_interpolation_gen_config_get_yaxt_exchanger_name ( struct yac_interpolation_gen_config const * config)

Get the configured Yaxt exchanger name.

Parameters
[in]configPointer to a valid configuration structure.
Returns
Pointer to the configured exchanger name string, or NULL if the default exchanger is used.

Definition at line 301 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_new()

struct yac_interpolation_gen_config * yac_interpolation_gen_config_new ( void )

Allocate and initialise an interpolation generation configuration structure.

The returned structure is allocated on the heap and must be released using yac_interpolation_gen_config_delete. It is initialised with default values.

Returns
Pointer to a newly allocated configuration structure.

Definition at line 57 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_pack()

void yac_interpolation_gen_config_pack ( struct yac_interpolation_gen_config const * config,
void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

Pack an interpolation generation configuration into an MPI buffer.

Parameters
[in]configPointer to configuration to pack (must not be NULL)
[in,out]bufferDestination buffer for packed data
[in]buffer_sizeSize of buffer in bytes
[in,out]positionCurrent position in the buffer (updated)
[in]commMPI communicator used for datatype consistency

Definition at line 389 of file interpolation_gen_config.c.

Here is the call graph for this function:

◆ yac_interpolation_gen_config_set_collection_selection()

void yac_interpolation_gen_config_set_collection_selection ( struct yac_interpolation_gen_config * config,
struct yac_collection_selection const * collection_selection )

Set the collection selection of source field in the source field collection.

Parameters
[in,out]configPointer to a valid configuration structure.
[in]collection_selectionCollection selection that must not be NULL.

Definition at line 152 of file interpolation_gen_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_interpolation_gen_config_set_collection_size()

void yac_interpolation_gen_config_set_collection_size ( struct yac_interpolation_gen_config * config,
size_t collection_size )

Set the number of contiguous fields (starting at "0") in the field collection.

Parameters
[in,out]configPointer to a valid configuration structure.
[in]collection_sizePositive collection size (> 0) that must not be equal to SIZE_MAX (reserved for "unset").

Definition at line 132 of file interpolation_gen_config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yac_interpolation_gen_config_set_frac_mask_fallback_value()

void yac_interpolation_gen_config_set_frac_mask_fallback_value ( struct yac_interpolation_gen_config * config,
double frac_mask_fallback_value )

Set the fractional mask fallback value.

Defines the value to be used for masked target points in fractional mask interpolations.

Parameters
[in,out]configPointer to a valid configuration structure.
[in]frac_mask_fallback_valueFallback value used in fractional masking. Must satisfy YAC_FRAC_MASK_VALUE_IS_VALID.

Definition at line 173 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_set_reorder()

void yac_interpolation_gen_config_set_reorder ( struct yac_interpolation_gen_config * config,
enum yac_interp_weights_reorder_type reorder )

Set the reordering strategy for interpolation weights.

Parameters
[in,out]configPointer to a valid configuration structure.
[in]reorderReordering strategy to apply. Must be either YAC_MAPPING_ON_SRC or YAC_MAPPING_ON_TGT.

Definition at line 101 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_set_reorder_f2c()

void yac_interpolation_gen_config_set_reorder_f2c ( struct yac_interpolation_gen_config * config,
int reorder )

Definition at line 117 of file interpolation_gen_config.c.

Here is the call graph for this function:

◆ yac_interpolation_gen_config_set_scaling_factor()

void yac_interpolation_gen_config_set_scaling_factor ( struct yac_interpolation_gen_config * config,
double scaling_factor )

Set the multiplicative scaling factor.

The scaling factor is applied to interpolation results. It must be a finite, normal floating-point number or 0.0.

Parameters
[in,out]configPointer to a valid configuration structure.
[in]scaling_factorScaling factor to apply.

Definition at line 190 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_set_scaling_summand()

void yac_interpolation_gen_config_set_scaling_summand ( struct yac_interpolation_gen_config * config,
double scaling_summand )

Set the additive scaling summand.

The summand is added to interpolation results after applying the scaling factor. It must be a finite, normal floating-point number or 0.0.

Parameters
[in,out]configPointer to a valid configuration structure.
[in]scaling_summandScaling summand to apply.

Definition at line 204 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_set_yaxt_exchanger_name()

void yac_interpolation_gen_config_set_yaxt_exchanger_name ( struct yac_interpolation_gen_config * config,
char const * yaxt_exchanger_name )

Set the name of the Yaxt exchanger.

The provided string is stored by pointer (not copied). May be NULL to indicate that the default exchanger should be used.

Parameters
[in,out]configPointer to a valid configuration structure.
[in]yaxt_exchanger_namePointer to a yaxt exchanger name string or NULL.

Definition at line 218 of file interpolation_gen_config.c.

Here is the caller graph for this function:

◆ yac_interpolation_gen_config_set_yaxt_exchanger_name_f2c()

void yac_interpolation_gen_config_set_yaxt_exchanger_name_f2c ( struct yac_interpolation_gen_config * config,
char const * name )

Definition at line 230 of file interpolation_gen_config.c.

Here is the call graph for this function:

◆ yac_interpolation_gen_config_unpack()

struct yac_interpolation_gen_config * yac_interpolation_gen_config_unpack ( void const * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

Unpack an interpolation generation configuration from an MPI buffer.

Reconstructs a newly allocated yac_interpolation_gen_config structure from a buffer previously filled by yac_interpolation_gen_config_pack.

Parameters
[in]bufferSource buffer containing packed data
[in]buffer_sizeSize of the packed buffer in bytes
[in,out]positionCurrent position in the buffer (updated)
[in]commMPI communicator used for datatype consistency
Returns
Newly allocated unpacked configuration object.

Definition at line 421 of file interpolation_gen_config.c.

Here is the call graph for this function: