YAC 3.21.0
Yet Another Coupler
Loading...
Searching...
No Matches
couple_config_field.c File Reference
#include "couple_config_field.h"
#include "collection_selection_internal.h"
#include "dist_merge.h"
#include "interpolation/interpolation_internal.h"
#include "yac_assert.h"
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
Include dependency graph for couple_config_field.c:

Go to the source code of this file.

Functions

void yac_couple_config_field_init (struct yac_couple_config_field *field, char const *name, size_t grid_idx, char const *timestep, size_t collection_size)
 
void yac_couple_config_field_set_timestep (struct yac_couple_config_field *field, char const *timestep)
 
char const * yac_couple_config_field_get_timestep (struct yac_couple_config_field const *field)
 
void yac_couple_config_field_set_collection_size (struct yac_couple_config_field *field, size_t collection_size)
 
void yac_couple_config_set_field_metadata_value (struct yac_couple_config_field *field, char const *metadata)
 
char const * yac_couple_config_field_get_metadata (struct yac_couple_config_field const *field)
 
double yac_couple_config_field_get_frac_mask_fallback_value (struct yac_couple_config_field const *field)
 
void yac_couple_config_field_set_frac_mask_fallback_value (struct yac_couple_config_field *field, double value)
 
size_t yac_couple_config_field_get_collection_size (struct yac_couple_config_field const *field)
 
static size_t yac_couple_config_field_get_pack_size (void *field_, MPI_Comm comm)
 
static void yac_couple_config_field_pack (void *field_, void *buffer, int buffer_size, int *position, MPI_Comm comm)
 
static void yac_couple_config_field_unpack (void *buffer, int buffer_size, int *position, void *field_, MPI_Comm comm)
 
static int yac_couple_config_field_compare (void const *a_, void const *b_)
 
static void yac_couple_config_field_merge (void *a_, void *b_, MPI_Comm comm)
 
void yac_couple_config_field_free (struct yac_couple_config_field *field)
 
static void yac_couple_config_field_free_ (void *field)
 
void yac_couple_config_fields_merge (size_t *num_fields, struct yac_couple_config_field **fields, MPI_Comm comm, size_t **old_to_new_idx)
 
struct yac_couple_config_field * yac_couple_config_field_find (size_t num_fields, struct yac_couple_config_field *fields, struct yac_couple_config_field const *field)
 
int yac_couple_config_field_has_valid_definition (struct yac_couple_config_field const *field)
 

Variables

static struct yac_dist_merge_vtable dist_merge_vtable_field
 

Function Documentation

◆ yac_couple_config_field_compare()

static int yac_couple_config_field_compare ( void const * a_,
void const * b_ )
static

Definition at line 188 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_find()

struct yac_couple_config_field * yac_couple_config_field_find ( size_t num_fields,
struct yac_couple_config_field * fields,
struct yac_couple_config_field const * field )

Search for a matching field in an array.

Parameters
[in]num_fieldsNumber of fields.
[in]fieldsArray of fields to search in.
[in]fieldField to search for.
Return values
fieldif a match is found
NULLif not found.

Definition at line 373 of file couple_config_field.c.

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

◆ yac_couple_config_field_free()

void yac_couple_config_field_free ( struct yac_couple_config_field * field)

Free all dynamic data owned by a field.

Parameters
[in,out]fieldField.

Definition at line 340 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_free_()

static void yac_couple_config_field_free_ ( void * field)
static

Definition at line 349 of file couple_config_field.c.

Here is the call graph for this function:

◆ yac_couple_config_field_get_collection_size()

size_t yac_couple_config_field_get_collection_size ( struct yac_couple_config_field const * field)

Return the collection size of a field.

Parameters
[in]fieldField.
Returns
Collection size.

Definition at line 126 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_get_frac_mask_fallback_value()

double yac_couple_config_field_get_frac_mask_fallback_value ( struct yac_couple_config_field const * field)

Return the fractional mask fallback value of a field.

Parameters
[in]fieldField.
Returns
Fractional mask fallback value.

Definition at line 96 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_get_metadata()

char const * yac_couple_config_field_get_metadata ( struct yac_couple_config_field const * field)

Return the metadata of a field.

Parameters
[in]fieldField.
Return values
metadataof the field
NULLif metadata is not set.

Definition at line 90 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_get_pack_size()

