YAC 3.18.0
Yet Another Coupler
Loading...
Searching...
No Matches
interp_method_config.h File Reference

Defines the interface for interpolation method configuration "base class" in YAC. More...

#include "interp_method.h"
Include dependency graph for interp_method_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void yac_interp_method_config_delete (struct yac_interp_method_config *config)
 
struct yac_interp_method_configyac_interp_method_config_copy (const struct yac_interp_method_config *config)
 
int yac_interp_method_config_compare (struct yac_interp_method_config const *a, struct yac_interp_method_config const *b)
 
size_t yac_interp_method_config_get_pack_size (struct yac_interp_method_config const *config, MPI_Comm comm)
 
void yac_interp_method_config_pack (struct yac_interp_method_config const *config, void *buffer, int buffer_size, int *position, MPI_Comm comm)
 
struct yac_interp_method_configyac_interp_method_config_unpack (void *buffer, int buffer_size, int *position, MPI_Comm comm)
 
enum yac_interpolation_list yac_interp_method_config_get_type (struct yac_interp_method_config const *config)
 
struct yac_paramyac_interp_method_config_get_param (struct yac_interp_method_config const *config)
 
struct yac_interp_method_configyac_interp_method_config_default_from_name_new (char const *method_name)
 
struct interp_methodyac_interp_method_config_generate (struct yac_interp_method_config const *config)
 
void yac_interp_method_config_set_param_str (struct yac_interp_method_config *config, const char *path, const char *value)
 
void yac_interp_method_config_set_param_int (struct yac_interp_method_config *config, const char *path, int value)
 
void yac_interp_method_config_set_param_dble (struct yac_interp_method_config *config, const char *path, double value)
 
int yac_interp_method_config_get_param_int (struct yac_interp_method_config const *config, const char *path)
 
double yac_interp_method_config_get_param_dble (struct yac_interp_method_config const *config, const char *path)
 
char * yac_interp_method_config_get_param_str (struct yac_interp_method_config const *config, const char *path)
 
size_t yac_interp_method_config_get_list_size (struct yac_interp_method_config const *config, const char *path)
 
size_t yac_interp_method_config_append_list_element (struct yac_interp_method_config *config, const char *path)
 

Detailed Description

Defines the interface for interpolation method configuration "base class" in YAC.

See also
Interpolation Method Configurations

This header provides the public API for managing interpolation method configurations, including copying, comparison, packing/unpacking for MPI communication, and generating interpolation method instances from configurations.

The actual structure of yac_interp_method_config is opaque to users and is managed internally by the YAC library. Users interact with it through the provided interface functions.

The purpose of an interpolation method configuration class is to enable the exchange and comparison of method configurations between processes during initialization (for example, when a configuration file is read by only a subset of processes). Interpolation stack configurations (see interp_stack_config.h) hold abstract representations of interpolation method configurations, without requiring knowledge of the specifics of each individual method. When an actual interpolation method instance is needed, it can be generated from the abstract configuration using the generic interface.

Concrete constructors for interpolation method configurations can be found in the method-specific header files (e.g., yac_interp_method_config_default_avg_new in interp_method_avg.h).

Definition in file interp_method_config.h.

Function Documentation

◆ yac_interp_method_config_append_list_element()

size_t yac_interp_method_config_append_list_element ( struct yac_interp_method_config * config,
const char * path )

Append a new default element to a list parameter identified by a dot-separated path. The new element's sub-parameters can then be set using the scalar setters with a path of the form "listname.N.subparam" where N is the returned index.

Parameters
configPointer to config (must not be NULL).
pathDot-separated path to the list parameter.
Returns
Zero-based index of the newly appended element.

Definition at line 507 of file interp_method_config.c.

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

◆ yac_interp_method_config_compare()

int yac_interp_method_config_compare ( struct yac_interp_method_config const * a,
struct yac_interp_method_config const * b )

Compare two yac_interp_method_config instances.

Parameters
aFirst config.
bSecond config.
Returns
-1, 0, or 1 as in memcmp.

Definition at line 98 of file interp_method_config.c.

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

◆ yac_interp_method_config_copy()

struct yac_interp_method_config * yac_interp_method_config_copy ( const struct yac_interp_method_config * config)

Copy an yac_interp_method_config instance.

Parameters
configPointer to config to copy.
Returns
Newly allocated copy.

Definition at line 81 of file interp_method_config.c.

Here is the caller graph for this function:

◆ yac_interp_method_config_default_from_name_new()

struct yac_interp_method_config * yac_interp_method_config_default_from_name_new ( char const * method_name)

Create an interpolation method configuration with default values by name.

Parameters
method_nameInterpolation method identifier string.
Returns
Newly allocated config.

Definition at line 205 of file interp_method_config.c.

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

◆ yac_interp_method_config_delete()

void yac_interp_method_config_delete ( struct yac_interp_method_config * config)

Delete (deallocate) an yac_interp_method_config instance.

Parameters
configPointer to config to delete.

Definition at line 74 of file interp_method_config.c.

Here is the caller graph for this function:

◆ yac_interp_method_config_generate()

