YetAnotherCoupler 3.2.0_a
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
interp_method_avg.c File Reference
#include "config.h"
#include <string.h>
#include "interp_method_internal.h"
#include "grid_cell.h"
#include "interp_method_avg.h"
#include "yac_lapack_interface.h"
Include dependency graph for interp_method_avg.c:

Go to the source code of this file.

Data Structures

struct  interp_method_avg
 

Macros

#define SWAP(x, y, T)   do { T SWAP = x; x = y; y = SWAP; } while (0)
 
#define IS_GC(x)   (((x) == YAC_GREAT_CIRCLE_EDGE) || ((x) == YAC_LON_CIRCLE_EDGE))
 
#define IS_LON_LAT(x)   (((x) == YAC_LAT_CIRCLE_EDGE) || ((x) == YAC_LON_CIRCLE_EDGE))
 

Typedefs

typedef int(* func_compute_weights) (double[3], size_t, yac_const_coordinate_pointer, int *, double *, enum yac_cell_type cell_type)
 

Functions

static size_t do_search_avg (struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights)
 
static void delete_avg (struct interp_method *method)
 
static int check_src_field_cell (double *point, size_t field_cell, size_t cell_size, size_t const *vertex_to_cell, size_t const *vertex_to_cell_offsets, yac_const_coordinate_pointer field_coordinates, struct yac_grid_cell *cell_buffer)
 
static enum yac_cell_type determine_cell_type (enum yac_edge_type const *edge_types, size_t const *edge_indices, size_t num_edges)
 
static int compute_weights_avg_yes (double tgt_coords[3], size_t num_vertices, yac_const_coordinate_pointer src_coords, int *src_mask, double *weights, enum yac_cell_type cell_type)
 
static int compute_weights_avg_no (double tgt_coords[3], size_t num_vertices, yac_const_coordinate_pointer src_coords, int *src_mask, double *weights, enum yac_cell_type cell_type)
 
static int compute_weights_dist_yes (double tgt_coords[3], size_t num_vertices, yac_const_coordinate_pointer src_coords, int *src_mask, double *weights, enum yac_cell_type cell_type)
 
static int compute_weights_dist_no (double tgt_coords[3], size_t num_vertices, yac_const_coordinate_pointer src_coords, int *src_mask, double *weights, enum yac_cell_type cell_type)
 
static void compute_barycentric_coords (double *barycentric_coords, size_t triangle_indices[3], yac_const_coordinate_pointer grid_coords)
 
static int get_lat_edge_ordering (double const *a, double const *b)
 
static void get_cell_lon_lat_bounds (yac_const_coordinate_pointer coords, double lon[2], double lat[2], int reorder[4])
 
static void get_point_lon_lat (double point_coord[3], double cell_lon[2], double cell_lat[2], double *point_lon, double *point_lat)
 
static int determine_triangle_idx (double point_lon, double point_lat, double cell_lon[2], double cell_lat[2])
 
static void compute_weights_bary_reg (double tgt_coords[3], yac_const_coordinate_pointer src_coords, double *weights)
 
static int compute_weights_bary_yes (double tgt_coords[3], size_t num_vertices, yac_const_coordinate_pointer src_coords, int *src_mask, double *weights, enum yac_cell_type cell_type)
 
static int compute_weights_bary_no (double tgt_coords[3], size_t num_vertices, yac_const_coordinate_pointer src_coords, int *src_mask, double *weights, enum yac_cell_type cell_type)
 
static func_compute_weights select_compute_weight_routine (enum yac_interp_avg_weight_type weight_type, int partial_coverage)
 
struct interp_methodyac_interp_method_avg_new (enum yac_interp_avg_weight_type weight_type, int partial_coverage)
 

Variables

static struct interp_method_vtable interp_method_avg_vtable
 

Macro Definition Documentation

◆ IS_GC

#define IS_GC (   x)    (((x) == YAC_GREAT_CIRCLE_EDGE) || ((x) == YAC_LON_CIRCLE_EDGE))

Definition at line 77 of file interp_method_avg.c.

◆ IS_LON_LAT

#define IS_LON_LAT (   x)    (((x) == YAC_LAT_CIRCLE_EDGE) || ((x) == YAC_LON_CIRCLE_EDGE))

Definition at line 78 of file interp_method_avg.c.

◆ SWAP

#define SWAP (   x,
  y,
 
)    do { T SWAP = x; x = y; y = SWAP; } while (0)

Definition at line 17 of file interp_method_avg.c.

Typedef Documentation

◆ func_compute_weights

typedef int(* func_compute_weights) (double[3], size_t, yac_const_coordinate_pointer, int *, double *, enum yac_cell_type cell_type)

Definition at line 25 of file interp_method_avg.c.

Function Documentation

◆ check_src_field_cell()

static int check_src_field_cell ( double *  point,
size_t  field_cell,
size_t  cell_size,
size_t const *  vertex_to_cell,
size_t const *  vertex_to_cell_offsets,
yac_const_coordinate_pointer  field_coordinates,
struct yac_grid_cell cell_buffer 
)
static

