YAC 3.18.0
Yet Another Coupler
Loading...
Searching...
No Matches
interp_method_utils.h File Reference
Include dependency graph for interp_method_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID, ROUTINE_NAME)
 
#define CHECK_SRC_FIELD_COUNT_SINGLE(INTERP_GRID, ROUTINE_NAME)
 
#define CHECK_SRC_FIELD_LOCATION_CORNER_OR_CELL(INTERP_GRID, ROUTINE_NAME)
 
#define CHECK_SRC_FIELD_LOCATION_CELL(INTERP_GRID, ROUTINE_NAME)
 
#define CHECK_TGT_FIELD_LOCATION_CELL(INTERP_GRID, ROUTINE_NAME)
 

Typedefs

typedef void(* yac_interp_compute_weights_func) (double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const scale)
 

Functions

void yac_interp_compute_weights_avg (double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const dummy)
 
void yac_interp_compute_weights_dist (double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const dummy)
 
void yac_interp_compute_weights_gauss (double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const gauss_scale)
 
void yac_interp_compute_weights_rbf (double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const rbf_scale)
 

Macro Definition Documentation

◆ CHECK_INTERP_GRID_HAS_SRC_FIELDS

#define CHECK_INTERP_GRID_HAS_SRC_FIELDS ( INTERP_GRID,
ROUTINE_NAME )
Value:
INTERP_GRID, ROUTINE_NAME, \
"Number of source fields is 0.")
size_t yac_interp_grid_get_num_src_fields(struct yac_interp_grid *interp_grid)
#define YAC_INTERP_GRID_ASSERT(INTERP_GRID, ROUTINE_NAME, EXP, MSG)

Definition at line 80 of file interp_method_utils.h.

◆ CHECK_SRC_FIELD_COUNT_SINGLE

#define CHECK_SRC_FIELD_COUNT_SINGLE ( INTERP_GRID,
ROUTINE_NAME )
Value:
CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID, ROUTINE_NAME) \
YAC_INTERP_GRID_FIELD_ASSERT_F( \
INTERP_GRID, ROUTINE_NAME, \
"Invalid number of source fields. Got %zu, expected 1.", \
#define CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID, ROUTINE_NAME)

Definition at line 86 of file interp_method_utils.h.

◆ CHECK_SRC_FIELD_LOCATION_CELL

#define CHECK_SRC_FIELD_LOCATION_CELL ( INTERP_GRID,
ROUTINE_NAME )
Value:
CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID, ROUTINE_NAME) \
YAC_INTERP_GRID_FIELD_ASSERT( \
INTERP_GRID, ROUTINE_NAME, \
"This interpolation method only supports source fields defined as CELL")
enum yac_location yac_interp_grid_get_src_field_location(struct yac_interp_grid *interp_grid, size_t src_field_idx)
@ YAC_LOC_CELL
Definition location.h:14

Definition at line 102 of file interp_method_utils.h.

◆ CHECK_SRC_FIELD_LOCATION_CORNER_OR_CELL

#define CHECK_SRC_FIELD_LOCATION_CORNER_OR_CELL ( INTERP_GRID,
ROUTINE_NAME )
Value:
CHECK_INTERP_GRID_HAS_SRC_FIELDS(INTERP_GRID, ROUTINE_NAME) \
YAC_INTERP_GRID_FIELD_ASSERT( \
INTERP_GRID, ROUTINE_NAME, \
"This interpolation method only supports source fields defined as CORNER or CELL")
@ YAC_LOC_CORNER
Definition location.h:15

Definition at line 94 of file interp_method_utils.h.

◆ CHECK_TGT_FIELD_LOCATION_CELL

#define CHECK_TGT_FIELD_LOCATION_CELL ( INTERP_GRID,
ROUTINE_NAME )
Value:
INTERP_GRID, ROUTINE_NAME, \
"This interpolation method only supports target fields defined as CELL")
enum yac_location yac_interp_grid_get_tgt_field_location(struct yac_interp_grid *interp_grid)
#define YAC_INTERP_GRID_FIELD_ASSERT(INTERP_GRID, ROUTINE_NAME, EXP, MSG)

Definition at line 109 of file interp_method_utils.h.

Typedef Documentation

◆ yac_interp_compute_weights_func

typedef void(* yac_interp_compute_weights_func) (double tgt_coord[3], yac_const_coordinate_pointer src_coords, size_t const n, double *weights, double const scale)

Function pointer type for weight computation functions

Parameters
[in]tgt_coordtarget coordinate
[in]src_coordssource coordinates
[in]nnumber of source points
[out]weightsweights array (size n)
[in]scalescale parameter (interpretation depends on function)

Definition at line 21 of file interp_method_utils.h.

Function Documentation

◆ yac_interp_compute_weights_avg()

void yac_interp_compute_weights_avg ( double tgt_coord[3],
yac_const_coordinate_pointer src_coords,
size_t const n,
double * weights,
double const dummy )

Computes equal weights (simple average)

Parameters
[in]tgt_coordtarget coordinate (unused)
[in]src_coordssource coordinates (unused)
[in]nnumber of source points
[out]weightsweights array (size n)
[in]dummydummy parameter (unused)

Definition at line 19 of file interp_method_utils.c.

Here is the caller graph for this function:

◆ yac_interp_compute_weights_dist()

void yac_interp_compute_weights_dist ( double tgt_coord[3],
yac_const_coordinate_pointer src_coords,
size_t const n,
double * weights,
double const dummy )

Computes inverse distance weighted average

Parameters
[in]tgt_coordtarget coordinate
[in]src_coordssource coordinates
[in]nnumber of source points
[out]weightsweights array (size n)
[in]dummydummy parameter (unused)

Definition at line 31 of file interp_method_utils.c.

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

◆ yac_interp_compute_weights_gauss()

void yac_interp_compute_weights_gauss ( double tgt_coord[3],
yac_const_coordinate_pointer src_coords,
size_t const n,
double * weights,
double const gauss_scale )

Computes Gauss weighted average

Parameters
[in]tgt_coordtarget coordinate
[in]src_coordssource coordinates
[in]nnumber of source points
[out]weightsweights array (size n)
[in]gauss_scalescale factor for Gauss weighting

Definition at line 59 of file interp_method_utils.c.

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

◆ yac_interp_compute_weights_rbf()

void yac_interp_compute_weights_rbf ( double tgt_coord[3],
yac_const_coordinate_pointer src_coords,
size_t const n,
double * weights,
double const rbf_scale )

Computes radial basis function (RBF) weighted average

Parameters
[in]tgt_coordtarget coordinate
[in]src_coordssource coordinates
[in]nnumber of source points
[out]weightsweights array (size n)
[in]rbf_scalescale factor for RBF weighting

Definition at line 160 of file interp_method_utils.c.

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