YAC 3.18.0
Yet Another Coupler
Loading...
Searching...
No Matches
couple_config_field_couple.h File Reference
#include <stddef.h>
#include "couple_config_component.h"
#include "couple_config_field.h"
#include "couple_config.h"
Include dependency graph for couple_config_field_couple.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  yac_couple_config_field_couple
 

Functions

void yac_couple_config_field_couple_free (struct yac_couple_config_field_couple *field_couple)
 
void yac_couple_config_field_couples_merge (size_t *num_field_couples, struct yac_couple_config_field_couple **field_couples, MPI_Comm comm)
 
struct yac_couple_config_field_coupleyac_couple_config_field_couple_find (size_t num_field_couples, struct yac_couple_config_field_couple *field_couples, struct yac_couple_config_field_couple const *field_couple)
 
void yac_couple_config_field_couple_merge (struct yac_couple_config_field_couple *a, struct yac_couple_config_field_couple *b, MPI_Comm comm)
 
int yac_couple_config_field_couple_compare (struct yac_couple_config_field_couple const *a, struct yac_couple_config_field_couple const *b)
 
int yac_couple_config_field_couple_has_target (struct yac_couple_config const *couple_config, struct yac_couple_config_field_couple const *field_couple, char const *field_name, char const *grid_name, char const *component_name)
 
int yac_couple_config_field_couple_get_field_role_from_field_idx (struct yac_couple_config_field_couple const *field_couple, size_t component_idx, size_t field_idx)
 
void yac_couple_config_field_couple_update_component_indices (struct yac_couple_config_field_couple *field_couple, size_t const *old_to_new_idx)
 
void yac_couple_config_field_couple_init (struct yac_couple_config_field_couple *field_couple, size_t src_comp_idx, size_t src_field_idx, int src_lag, size_t tgt_comp_idx, size_t tgt_field_idx, int tgt_lag, const char *coupling_period, enum yac_reduction_type time_reduction, struct yac_interp_stack_config *interp_stack, int mapping_on_source, const char *weight_file_name, double scale_factor, double scale_summand, enum yac_weight_file_on_existing weight_file_on_existing, size_t num_src_mask_names, char const *const *src_mask_names, char const *tgt_mask_name, const char *yaxt_exchanger_name, struct yac_collection_selection const *collection_selection, int use_raw_exchange)
 

Function Documentation

◆ yac_couple_config_field_couple_compare()

int yac_couple_config_field_couple_compare ( struct yac_couple_config_field_couple const * a,
struct yac_couple_config_field_couple const * b )

Compare basic components of two field couples.

Compares source and target component and field indices.

Parameters
[in]aFirst field couple.
[in]bSecond field couple.
Returns
< 0 if a < b,
0 if a == b,
> 0 if a > b.

Definition at line 307 of file couple_config_field_couple.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_couple_find()

struct yac_couple_config_field_couple * yac_couple_config_field_couple_find ( size_t num_field_couples,
struct yac_couple_config_field_couple * field_couples,
struct yac_couple_config_field_couple const * field_couple )

Search for a matching field couple in an array.

Parameters
[in]num_field_couplesNumber of field couples.
[in]field_couplesArray of field couples to search in.
[in]field_coupleField couple to search for.
Returns
Pointer to matching field couple, or NULL if not found.

Definition at line 472 of file couple_config_field_couple.c.

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

◆ yac_couple_config_field_couple_free()

void yac_couple_config_field_couple_free ( struct yac_couple_config_field_couple * field_couple)

Free all dynamic data owned by a field couple.

Parameters
[in,out]field_coupleField couple.

Definition at line 173 of file couple_config_field_couple.c.

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

◆ yac_couple_config_field_couple_get_field_role_from_field_idx()

int yac_couple_config_field_couple_get_field_role_from_field_idx ( struct yac_couple_config_field_couple const * field_couple,
size_t component_idx,
size_t field_idx )

Check if field couple matches given field indices and return field role.

If any of the source/target fields of the couple is not DEFINED, the field role is set to YAC_EXCHANGE_TYPE_NONE, even if the field couple matches the given field and component idx.

Returns YAC_EXCHANGE_TYPE_INVALID if the given field index pair matches both source and target of the same field couple.

Parameters
[in]field_coupleField couple.
[in]component_idxComponent index.
[in]field_idxField index.
Returns
Field role.

Definition at line 595 of file couple_config_field_couple.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_couple_has_target()

int yac_couple_config_field_couple_has_target ( struct yac_couple_config const * couple_config,
struct yac_couple_config_field_couple const * field_couple,
char const * field_name,
char const * grid_name,
char const * component_name )

Check if target of a field couple matches given field, grid, and component name.

Parameters
[in]couple_configCoupling configuration.
[in]field_coupleField couple.
[in]field_nameField name.
[in]grid_nameGrid name.
[in]component_nameComponent name.
Returns
Non-zero if the target matches.

Definition at line 574 of file couple_config_field_couple.c.

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

◆ yac_couple_config_field_couple_init()

void yac_couple_config_field_couple_init ( struct yac_couple_config_field_couple * field_couple,
size_t src_comp_idx,
size_t src_field_idx,
int src_lag,
size_t tgt_comp_idx,
size_t tgt_field_idx,
int tgt_lag,
const char * coupling_period,
enum yac_reduction_type time_reduction,
struct yac_interp_stack_config * interp_stack,
int mapping_on_source,
const char * weight_file_name,
double scale_factor,
double scale_summand,
enum yac_weight_file_on_existing weight_file_on_existing,
size_t num_src_mask_names,
char const *const * src_mask_names,
char const * tgt_mask_name,
const char * yaxt_exchanger_name,
struct yac_collection_selection const * collection_selection,
int use_raw_exchange )

Initialize a field couple.

Parameters
[in,out]field_coupleField couple.
[in]src_comp_idxSource component index.
[in]src_field_idxSource field index.
[in]src_lagSource lag.
[in]tgt_comp_idxTarget component index.
[in]tgt_field_idxTarget field index.
[in]tgt_lagTarget lag.
[in]coupling_periodCoupling period string.
[in]time_reductionTime reduction type.
[in]interp_stackInterpolation stack.
[in]mapping_on_sourceMapping flag.
[in]weight_file_nameWeight file name.
[in]scale_factorScale factor.
[in]scale_summandScale summand.
[in]weight_file_on_existingExisting weight-file handling.
[in]num_src_mask_namesNumber of source mask names.
[in]src_mask_namesSource mask names.
[in]tgt_mask_nameTarget mask name.
[in]yaxt_exchanger_nameYAxT exchanger name.
[in]collection_selectionCollection selection.
[in]use_raw_exchangeRaw exchange flag.

Definition at line 488 of file couple_config_field_couple.c.

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

◆ yac_couple_config_field_couple_merge()

void yac_couple_config_field_couple_merge ( struct yac_couple_config_field_couple * a,
struct yac_couple_config_field_couple * b,
MPI_Comm comm )

Merge field couple b into field couple a and validate consistency.

Parameters
[in,out]aDestination field couple.
[in,out]bSource field couple.
[in]commMPI communicator.

Definition at line 331 of file couple_config_field_couple.c.

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

◆ yac_couple_config_field_couple_update_component_indices()

void yac_couple_config_field_couple_update_component_indices ( struct yac_couple_config_field_couple * field_couple,
size_t const * old_to_new_idx )

Update source/target component indices using a remapping table.

Parameters
[in,out]field_coupleField couple.
[in]old_to_new_idxMapping from old to new component index.

Definition at line 623 of file couple_config_field_couple.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_couples_merge()

void yac_couple_config_field_couples_merge ( size_t * num_field_couples,
struct yac_couple_config_field_couple ** field_couples,
MPI_Comm comm )

Synchronize and merge field couples across ranks.

Parameters
[in,out]num_field_couplesNumber of field couples.
[in,out]field_couplesArray of field couples.
[in]commMPI communicator.

Definition at line 460 of file couple_config_field_couple.c.

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