Definition at line 40 of file interp_method_avg.c.

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

◆ compute_barycentric_coords()

static void compute_barycentric_coords ( double *  barycentric_coords,
size_t  triangle_indices[3],
yac_const_coordinate_pointer  grid_coords 
)
static

Definition at line 521 of file interp_method_avg.c.

Here is the caller graph for this function:

◆ compute_weights_avg_no()

static int compute_weights_avg_no ( double  tgt_coords[3],
size_t  num_vertices,
yac_const_coordinate_pointer  src_coords,
int *  src_mask,
double *  weights,
enum yac_cell_type  cell_type 
)
static

Definition at line 398 of file interp_method_avg.c.

Here is the caller graph for this function:

◆ compute_weights_avg_yes()

static int compute_weights_avg_yes ( double  tgt_coords[3],
size_t  num_vertices,
yac_const_coordinate_pointer  src_coords,
int *  src_mask,
double *  weights,
enum yac_cell_type  cell_type 
)
static

Definition at line 371 of file interp_method_avg.c.

Here is the caller graph for this function:

◆ compute_weights_bary_no()

static int compute_weights_bary_no ( double  tgt_coords[3],
size_t  num_vertices,
yac_const_coordinate_pointer  src_coords,
int *  src_mask,
double *  weights,
enum yac_cell_type  cell_type 
)
static

Definition at line 771 of file interp_method_avg.c.

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

◆ compute_weights_bary_reg()

static void compute_weights_bary_reg ( double  tgt_coords[3],
yac_const_coordinate_pointer  src_coords,
double *  weights 
)
static

Definition at line 615 of file interp_method_avg.c.

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

◆ compute_weights_bary_yes()

static int compute_weights_bary_yes ( double  tgt_coords[3],
size_t  num_vertices,
yac_const_coordinate_pointer  src_coords,
int *  src_mask,
double *  weights,
enum yac_cell_type  cell_type 
)
static

Definition at line 654 of file interp_method_avg.c.

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

◆ compute_weights_dist_no()

static int compute_weights_dist_no ( double  tgt_coords[3],
size_t  num_vertices,
yac_const_coordinate_pointer  src_coords,
int *  src_mask,
double *  weights,
enum yac_cell_type  cell_type 
)
static

Definition at line 479 of file interp_method_avg.c.

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

◆ compute_weights_dist_yes()

static int compute_weights_dist_yes ( double  tgt_coords[3],
size_t  num_vertices,
yac_const_coordinate_pointer  src_coords,
int *  src_mask,
double *  weights,
enum yac_cell_type  cell_type 
)
static

Definition at line 417 of file interp_method_avg.c.

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

◆ delete_avg()

static void delete_avg ( struct interp_method method)
static

Definition at line 907 of file interp_method_avg.c.

◆ determine_cell_type()

static enum yac_cell_type determine_cell_type ( enum yac_edge_type const *  edge_types,
size_t const *  edge_indices,
size_t  num_edges 
)
static

Definition at line 80 of file interp_method_avg.c.

Here is the caller graph for this function:

◆ determine_triangle_idx()

static int determine_triangle_idx ( double  point_lon,
double  point_lat,
double  cell_lon[2],
double  cell_lat[2] 
)
static

Definition at line 608 of file interp_method_avg.c.

Here is the caller graph for this function:

◆ do_search_avg()

static size_t do_search_avg ( struct interp_method method,
struct yac_interp_grid interp_grid,
size_t *  tgt_points,
size_t  count,
struct yac_interp_weights weights 
)
static

Definition at line 116 of file interp_method_avg.c.

Here is the call graph for this function:

◆ get_cell_lon_lat_bounds()

static void get_cell_lon_lat_bounds ( yac_const_coordinate_pointer  coords,
double  lon[2],
double  lat[2],
int  reorder[4] 
)
static

Definition at line 549 of file interp_method_avg.c.

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

◆ get_lat_edge_ordering()

static int get_lat_edge_ordering ( double const *  a,
double const *  b 
)
inlinestatic

Definition at line 544 of file interp_method_avg.c.

Here is the caller graph for this function:

◆ get_point_lon_lat()

static void get_point_lon_lat ( double  point_coord[3],
double  cell_lon[2],
double  cell_lat[2],
double *  point_lon,
double *  point_lat 
)
static

Definition at line 590 of file interp_method_avg.c.

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

◆ select_compute_weight_routine()

static func_compute_weights select_compute_weight_routine ( enum yac_interp_avg_weight_type  weight_type,
int  partial_coverage 
)
static

Definition at line 874 of file interp_method_avg.c.

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

◆ yac_interp_method_avg_new()

struct interp_method * yac_interp_method_avg_new ( enum yac_interp_avg_weight_type  weight_type,
int  partial_coverage 
)

Variable Documentation

◆ interp_method_avg_vtable

struct interp_method_vtable interp_method_avg_vtable
static
Initial value:
= {
.do_search = do_search_avg,
.delete = delete_avg}
static size_t do_search_avg(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights)
static void delete_avg(struct interp_method *method)

Definition at line 30 of file interp_method_avg.c.