YetAnotherCoupler 3.2.0_a
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
interp_method_conserv.c File Reference
#include "config.h"
#include <string.h>
#include "interp_method_internal.h"
#include "interp_method_conserv.h"
#include "clipping.h"
#include "area.h"
#include "float.h"
Include dependency graph for interp_method_conserv.c:

Go to the source code of this file.

Data Structures

struct  interp_method_conserv
 
struct  weight_vector_data
 
struct  weight_vector_data_3d
 
struct  weight_vector_3d
 
struct  supermesh_cell
 

Macros

#define AREA_TOL_FACTOR   (1e-6)
 

Functions

static size_t do_search_conserv_1st_order (struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights)
 
static size_t do_search_conserv_2nd_order (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_conserv (struct interp_method *method)
 
static int get_max_num_vertices_per_cell (struct yac_const_basic_grid_data *basic_grid_data)
 
static void get_cell_buffers (struct yac_interp_grid *interp_grid, size_t max_num_src_per_tgt, struct yac_grid_cell *tgt_grid_cell, struct yac_grid_cell **src_grid_cells)
 
static void get_cell_buffers_ (struct yac_interp_grid *interp_grid, struct yac_grid_cell *tgt_grid_cell, struct yac_grid_cell *src_grid_cell)
 
static int compute_1st_order_weights (struct yac_const_basic_grid_data *tgt_basic_grid_data, size_t tgt_cell, struct yac_const_basic_grid_data *src_basic_grid_data, size_t src_count, size_t *src_cells, struct yac_grid_cell tgt_grid_cell_buffer, struct yac_grid_cell *src_grid_cell_buffer, double *weights, size_t *num_weights, int partial_coverage, enum yac_interp_method_conserv_normalisation normalisation, int enforced_conserv)
 
static int compare_supermesh_cell_src_local_ids (const void *a, const void *b)
 
static int compare_supermesh_cell_tgt_local_ids (const void *a, const void *b)
 
static void orthogonalise_weight_vector (double *src_cell_centroid, struct weight_vector_3d *G_i, struct weight_vector_data_3d *buffer)
 
static int compare_weight_vector_data_weight (void const *a, void const *b)
 
static int compare_weight_vector_data (void const *a, void const *b)
 
static void compact_weight_vector_data (struct weight_vector_data *weights, size_t *n)
 
static size_t compute_2nd_order_tgt_cell_weights (struct supermesh_cell *super_cell, struct weight_vector_data *weights)
 
static void compute_cell_barycenter (struct yac_const_basic_grid_data *grid_data, size_t cell_idx, double barycenter[3])
 
static void compute_super_cells (struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct supermesh_cell **super_cells_, size_t *num_super_cells, int *interp_fail_flag, size_t **src_cells, size_t *num_src_cells, enum yac_interp_method_conserv_normalisation normalisation, int partial_coverage)
 
static yac_coordinate_pointer compute_src_cell_centroids (struct yac_interp_grid *interp_grid, size_t *src_cells, int *skip_src_cell, size_t num_src_cells, struct supermesh_cell *super_cells, size_t num_super_cells)
 
static struct weight_vector_3dcompute_src_cell_gradients (struct yac_interp_grid *interp_grid, size_t *src_cells, yac_coordinate_pointer src_cell_centroids, int *skip_src_cell, size_t num_src_cells, size_t *src_cell_neighbours)
 
static size_t compute_2nd_order_weights (struct yac_interp_grid *interp_grid, size_t *tgt_cells, int *interp_fail_flag, size_t num_tgt_cells, struct supermesh_cell *super_cells, size_t num_super_cells, size_t **src_per_tgt, double **weights, size_t *num_src_per_tgt)
 
struct interp_methodyac_interp_method_conserv_new (int order, int enforced_conserv, int partial_coverage, enum yac_interp_method_conserv_normalisation normalisation)
 

Variables

static struct interp_method_vtable interp_method_conserv_1st_order_vtable
 
static struct interp_method_vtable interp_method_conserv_2nd_order_vtable
 

Macro Definition Documentation

◆ AREA_TOL_FACTOR

#define AREA_TOL_FACTOR   (1e-6)

Definition at line 18 of file interp_method_conserv.c.

Function Documentation

◆ compact_weight_vector_data()

static void compact_weight_vector_data ( struct weight_vector_data weights,
size_t *  n 
)
static

Definition at line 472 of file interp_method_conserv.c.

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

◆ compare_supermesh_cell_src_local_ids()

static int compare_supermesh_cell_src_local_ids ( const void *  a,
const void *  b 
)
static

Definition at line 376 of file interp_method_conserv.c.

Here is the caller graph for this function:

◆ compare_supermesh_cell_tgt_local_ids()

static int compare_supermesh_cell_tgt_local_ids ( const void *  a,
const void *  b 
)
static

Definition at line 389 of file interp_method_conserv.c.

Here is the caller graph for this function:

◆ compare_weight_vector_data()

static int compare_weight_vector_data ( void const *  a,
void const *  b 
)
static

Definition at line 461 of file interp_method_conserv.c.

Here is the caller graph for this function:

◆ compare_weight_vector_data_weight()

static int compare_weight_vector_data_weight ( void const *  a,
void const *  b 
)
static

Definition at line 443 of file interp_method_conserv.c.

Here is the caller graph for this function:

◆ compute_1st_order_weights()

static int compute_1st_order_weights ( struct yac_const_basic_grid_data tgt_basic_grid_data,
size_t  tgt_cell,
struct yac_const_basic_grid_data src_basic_grid_data,
size_t  src_count,
size_t *  src_cells,
struct yac_grid_cell  tgt_grid_cell_buffer,
struct yac_grid_cell src_grid_cell_buffer,
double *  weights,
size_t *  num_weights,
int  partial_coverage,
enum yac_interp_method_conserv_normalisation  normalisation,
int  enforced_conserv 
)
static

Definition at line 158 of file interp_method_conserv.c.

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

◆ compute_2nd_order_tgt_cell_weights()

static size_t compute_2nd_order_tgt_cell_weights ( struct supermesh_cell super_cell,
struct weight_vector_data weights 
)
static

Definition at line 511 of file interp_method_conserv.c.

Here is the caller graph for this function:

◆ compute_2nd_order_weights()

static size_t compute_2nd_order_weights ( struct yac_interp_grid interp_grid,
size_t *  tgt_cells,
int *  interp_fail_flag,
size_t  num_tgt_cells,
struct supermesh_cell super_cells,
size_t  num_super_cells,
size_t **  src_per_tgt,
double **  weights,
size_t *  num_src_per_tgt 
)
static

Definition at line 981 of file interp_method_conserv.c.

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

◆ compute_cell_barycenter()

static void compute_cell_barycenter ( struct yac_const_basic_grid_data grid_data,
size_t  cell_idx,
double  barycenter[3] 
)
static

Definition at line 541 of file interp_method_conserv.c.

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

◆ compute_src_cell_centroids()

static yac_coordinate_pointer compute_src_cell_centroids ( struct yac_interp_grid interp_grid,
size_t *  src_cells,
int *  skip_src_cell,
size_t  num_src_cells,
struct supermesh_cell super_cells,
size_t  num_super_cells 
)
static

Definition at line 736 of file interp_method_conserv.c.

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

◆ compute_src_cell_gradients()

static struct weight_vector_3d * compute_src_cell_gradients ( struct yac_interp_grid interp_grid,
size_t *  src_cells,
yac_coordinate_pointer  src_cell_centroids,
int *  skip_src_cell,
size_t  num_src_cells,
size_t *  src_cell_neighbours 
)
static

Definition at line 802 of file interp_method_conserv.c.

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

◆ compute_super_cells()

static void compute_super_cells ( struct yac_interp_grid interp_grid,
size_t *  tgt_points,
size_t  count,
struct supermesh_cell **  super_cells_,
size_t *  num_super_cells,
int *  interp_fail_flag,
size_t **  src_cells,
size_t *  num_src_cells,
enum yac_interp_method_conserv_normalisation  normalisation,
int  partial_coverage 
)
static

Definition at line 563 of file interp_method_conserv.c.

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

◆ delete_conserv()

static void delete_conserv ( struct interp_method method)
static

Definition at line 1249 of file interp_method_conserv.c.

◆ do_search_conserv_1st_order()

static size_t do_search_conserv_1st_order ( 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 230 of file interp_method_conserv.c.

Here is the call graph for this function:

◆ do_search_conserv_2nd_order()

static size_t do_search_conserv_2nd_order ( 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 1080 of file interp_method_conserv.c.

Here is the call graph for this function:

◆ get_cell_buffers()

static void get_cell_buffers ( struct yac_interp_grid interp_grid,
size_t  max_num_src_per_tgt,
struct yac_grid_cell tgt_grid_cell,
struct yac_grid_cell **  src_grid_cells 
)
static

Definition at line 88 of file interp_method_conserv.c.

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

◆ get_cell_buffers_()

static void get_cell_buffers_ ( struct yac_interp_grid interp_grid,
struct yac_grid_cell tgt_grid_cell,
struct yac_grid_cell src_grid_cell 
)
static

Definition at line 127 of file interp_method_conserv.c.

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

◆ get_max_num_vertices_per_cell()

static int get_max_num_vertices_per_cell ( struct yac_const_basic_grid_data basic_grid_data)
static

Definition at line 76 of file interp_method_conserv.c.

Here is the caller graph for this function:

◆ orthogonalise_weight_vector()

static void orthogonalise_weight_vector ( double *  src_cell_centroid,
struct weight_vector_3d G_i,
struct weight_vector_data_3d buffer 
)
inlinestatic

Definition at line 401 of file interp_method_conserv.c.

Here is the caller graph for this function:

◆ yac_interp_method_conserv_new()

struct interp_method * yac_interp_method_conserv_new ( int  order,
int  enforced_conserv,
int  partial_coverage,
enum yac_interp_method_conserv_normalisation  normalisation 
)

constructor for a interpolation method of type interp_method_conserv

Parameters
[in]order1st or 2nd order remapping
[in]enforced_conservenforce conservation by correcting truncation errors
[in]partial_coverageif == 0, target cells that are not completely covered by non-masked source cells will not be interpolated (this is the default option)
if != 0, for target cells that are only partially covered by non-mask source cells the interpolation value will be determined by the contributions of the respective source cells
[in]normalisationspecifies how to do the normalisation
Examples
test_interp_method_conserv_parallel.c, and test_interp_method_creep_parallel.c.

Definition at line 1224 of file interp_method_conserv.c.

Here is the caller graph for this function:

Variable Documentation

◆ interp_method_conserv_1st_order_vtable

struct interp_method_vtable interp_method_conserv_1st_order_vtable
static
Initial value:
= {
.delete = delete_conserv}
static void delete_conserv(struct interp_method *method)
static size_t do_search_conserv_1st_order(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights)

Definition at line 31 of file interp_method_conserv.c.

◆ interp_method_conserv_2nd_order_vtable

struct interp_method_vtable interp_method_conserv_2nd_order_vtable
static
Initial value:
= {
.delete = delete_conserv}
static size_t do_search_conserv_2nd_order(struct interp_method *method, struct yac_interp_grid *interp_grid, size_t *tgt_points, size_t count, struct yac_interp_weights *weights)

Definition at line 36 of file interp_method_conserv.c.