static size_t yac_couple_config_field_get_pack_size ( void * field_,
MPI_Comm comm )
static

Definition at line 132 of file couple_config_field.c.

Here is the call graph for this function:

◆ yac_couple_config_field_get_timestep()

char const * yac_couple_config_field_get_timestep ( struct yac_couple_config_field const * field)

Return the timestep of a field.

Parameters
[in]fieldField.
Return values
timestepof the field
NULLif timestep is not set.

Definition at line 50 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_has_valid_definition()

int yac_couple_config_field_has_valid_definition ( struct yac_couple_config_field const * field)

Check if a field has a valid definition.

A field has a valid definition if it has a defined timestep and collection size.

Parameters
[in]fieldField.
Return values
Nonzeroif the field has a valid definition
Zerootherwise

Definition at line 388 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_init()

void yac_couple_config_field_init ( struct yac_couple_config_field * field,
char const * name,
size_t grid_idx,
char const * timestep,
size_t collection_size )

Initialize a yac_couple_config_field.

Parameters
[in,out]fieldField.
[in]nameField name.
[in]grid_idxGrid index.
[in]timestepTimestep string.
[in]collection_sizeCollection size.

Definition at line 18 of file couple_config_field.c.

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

◆ yac_couple_config_field_merge()

static void yac_couple_config_field_merge ( void * a_,
void * b_,
MPI_Comm comm )
static

Definition at line 198 of file couple_config_field.c.

◆ yac_couple_config_field_pack()

static void yac_couple_config_field_pack ( void * field_,
void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )
static

Definition at line 150 of file couple_config_field.c.

Here is the call graph for this function:

◆ yac_couple_config_field_set_collection_size()

void yac_couple_config_field_set_collection_size ( struct yac_couple_config_field * field,
size_t collection_size )

Set or validate the collection size of a field.

Parameters
[in,out]fieldField.
[in]collection_sizeCollection size.

Definition at line 55 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_set_frac_mask_fallback_value()

void yac_couple_config_field_set_frac_mask_fallback_value ( struct yac_couple_config_field * field,
double value )

Set the fractional mask fallback value of a field.

Parameters
[in,out]fieldField.
[in]valueFractional mask fallback value to set.

Definition at line 110 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_set_timestep()

void yac_couple_config_field_set_timestep ( struct yac_couple_config_field * field,
char const * timestep )

Set or validate the timestep of a field.

Parameters
[in,out]fieldField.
[in]timestepTimestep string.

Definition at line 34 of file couple_config_field.c.

Here is the caller graph for this function:

◆ yac_couple_config_field_unpack()

static void yac_couple_config_field_unpack ( void * buffer,
int buffer_size,
int * position,
void * field_,
MPI_Comm comm )
static

Definition at line 168 of file couple_config_field.c.

Here is the call graph for this function:

◆ yac_couple_config_fields_merge()

void yac_couple_config_fields_merge ( size_t * num_fields,
struct yac_couple_config_field ** fields,
MPI_Comm comm,
size_t ** old_to_new_idx )

Synchronize and merge fields across ranks.

Parameters
[in,out]num_fieldsNumber of fields.
[in,out]fieldsArray of fields.
[in]commMPI communicator.
[out]old_to_new_idxMapping from old to new field indices.

Definition at line 362 of file couple_config_field.c.

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

◆ yac_couple_config_set_field_metadata_value()

void yac_couple_config_set_field_metadata_value ( struct yac_couple_config_field * field,
char const * metadata )

Set or validate the metadata of a field.

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

Definition at line 72 of file couple_config_field.c.

Here is the caller graph for this function:

Variable Documentation

◆ dist_merge_vtable_field

struct yac_dist_merge_vtable dist_merge_vtable_field
static
Initial value:
=
static size_t yac_couple_config_field_get_pack_size(void *field_, MPI_Comm comm)
static void yac_couple_config_field_pack(void *field_, void *buffer, int buffer_size, int *position, MPI_Comm comm)
static void yac_couple_config_field_unpack(void *buffer, int buffer_size, int *position, void *field_, MPI_Comm comm)
static int yac_couple_config_field_compare(void const *a_, void const *b_)
static void yac_couple_config_field_free_(void *field)
static void yac_couple_config_field_merge(void *a_, void *b_, MPI_Comm comm)

Definition at line 354 of file couple_config_field.c.