YetAnotherCoupler 3.2.0_a
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
weights2vtk.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <netcdf.h>
#include "yac_utils.h"
Include dependency graph for weights2vtk.c:

Go to the source code of this file.

Data Structures

struct  link_data
 
struct  grid_config
 

Macros

#define YAC_WEIGHT_FILE_VERSION_1_0_STRING   "yac weight file 1.0"
 
#define STR_USAGE
 
#define YAC_ASSERT(exp, msg)
 
#define YAC_ASSERT_F(exp, format, ...)
 

Enumerations

enum  grid_type {
  NONE , CUBE , CURVE , UNSTRUCT ,
  GAUSS , SCRIP
}
 

Functions

static void normalise_vector (double v[])
 
static void parse_arguments (int argc, char **argv, struct grid_config *src_grid_config, struct grid_config *tgt_grid_config, char const **weight_filename, char const **vtk_filename)
 
static void read_link_data (char const *weight_filename, int src_address_offset, int tgt_address_offset, struct link_data **links, unsigned *num_links, enum yac_location **src_locations, enum yac_location *tgt_location, unsigned *max_src_idx, unsigned *max_tgt_idx)
 
static void write_data_to_file (char const *filename, struct yac_basic_grid_data src_grid, struct yac_basic_grid_data tgt_grid, struct link_data *links, unsigned num_links, enum yac_location *src_locations, enum yac_location tgt_location)
 
static struct yac_basic_grid_data create_grid (struct grid_config grid_config)
 
int main (int argc, char **argv)
 
static void get_cell_middle_point (struct yac_basic_grid_data *grid, size_t cell_index, double *point)
 
static void get_edge_middle_point (struct yac_basic_grid_data *grid, size_t edge_index, double *point)
 
static void get_point_coordinates (struct yac_basic_grid_data *grid, size_t point_index, enum yac_location location, double *point)
 
static void get_link_xyz_coordinates (struct link_data *links, unsigned num_links, struct yac_basic_grid_data *src_grid, struct yac_basic_grid_data *tgt_grid, enum yac_location *src_locations, enum yac_location tgt_location, yac_coordinate_pointer points)
 
static void get_grid_cell_data (struct yac_basic_grid_data *grid, unsigned *cell_data, unsigned offset)
 
static void get_link_address_data (unsigned num_links, unsigned *polygon_data, unsigned offset)
 
static void interpret_grid_arg (struct grid_config *grid_config, char *arg, char *str)
 
static double * generate_vertices (double start, double end, size_t count)
 
static struct yac_basic_grid_data generate_gauss_grid (double *first_corner, double *last_corner, size_t *num_cells)
 
static struct yac_basic_grid_data create_grid (struct grid_config grid_config)
 

Variables

static char const * cmd
 

Macro Definition Documentation

◆ STR_USAGE

#define STR_USAGE

Definition at line 22 of file weights2vtk.c.

◆ YAC_ASSERT

#define YAC_ASSERT (   exp,
  msg 
)
Value:
{ \
if(!((exp))) { \
fprintf(stderr, "ERROR: %s\n" STR_USAGE, msg, cmd, cmd); \
exit(EXIT_FAILURE); \
} \
}
static char const * cmd
Definition weights2vtk.c:21
#define STR_USAGE
Definition weights2vtk.c:22

Definition at line 63 of file weights2vtk.c.

◆ YAC_ASSERT_F

#define YAC_ASSERT_F (   exp,
  format,
  ... 
)
Value:
{ \
if(!((exp))) { \
fprintf(stderr, "ERROR: " format "\n" STR_USAGE, __VA_ARGS__, cmd, cmd); \
exit(EXIT_FAILURE); \
} \
}

Definition at line 71 of file weights2vtk.c.

◆ YAC_WEIGHT_FILE_VERSION_1_0_STRING

#define YAC_WEIGHT_FILE_VERSION_1_0_STRING   "yac weight file 1.0"

Definition at line 15 of file weights2vtk.c.

Enumeration Type Documentation

◆ grid_type

enum grid_type
Enumerator
NONE 
CUBE 
CURVE 
UNSTRUCT 
GAUSS 
SCRIP 

Definition at line 97 of file weights2vtk.c.

Function Documentation

◆ create_grid() [1/2]

static struct yac_basic_grid_data create_grid ( struct grid_config  grid_config)
static
Here is the caller graph for this function:

◆ create_grid() [2/2]

static struct yac_basic_grid_data create_grid ( struct grid_config  grid_config)
static

Definition at line 756 of file weights2vtk.c.

Here is the call graph for this function:

◆ generate_gauss_grid()

static struct yac_basic_grid_data generate_gauss_grid ( double *  first_corner,
double *  last_corner,
size_t *  num_cells 
)
static

Definition at line 736 of file weights2vtk.c.

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

◆ generate_vertices()

static double * generate_vertices ( double  start,
double  end,
size_t  count 
)
static

Definition at line 723 of file weights2vtk.c.

Here is the caller graph for this function:

◆ get_cell_middle_point()

static void get_cell_middle_point ( struct yac_basic_grid_data grid,
size_t  cell_index,
double *  point 
)
static

Definition at line 349 of file weights2vtk.c.

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

◆ get_edge_middle_point()

static void get_edge_middle_point ( struct yac_basic_grid_data grid,
size_t  edge_index,
double *  point 
)
static
Examples
test_gcxgc.c, test_latcxlatc.c, and test_pxgc.c.

Definition at line 367 of file weights2vtk.c.

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

◆ get_grid_cell_data()

static void get_grid_cell_data ( struct yac_basic_grid_data grid,
unsigned *  cell_data,
unsigned  offset 
)
static

Definition at line 421 of file weights2vtk.c.

Here is the caller graph for this function:

◆ get_link_address_data()

static void get_link_address_data ( unsigned  num_links,
unsigned *  polygon_data,
unsigned  offset 
)
static

Definition at line 435 of file weights2vtk.c.

Here is the caller graph for this function:

◆ get_link_xyz_coordinates()

static void get_link_xyz_coordinates ( struct link_data links,
unsigned  num_links,
struct yac_basic_grid_data src_grid,
struct yac_basic_grid_data tgt_grid,
enum yac_location src_locations,
enum yac_location  tgt_location,
yac_coordinate_pointer  points 
)
static

Definition at line 405 of file weights2vtk.c.

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

◆ get_point_coordinates()

static void get_point_coordinates ( struct yac_basic_grid_data grid,
size_t  point_index,
enum yac_location  location,
double *  point 
)
static

Definition at line 383 of file weights2vtk.c.

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

◆ interpret_grid_arg()

static void interpret_grid_arg ( struct grid_config grid_config,
char *  arg,
char *  str 
)
static

Definition at line 588 of file weights2vtk.c.

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)
Examples
test_abort_c.c, test_angle.c, test_area.c, test_basic_grid.c, test_basic_grid_data.c, test_bnd_sphere_part.c, test_cell_bnd_circle.c, test_circle.c, test_clipping.c, test_component_config.c, test_compute_overlap_area.c, test_couple_config.c, test_dist_grid_pair_parallel.c, test_dummy_coupling2_c.c, test_dummy_coupling3_c.c, test_dummy_coupling4_c.c, test_dummy_coupling5_c.c, test_dummy_coupling6_c.c, test_dummy_coupling7_c.c, test_dummy_coupling8_c.c, test_dummy_coupling9_c.c, test_dummy_coupling_c.c, test_duplicate_stencils_parallel.c, test_events.c, test_gcxgc.c, test_gcxlatc.c, test_generate_cubed_sphere.c, test_geometry.c, test_grid2vtk.c, test_group_comm.c, test_instance_parallel1.c, test_instance_parallel2.c, test_instance_parallel3.c, test_instance_parallel4.c, test_interp_grid_parallel.c, test_interp_method_avg_parallel.c, test_interp_method_callback_parallel.c, test_interp_method_conserv_parallel.c, test_interp_method_creep_parallel.c, test_interp_method_file_parallel.c, test_interp_method_hcsbb_parallel.c, test_interp_method_ncc_parallel.c, test_interp_method_nnn_parallel.c, test_interp_method_nnn_parallel2.c, test_interp_method_rbf_parallel.c, test_interp_method_spmap_parallel.c, test_interp_stack_config.c, test_interp_weights_parallel.c, test_interpolation_exchange.c, test_interpolation_parallel1_c.c, test_interpolation_parallel2.c, test_interpolation_parallel3.c, test_interpolation_parallel4.c, test_interpolation_parallel5.c, test_interpolation_parallel6.c, test_interval_tree.c, test_lat_clipping.c, test_latcxlatc.c, test_loncxlatc.c, test_loncxlonc.c, test_mergesort.c, test_mpi_error.c, test_mpi_handshake_c.c, test_multithreading.c, test_partial_areas.c, test_point_in_cell.c, test_point_sphere_part.c, test_proc_sphere_part_parallel.c, test_pxgc.c, test_query_routines_c.c, test_quicksort.c, test_read_cube_csv.c, test_read_fesom.c, test_read_icon.c, test_read_icon_parallel.c, test_read_mpiom.c, test_read_scrip.c, test_read_woa_data.c, test_restart2.c, test_restart_c.c, test_vtk_output.c, and test_weights2vtk.c.

Definition at line 147 of file weights2vtk.c.

Here is the call graph for this function:

◆ normalise_vector()

static void normalise_vector ( double  v[])
inlinestatic

Definition at line 79 of file weights2vtk.c.

Here is the caller graph for this function:

◆ parse_arguments()

void parse_arguments ( int  argc,
char **  argv,
struct grid_config src_grid_config,
struct grid_config tgt_grid_config,
char const **  weight_filename,
char const **  vtk_filename 
)
static

Definition at line 642 of file weights2vtk.c.

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

◆ read_link_data()

static void read_link_data ( char const *  weight_filename,
int  src_address_offset,
int  tgt_address_offset,
struct link_data **  links,
unsigned *  num_links,
enum yac_location **  src_locations,
enum yac_location tgt_location,
unsigned *  max_src_idx,
unsigned *  max_tgt_idx 
)
static

Definition at line 201 of file weights2vtk.c.

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

◆ write_data_to_file()

static void write_data_to_file ( char const *  filename,
struct yac_basic_grid_data  src_grid,
struct yac_basic_grid_data  tgt_grid,
struct link_data links,
unsigned  num_links,
enum yac_location src_locations,
enum yac_location  tgt_location 
)
static

Definition at line 442 of file weights2vtk.c.

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

Variable Documentation

◆ cmd

char const* cmd
static
Examples
test_weights2vtk.c.

Definition at line 21 of file weights2vtk.c.