YAC 3.18.0
Yet Another Coupler
Loading...
Searching...
No Matches
test_interp_method_fixed_parallel.c File Reference
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "tests.h"
#include "test_common.h"
#include "geometry.h"
#include "interpolation/methods/interp_method.h"
#include "interpolation/methods/interp_method_avg.h"
#include "interpolation/methods/interp_method_fixed.h"
#include "dist_grid_utils.h"
#include "yac_mpi.h"
#include <mpi.h>
#include <yaxt.h>
Include dependency graph for test_interp_method_fixed_parallel.c:

Go to the source code of this file.

Functions

static void test_fixed_value (double fixed_value)
 

Variables

int split_comm_rank
 
int split_comm_size
 
enum yac_interp_weights_reorder_type reorder_types []
 
size_t num_reorder_types = sizeof(reorder_types) / sizeof(reorder_types[0])
 
static char const * grid_names [2] = {"src_grid", "tgt_grid"}
 

Detailed Description

Test
A test for the parallel fixed-value interpolation method. Tests that yac_interp_method_fixed_new assigns a constant value to all target points, including use as a fallback in a method stack.

Definition in file test_interp_method_fixed_parallel.c.

Function Documentation

◆ test_fixed_value()

static void test_fixed_value ( double fixed_value)
static

Run a basic fixed-value interpolation test on the standard 3x2 src / 2x2 tgt grid pair and verify that every target vertex receives exactly fixed_value.

The helper builds the grid, creates the interpolation weights, executes both reorder types, checks results via memcmp (works correctly for NaN, 0.0, and negative values), then releases all resources.

Grid geometry:

source grid (3x2): 04–07–05–09–06–11–07 | | | | 01 00 03 01 05 02 06 | | | | 00–00–01–02–02–04–03

target grid (2x2): 06–09–07–11–08 | | | 04 03 07 04 10 | | | 03–06–04–08–05 | | | 01 00 03 01 05 | | | 00–00–01–02–02

Definition at line 63 of file test_interp_method_fixed_parallel.c.

Here is the call graph for this function:

Variable Documentation

◆ grid_names

char const* grid_names[2] = {"src_grid", "tgt_grid"}
static

Definition at line 33 of file test_interp_method_fixed_parallel.c.

◆ num_reorder_types

size_t num_reorder_types = sizeof(reorder_types) / sizeof(reorder_types[0])

Definition at line 32 of file test_interp_method_fixed_parallel.c.

◆ reorder_types

enum yac_interp_weights_reorder_type reorder_types[]
Initial value:
=
@ YAC_MAPPING_ON_TGT
weights will be applied at target processes
@ YAC_MAPPING_ON_SRC
weights will be applied at source processes

Definition at line 30 of file test_interp_method_fixed_parallel.c.

◆ split_comm_rank

int split_comm_rank

Definition at line 28 of file test_interp_method_fixed_parallel.c.

◆ split_comm_size

int split_comm_size

Definition at line 28 of file test_interp_method_fixed_parallel.c.