YAC 3.17.0
Yet Another Coupler
Loading...
Searching...
No Matches
interp_method.h File Reference

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

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

Go to the source code of this file.

Macros

#define YAC_MAX_ROUTINE_NAME_LENGTH   (256)
 Maximum length for routine names (used as keys for callback registration)
 
#define YAC_MAX_FILE_NAME_LENGTH   (512)
 Maximum length for file names (used in user file interpolation)
 

Enumerations

enum  yac_interpolation_list {
  YAC_UNDEFINED , YAC_AVERAGE , YAC_N_NEAREST_NEIGHBOR , YAC_CONSERVATIVE ,
  YAC_SOURCE_TO_TARGET_MAP , YAC_FIXED_VALUE , YAC_USER_FILE , YAC_CHECK ,
  YAC_BERNSTEIN_BEZIER , YAC_RADIAL_BASIS_FUNCTION , YAC_CREEP , YAC_USER_CALLBACK ,
  YAC_NEAREST_CORNER_CELLS , YAC_DISTANCE_NEAREST_NEIGHBOR
}
 

Functions

struct yac_interp_weightsyac_interp_method_do_search (struct interp_method **method, struct yac_interp_grid *interp_grid)
 Perform weight computation using given interpolation stack and grid.
 
void yac_interp_method_delete (struct interp_method **method)
 Delete an interpolation stack and free its resources (but not the pointer array).
 
void yac_interp_method_cleanup ()
 Free static internal resources of all interpolation methods.
 

Detailed Description

Defines the interface of the interpolation method "base class" in YAC.

This header provides the public API and type definitions for all interpolation methods in YAC, serving as the base interface for method implementations.

Constructors for concrete interpolation method implementations can be found in method-specific include files (e.g., yac_interp_method_avg_new in interp_method_avg.h).

Definition in file interp_method.h.

Macro Definition Documentation

◆ YAC_MAX_FILE_NAME_LENGTH

#define YAC_MAX_FILE_NAME_LENGTH   (512)

Maximum length for file names (used in user file interpolation)

Definition at line 31 of file interp_method.h.

◆ YAC_MAX_ROUTINE_NAME_LENGTH

#define YAC_MAX_ROUTINE_NAME_LENGTH   (256)

Maximum length for routine names (used as keys for callback registration)

Definition at line 28 of file interp_method.h.

Enumeration Type Documentation

◆ yac_interpolation_list

Enumeration of supported interpolation methods.

Enumerator
YAC_UNDEFINED 

Undefined interpolation method.

YAC_AVERAGE 

Simple averaging (or linear) interpolation.

YAC_N_NEAREST_NEIGHBOR 

N-nearest-neighbor interpolation.

YAC_CONSERVATIVE 

Conservative remapping (area/flux conserving)

YAC_SOURCE_TO_TARGET_MAP 

Source-to-target mapping (inverse N-nearest-neighbor)

YAC_FIXED_VALUE 

Assigns a fixed value to all targets.

YAC_USER_FILE 

User-supplied weights from file.

YAC_CHECK 

Diagnostic check method (for testing)

YAC_BERNSTEIN_BEZIER 

Bernstein-Bezier interpolation.

YAC_RADIAL_BASIS_FUNCTION 

Radial basis function interpolation.

YAC_CREEP 

Creep-fill interpolation.

YAC_USER_CALLBACK 

Interpolation using user-defined weight computation callback routine

YAC_NEAREST_CORNER_CELLS 

Nearest-corner-cell interpolation.

YAC_DISTANCE_NEAREST_NEIGHBOR 

Distance-nearest-neighbor interpolation.

Definition at line 36 of file interp_method.h.

Function Documentation

◆ yac_interp_method_cleanup()

void yac_interp_method_cleanup ( )

Free static internal resources of all interpolation methods.

Cleans up static internal resources such as lookup tables for callback functions used by the check and user callback interpolation methods. This function should be called to release memory used by these resources after all interpolation operations are complete.

Definition at line 63 of file interp_method.c.

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

◆ yac_interp_method_delete()

void yac_interp_method_delete ( struct interp_method ** method)

Delete an interpolation stack and free its resources (but not the pointer array).

This function deletes all interpolation method instances in the stack pointed to by method. The pointer array itself (the stack) is not freed; only the method instances are deleted. The stack must be NULL-terminated.

Parameters
methodArray of pointers to interpolation method instances (stack), NULL-terminated

Definition at line 54 of file interp_method.c.

Here is the caller graph for this function:

◆ yac_interp_method_do_search()

struct yac_interp_weights * yac_interp_method_do_search ( struct interp_method ** method,
struct yac_interp_grid * interp_grid )

Perform weight computation using given interpolation stack and grid.

This function computes the interpolation weights for the specified interpolation stack and source/target grid configuration (interp_grid). The input is an interpolation stack: An array of pointers to interpolation methods, where the last entry must be NULL to mark the end of the list.

Parameters
methodArray of pointers to interpolation method instances (stack), NULL-terminated (last entry must be NULL)
interp_gridPointer to the interpolation grid
Returns
Pointer to the resulting interpolation weights structure

Definition at line 15 of file interp_method.c.

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