YAC 3.12.0
Yet Another Coupler
Loading...
Searching...
No Matches
read_exodus_grid.c File Reference
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "read_exodus_grid.h"
#include "utils_common.h"
#include "io_utils.h"
#include "geometry.h"
#include "read_grid.h"
#include "yac_mpi_internal.h"
#include <netcdf.h>
Include dependency graph for read_exodus_grid.c:

Go to the source code of this file.

Data Structures

struct  temp_edge
 

Functions

static size_t * generate_offsets (size_t N, int *counts)
 
static int partition_idx_from_element_idx (size_t element_idx, size_t num_elements, int num_partitions)
 
void yac_read_exodus_grid_information_parallel (const char *filename, MPI_Comm comm, yac_coordinate_pointer *node_coords, yac_int **elem_ids, yac_int **node_ids, size_t *num_elem, size_t *num_nodes, int **num_nodes_per_elem, int **num_elem_per_node, size_t **elem_to_node, size_t **node_to_elem)
 
static int compare_temp_edges (void const *a, void const *b)
 
static int check_pole (double *vertex)
 
static int check_lon_edge (double *vertex_a_, double *vertex_b_)
 
static int check_lat_edge (double *vertex_a, double *vertex_b)
 
struct yac_basic_grid_data yac_read_exodus_basic_grid_data_parallel (const char *filename, int use_ll_edges, MPI_Comm comm)
 
struct yac_basic_gridyac_read_exodus_basic_grid_parallel (char const *filename, char const *gridname, int use_ll_edges, MPI_Comm comm)
 

Function Documentation

◆ check_lat_edge()

static int check_lat_edge ( double * vertex_a,
double * vertex_b )
static

Definition at line 415 of file read_exodus_grid.c.

Here is the caller graph for this function:

◆ check_lon_edge()

static int check_lon_edge ( double * vertex_a_,
double * vertex_b_ )
static

Definition at line 404 of file read_exodus_grid.c.

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

◆ check_pole()

static int check_pole ( double * vertex)
static

Definition at line 399 of file read_exodus_grid.c.

Here is the caller graph for this function:

◆ compare_temp_edges()

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

Definition at line 388 of file read_exodus_grid.c.

Here is the caller graph for this function:

◆ generate_offsets()

static size_t * generate_offsets ( size_t N,
int * counts )
static

Definition at line 25 of file read_exodus_grid.c.

Here is the caller graph for this function:

◆ partition_idx_from_element_idx()

static int partition_idx_from_element_idx ( size_t element_idx,
size_t num_elements,
int num_partitions )
inlinestatic

Definition at line 38 of file read_exodus_grid.c.

Here is the caller graph for this function:

◆ yac_read_exodus_basic_grid_data_parallel()

struct yac_basic_grid_data yac_read_exodus_basic_grid_data_parallel ( const char * filename,
int use_ll_edges,
MPI_Comm comm )

Reads in an EXODUS-formated grid netcdf file in parallel and returns a yac_basic_grid_data built from it.

Parameters
[in]filenamename of the EXODUS-formated grid netcdf file
[in]use_ll_edgesif != 0, assume that all edges of the grid follow circles of either constant longitude or constant latitude and set edge types accordingly. Otherwise it is assumed that all edges follow great circles.
[in]commMPI communicator containing all proceses that will get a part of the grid
Returns
yac_basic_grid_data structure containing part of the grid.
See also
Configuration of parallel IO in YAC

Definition at line 420 of file read_exodus_grid.c.

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

◆ yac_read_exodus_basic_grid_parallel()

struct yac_basic_grid * yac_read_exodus_basic_grid_parallel ( char const * filename,
char const * gridname,
int use_ll_edges,
MPI_Comm comm )

Reads in an EXODUS-formated grid netcdf file in parallel and returns a yac_basic_grid built from it.

Parameters
[in]filenamename of the EXODUS-formated grid netcdf file
[in]gridnamename of grid
[in]use_ll_edgesif != 0, assume that all edges of the grid follow circles of either constant longitude or constant latitude and set edge types accordingly. Otherwise it is assumed that all edges follow great circles.
[in]commMPI communicator containing all proceses that will get a part of the grid
Returns
yac_basic_grid structure containing part of the grid.
Remarks
The data of each process contains no halo cells.
See also
Configuration of parallel IO in YAC

Definition at line 547 of file read_exodus_grid.c.

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

◆ yac_read_exodus_grid_information_parallel()

void yac_read_exodus_grid_information_parallel ( const char * filename,
MPI_Comm comm,
yac_coordinate_pointer * node_coords,
yac_int ** elem_ids,
yac_int ** node_ids,
size_t * num_elem,
size_t * num_nodes,
int ** num_nodes_per_elem,
int ** num_elem_per_node,
size_t ** elem_to_node,
size_t ** node_to_elem )

Reads in an EXODUS-formated grid netcdf file and returns the grid information in a format that allows the user to set up a yac_basic_grid_data structure. The reading is done in parallel and a basic domain decomposition is applied.

Parameters
[in]filenamename of the EXODUS-formated grid netcdf file
[in]commMPI communicator containing all proceses that will get a part of the grid
[out]node_coordsCartesian coordinates of all nodes/vertices
[out]elem_idsglobal ids of local elements/cells
[out]node_idsglobal ids of local nodes/vertices
[out]num_elemnumber of elements/cells in the local part of the grid
[out]num_nodesnumber of nodes/vertices in the local part of the the grid
[out]num_nodes_per_elemnumber of nodes/vertices per element/cell
[out]num_elem_per_nodenumber of elements/cells per node/vertex
[out]elem_to_nodelocal node/vertex indices for each local element/cell
[out]node_to_elemlocal element/cell indices for each local node/vertex
See also
Configuration of parallel IO in YAC

Definition at line 46 of file read_exodus_grid.c.

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