struct interp_method * yac_interp_method_config_generate ( struct yac_interp_method_config const * config)

Generate interp_method instance from config.

Parameters
configPointer to config.
Returns
Newly allocated interp_method instance.

Definition at line 244 of file interp_method_config.c.

Here is the caller graph for this function:

◆ yac_interp_method_config_get_list_size()

size_t yac_interp_method_config_get_list_size ( struct yac_interp_method_config const * config,
const char * path )

Get the number of elements in a list parameter identified by a dot-separated path.

Parameters
configPointer to config (must not be NULL).
pathDot-separated path to the list parameter.
Returns
Number of elements currently in the list.

Definition at line 484 of file interp_method_config.c.

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

◆ yac_interp_method_config_get_pack_size()

size_t yac_interp_method_config_get_pack_size ( struct yac_interp_method_config const * config,
MPI_Comm comm )

Get the size (in bytes) required to pack this config with MPI_Pack.

Parameters
configPointer to config.
commMPI communicator (for MPI_Pack_size).
Returns
Size in bytes required for packing.

Definition at line 121 of file interp_method_config.c.

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

◆ yac_interp_method_config_get_param()

struct yac_param * yac_interp_method_config_get_param ( struct yac_interp_method_config const * config)

Get a handle to the parameter tree for this config.

Parameters
configPointer to config.
Returns
Pointer to root yac_param.

Definition at line 195 of file interp_method_config.c.

Here is the caller graph for this function:

◆ yac_interp_method_config_get_param_dble()

double yac_interp_method_config_get_param_dble ( struct yac_interp_method_config const * config,
const char * path )

Get the double value of a parameter identified by a dot-separated path.

Parameters
configPointer to config (must not be NULL).
pathDot-separated path to the target parameter.
Returns
Double value of the parameter.

Definition at line 417 of file interp_method_config.c.

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

◆ yac_interp_method_config_get_param_int()

int yac_interp_method_config_get_param_int ( struct yac_interp_method_config const * config,
const char * path )

Get the integer value of a parameter identified by a dot-separated path.

Parameters
configPointer to config (must not be NULL).
pathDot-separated path to the target parameter.
Returns
Integer value of the parameter.

Definition at line 394 of file interp_method_config.c.

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

◆ yac_interp_method_config_get_param_str()

char * yac_interp_method_config_get_param_str ( struct yac_interp_method_config const * config,
const char * path )

Get a copy of the string representation of a parameter identified by a dot-separated path.

Parameters
configPointer to config (must not be NULL).
pathDot-separated path to the target parameter.
Returns
Newly allocated string with the parameter value; caller must free().

Definition at line 440 of file interp_method_config.c.

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

◆ yac_interp_method_config_get_type()

enum yac_interpolation_list yac_interp_method_config_get_type ( struct yac_interp_method_config const * config)

Get the type identifier for this config.

Parameters
configPointer to config.
Returns
Interpolation method type identifier.

Definition at line 183 of file interp_method_config.c.

Here is the caller graph for this function:

◆ yac_interp_method_config_pack()

void yac_interp_method_config_pack ( struct yac_interp_method_config const * config,
void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

Pack config into MPI buffer.

Parameters
configPointer to config.
bufferBuffer to pack into.
buffer_sizeSize of buffer.
positionPosition in buffer (as in MPI_Pack).
commMPI communicator.

Definition at line 133 of file interp_method_config.c.

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

◆ yac_interp_method_config_set_param_dble()

void yac_interp_method_config_set_param_dble ( struct yac_interp_method_config * config,
const char * path,
double value )

Set a parameter of the config identified by a dot-separated path to a double value.

Parameters
configPointer to config (must not be NULL).
pathDot-separated path to the target parameter.
valueDouble value to set.

Definition at line 373 of file interp_method_config.c.

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

◆ yac_interp_method_config_set_param_int()

void yac_interp_method_config_set_param_int ( struct yac_interp_method_config * config,
const char * path,
int value )

Set a parameter of the config identified by a dot-separated path to an integer value.

Parameters
configPointer to config (must not be NULL).
pathDot-separated path to the target parameter.
valueInteger value to set.

Definition at line 352 of file interp_method_config.c.

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

◆ yac_interp_method_config_set_param_str()

void yac_interp_method_config_set_param_str ( struct yac_interp_method_config * config,
const char * path,
const char * value )

Set a parameter of the config identified by a dot-separated path to a string value (parsed according to the parameter's type).

Parameters
configPointer to config (must not be NULL).
pathDot-separated path to the target parameter, e.g. "n" or "search_distance.fixed".
valueString representation of the new value.

Definition at line 330 of file interp_method_config.c.

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

◆ yac_interp_method_config_unpack()

struct yac_interp_method_config * yac_interp_method_config_unpack ( void * buffer,
int buffer_size,
int * position,
MPI_Comm comm )

Unpack config from MPI buffer.

Parameters
bufferBuffer to unpack from.
buffer_sizeSize of buffer.
positionPosition in buffer (as in MPI_Unpack).
commMPI communicator.
Returns
Newly allocated config.

Definition at line 148 of file interp_method_config.c.

Here is the caller graph for this function: