YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
couple_config_component.h File Reference
#include <stddef.h>
#include "yac_mpi_common.h"
Include dependency graph for couple_config_component.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_component
 

Functions

size_t yac_couple_config_component_append (struct yac_couple_config_component **components, size_t *num_components, char const *name)
 
void yac_couple_config_components_free (struct yac_couple_config_component **components, size_t *num_components)
 
void yac_couple_config_set_component_metadata_value (struct yac_couple_config_component *component, char const *metadata)
 
void yac_couple_config_components_merge (struct yac_couple_config_component **components, size_t *num_components, struct yac_couple_config_couple *couples, size_t num_couples, MPI_Comm comm)
 
char const * yac_couple_config_component_get_name (struct yac_couple_config_component const *component)
 
char const * yac_couple_config_component_get_field_metadata (struct yac_couple_config_component const *component, size_t grid_idx, char const *field_name)
 
double yac_couple_config_component_get_field_frac_mask_fallback_value (struct yac_couple_config_component const *component, size_t grid_idx, char const *field_name)
 
void yac_couple_config_component_set_field_frac_mask_fallback_value (struct yac_couple_config_component *component, size_t grid_idx, char const *field_name, double value)
 
size_t yac_couple_config_component_get_field_collection_size (struct yac_couple_config_component const *component, size_t grid_idx, char const *field_name)
 
struct yac_couple_config_field * yac_couple_config_component_find_field (struct yac_couple_config_component const *component, size_t grid_idx, char const *field_name)
 
void yac_couple_config_component_set_field_metadata (struct yac_couple_config_component *component, size_t grid_idx, char const *field_name, char const *metadata)
 
size_t yac_couple_config_component_update_or_append_field (struct yac_couple_config_component *component, char const *field_name, size_t grid_idx, char const *timestep, size_t collection_size)
 
char const * yac_couple_config_component_get_field_name (struct yac_couple_config_component const *component, size_t field_idx)
 
size_t yac_couple_config_component_get_field_grid_idx (struct yac_couple_config_component const *component, size_t field_idx)
 
void yac_couple_config_component_update_all_grid_idx (struct yac_couple_config_component *component, size_t const *old_to_new_idx)
 
char const * yac_couple_config_component_get_field_timestep (struct yac_couple_config_component const *component, size_t grid_idx, char const *field_name)
 
char const * yac_couple_config_component_get_field_timestep_by_idx (struct yac_couple_config_component const *component, size_t field_idx)
 
int yac_couple_config_component_field_is_valid (struct yac_couple_config_component const *component, size_t field_idx)
 
size_t yac_couple_config_component_get_field_collection_size_by_idx (struct yac_couple_config_component const *component, size_t field_idx)
 
double yac_couple_config_component_get_field_frac_mask_fallback_value_by_idx (struct yac_couple_config_component const *component, size_t field_idx)
 

Function Documentation

◆ yac_couple_config_component_append()

size_t yac_couple_config_component_append ( struct yac_couple_config_component ** components,
size_t * num_components,
char const * name )

Append a component with the given name to the array, or return the index of an existing component with the same name (deduplication).

Parameters
[in,out]componentsComponent array pointer.
[in,out]num_componentsArray length.
[in]nameComponent name.
Returns
Index of the (new or existing) component.

Definition at line 102 of file couple_config_component.c.

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

◆ yac_couple_config_component_field_is_valid()

int yac_couple_config_component_field_is_valid ( struct yac_couple_config_component const * component,
size_t field_idx )

Check whether a field identified by index is fully defined (has a timestep and a collection size).

Parameters
[in]componentComponent.
[in]field_idxField index.
Return values
Nonzeroif the field is valid
Zerootherwise

Definition at line 383 of file couple_config_component.c.

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

◆ yac_couple_config_component_find_field()

struct yac_couple_config_field * yac_couple_config_component_find_field ( struct yac_couple_config_component const * component,
size_t grid_idx,
char const * field_name )

Search for a field by grid index and name within a component.

Parameters
[in]componentComponent to search in.
[in]grid_idxGrid index of the field.
[in]field_nameName of the field.
Return values
fieldif a match is found
NULLif not found.

Definition at line 329 of file couple_config_component.c.

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

◆ yac_couple_config_component_get_field_collection_size()

size_t yac_couple_config_component_get_field_collection_size ( struct yac_couple_config_component const * component,
size_t grid_idx,
char const * field_name )

Return the collection size of a field.

Parameters
[in]componentComponent.
[in]grid_idxGrid index.
[in]field_nameField name.
Returns
Collection size.

Definition at line 292 of file couple_config_component.c.

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

◆ yac_couple_config_component_get_field_collection_size_by_idx()

size_t yac_couple_config_component_get_field_collection_size_by_idx ( struct yac_couple_config_component const * component,
size_t field_idx )

Return the collection size of a field identified by index.

Parameters
[in]componentComponent.
[in]field_idxField index.
Returns
Collection size.

Definition at line 394 of file couple_config_component.c.

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

◆ yac_couple_config_component_get_field_frac_mask_fallback_value()

double yac_couple_config_component_get_field_frac_mask_fallback_value ( struct yac_couple_config_component const * component,
size_t grid_idx,
char const * field_name )

Return the fractional mask fallback value of a field.

Parameters
[in]componentComponent.
[in]grid_idxGrid index.
[in]field_nameField name.
Returns
Fractional mask fallback value.

Definition at line 272 of file couple_config_component.c.

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

◆ yac_couple_config_component_get_field_frac_mask_fallback_value_by_idx()

double yac_couple_config_component_get_field_frac_mask_fallback_value_by_idx ( struct yac_couple_config_component const * component,
size_t field_idx )

Return the fractional mask fallback value of a field identified by index.

Parameters
[in]componentComponent.
[in]field_idxField index.
Returns
Fractional mask fallback value.

Definition at line 403 of file couple_config_component.c.

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

◆ yac_couple_config_component_get_field_grid_idx()

size_t yac_couple_config_component_get_field_grid_idx ( struct yac_couple_config_component const * component,
size_t field_idx )

Return the grid index of a field identified by index.

Parameters
[in]componentComponent.
[in]field_idxField index.
Returns
Grid index.

Definition at line 365 of file couple_config_component.c.

Here is the caller graph for this function:

◆ yac_couple_config_component_get_field_metadata()

char const * yac_couple_config_component_get_field_metadata ( struct yac_couple_config_component const * component,
size_t grid_idx,
char const * field_name )

Return the metadata for a field identified by grid index and field name.

Parameters
[in]componentComponent.
[in]grid_idxGrid index.
[in]field_nameField name.
Return values
metadataof the field
NULLif metadata is not set.

Definition at line 262 of file couple_config_component.c.

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

◆ yac_couple_config_component_get_field_name()

char const * yac_couple_config_component_get_field_name ( struct yac_couple_config_component const * component,
size_t field_idx )

Return the name of a field identified by index.

Parameters
[in]componentComponent.
[in]field_idxField index.
Returns
Field name.

Definition at line 353 of file couple_config_component.c.

Here is the caller graph for this function:

◆ yac_couple_config_component_get_field_timestep()

char const * yac_couple_config_component_get_field_timestep ( struct yac_couple_config_component const * component,
size_t grid_idx,
char const * field_name )

Return the timestep of a field identified by grid index and field name.

Parameters
[in]componentComponent.
[in]grid_idxGrid index.
[in]field_nameField name.
Return values
timestepof the field
NULLif not yet set.

Definition at line 413 of file couple_config_component.c.

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

◆ yac_couple_config_component_get_field_timestep_by_idx()

char const * yac_couple_config_component_get_field_timestep_by_idx ( struct yac_couple_config_component const * component,
size_t field_idx )

Return the timestep of a field identified by index.

Parameters
[in]componentComponent.
[in]field_idxField index.
Return values
timestepof the field
NULLif not yet set.

Definition at line 422 of file couple_config_component.c.

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

◆ yac_couple_config_component_get_name()

char const * yac_couple_config_component_get_name ( struct yac_couple_config_component const * component)

Return the name of a component.

Parameters
[in]componentComponent.
Returns
Component name.

Definition at line 231 of file couple_config_component.c.

Here is the caller graph for this function:

◆ yac_couple_config_component_set_field_frac_mask_fallback_value()

void yac_couple_config_component_set_field_frac_mask_fallback_value ( struct yac_couple_config_component * component,
size_t grid_idx,
char const * field_name,
double value )

Set the fractional mask fallback value of a field.

Parameters
[in,out]componentComponent.
[in]grid_idxGrid index.
[in]field_nameField name.
[in]valueFractional mask fallback value to set.

Definition at line 282 of file couple_config_component.c.

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

◆ yac_couple_config_component_set_field_metadata()

void yac_couple_config_component_set_field_metadata ( struct yac_couple_config_component * component,
size_t grid_idx,
char const * field_name,
char const * metadata )

Set the metadata of a field identified by grid index and field name.

Parameters
[in,out]componentComponent.
[in]grid_idxGrid index.
[in]field_nameField name.
[in]metadataMetadata string (NULL clears it).

Definition at line 430 of file couple_config_component.c.

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

◆ yac_couple_config_component_update_all_grid_idx()

void yac_couple_config_component_update_all_grid_idx ( struct yac_couple_config_component * component,
size_t const * old_to_new_idx )

Update all fields' grid indices using an old-to-new grid index mapping.

Parameters
[in,out]componentComponent.
[in]old_to_new_idxMapping from old to new grid indices.

Definition at line 373 of file couple_config_component.c.

Here is the caller graph for this function:

◆ yac_couple_config_component_update_or_append_field()

size_t yac_couple_config_component_update_or_append_field ( struct yac_couple_config_component * component,
char const * field_name,
size_t grid_idx,
char const * timestep,
size_t collection_size )

Update an existing field's timestep and collection size, or append it if it does not yet exist.

Parameters
[in,out]componentComponent.
[in]field_nameField name.
[in]grid_idxGrid index.
[in]timestepTimestep string.
[in]collection_sizeCollection size.
Returns
Index of the updated or appended field.

Definition at line 440 of file couple_config_component.c.

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

◆ yac_couple_config_components_free()

void yac_couple_config_components_free ( struct yac_couple_config_component ** components,
size_t * num_components )

Free all components and their dynamic data from a coupling configuration.

Parameters
[in,out]componentsComponent array.
[in,out]num_componentsNumber of components.

Definition at line 204 of file couple_config_component.c.

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

◆ yac_couple_config_components_merge()

void yac_couple_config_components_merge ( struct yac_couple_config_component ** components,
size_t * num_components,
struct yac_couple_config_couple * couples,
size_t num_couples,
MPI_Comm comm )

Synchronize and merge all components (including their fields) across ranks in the provided communicator.

Parameters
[in,out]componentsComponent array.
[in,out]num_componentsNumber of components.
[in,out]couplesCouple array.
[in]num_couplesNumber of couples.
[in]commMPI communicator.

Definition at line 173 of file couple_config_component.c.

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

◆ yac_couple_config_set_component_metadata_value()

void yac_couple_config_set_component_metadata_value ( struct yac_couple_config_component * component,
char const * metadata )

Set the metadata of a component.

Parameters
[in,out]componentComponent.
[in]metadataMetadata string (NULL is not allowed).

Definition at line 215 of file couple_config_component.c.

Here is the caller graph for this function: