YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
vtk_output.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "vtk_output.h"
#include "utils_common.h"
#include "geometry.h"
Include dependency graph for vtk_output.c:

Go to the source code of this file.

Data Structures

struct  scalars_data
 
struct  YAC_VTK_FILE_
 

Macros

#define WRITE_ASCII
 

Enumerations

enum  scalars_dt { INT = 0 , UINT = 1 , FLOAT = 2 , DOUBLE = 3 }
 

Functions

YAC_VTK_FILEyac_vtk_open (const char *filename, const char *title)
 
void yac_vtk_write_point_data (YAC_VTK_FILE *vtk_file, double *point_data, unsigned num_points)
 
void yac_vtk_write_cell_data (YAC_VTK_FILE *vtk_file, unsigned *cell_corners, unsigned *num_points_per_cell, unsigned num_cells)
 
void yac_vtk_write_point_data_ll (YAC_VTK_FILE *vtk_file, double *point_data_lon, double *point_data_lat, unsigned num_points)
 
static void yac_vtk_write_cell_scalars (YAC_VTK_FILE *vtk_file, void *scalars, unsigned num_cells, char *name, enum scalars_dt dt)
 
static void yac_vtk_write_point_scalars (YAC_VTK_FILE *vtk_file, void *scalars, unsigned num_points, char *name, enum scalars_dt dt)
 
void yac_vtk_write_cell_scalars_uint (YAC_VTK_FILE *vtk_file, unsigned *scalars, unsigned num_cells, char *name)
 
void yac_vtk_write_cell_scalars_int (YAC_VTK_FILE *vtk_file, int *scalars, unsigned num_cells, char *name)
 
void yac_vtk_write_cell_scalars_float (YAC_VTK_FILE *vtk_file, float *scalars, unsigned num_cells, char *name)
 
void yac_vtk_write_cell_scalars_double (YAC_VTK_FILE *vtk_file, double *scalars, unsigned num_cells, char *name)
 
void yac_vtk_write_point_scalars_uint (YAC_VTK_FILE *vtk_file, unsigned *scalars, unsigned num_points, char *name)
 
void yac_vtk_write_point_scalars_int (YAC_VTK_FILE *vtk_file, int *scalars, unsigned num_points, char *name)
 
void yac_vtk_write_point_scalars_float (YAC_VTK_FILE *vtk_file, float *scalars, unsigned num_points, char *name)
 
void yac_vtk_write_point_scalars_double (YAC_VTK_FILE *vtk_file, double *scalars, unsigned num_points, char *name)
 
static void vtk_flush_scalar_data (FILE *file, struct scalars_data *data, unsigned num_scalars_data, unsigned num_data_points)
 
static void vtk_flush_scalar_cell_data (YAC_VTK_FILE *vtk_file)
 
static void vtk_flush_scalar_point_data (YAC_VTK_FILE *vtk_file)
 
void yac_vtk_close (YAC_VTK_FILE *vtk_file)
 

Variables

const char * scalars_dt_names [4]
 

Macro Definition Documentation

◆ WRITE_ASCII

#define WRITE_ASCII

Definition at line 13 of file vtk_output.c.

Enumeration Type Documentation

◆ scalars_dt

enum scalars_dt
Enumerator
INT 
UINT 
FLOAT 
DOUBLE 

Definition at line 15 of file vtk_output.c.

Function Documentation

◆ vtk_flush_scalar_cell_data()

static void vtk_flush_scalar_cell_data ( YAC_VTK_FILE * vtk_file)
static

Definition at line 355 of file vtk_output.c.

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

◆ vtk_flush_scalar_data()

static void vtk_flush_scalar_data ( FILE * file,
struct scalars_data * data,
unsigned num_scalars_data,
unsigned num_data_points )
static

Definition at line 299 of file vtk_output.c.

Here is the caller graph for this function:

◆ vtk_flush_scalar_point_data()

static void vtk_flush_scalar_point_data ( YAC_VTK_FILE * vtk_file)
static

Definition at line 379 of file vtk_output.c.

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

◆ yac_vtk_close()

void yac_vtk_close ( YAC_VTK_FILE * vtk_file)

closes a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
Examples
test_vtk_output.c.

Definition at line 403 of file vtk_output.c.

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

◆ yac_vtk_open()

YAC_VTK_FILE * yac_vtk_open ( const char * filename,
const char * title )

initialises a vtk file

Parameters
[in]filenamename of the vtk file
[in]titletitle for the data inside the file
Returns
handle the the vtk file
Examples
test_vtk_output.c.

Definition at line 45 of file vtk_output.c.

Here is the caller graph for this function:

◆ yac_vtk_write_cell_data()

void yac_vtk_write_cell_data ( YAC_VTK_FILE * vtk_file,
unsigned * cell_corners,
unsigned * num_points_per_cell,
unsigned num_cells )

writes the cell data (which cell consists of which points) to the vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]cell_cornerscontains for all cells the indices of points the respective cells are made up of
[in]num_points_per_cellcontains contains for each cell the number of corners it is made up of
[in]num_cellsnumber of cells
Remarks
the indices in cell_corners refere to the index in points array passed to yac_vtk_write_point_data
the size of num_points_per_cell should be num_cells
the size of cell_corners is the sum of all num_points_per_cell[i] for 0<=i<num_cells
Examples
test_vtk_output.c.

Definition at line 88 of file vtk_output.c.

Here is the caller graph for this function:

◆ yac_vtk_write_cell_scalars()

static void yac_vtk_write_cell_scalars ( YAC_VTK_FILE * vtk_file,
void * scalars,
unsigned num_cells,
char * name,
enum scalars_dt dt )
static

Definition at line 165 of file vtk_output.c.

Here is the caller graph for this function:

◆ yac_vtk_write_cell_scalars_double()

void yac_vtk_write_cell_scalars_double ( YAC_VTK_FILE * vtk_file,
double * scalars,
unsigned num_cells,
char * name )

writes an array of double scalar cell data values for each cell to a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]scalarsand array containing a scalar value for each cell
[in]num_cellsnumber of cells
[in]namename of the written field

/remark num_cells should be identically to the number of cells passed to a previous call to yac_vtk_write_cell_data /remark the size of scalars should be num_cells

Examples
test_vtk_output.c.

Definition at line 264 of file vtk_output.c.

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

◆ yac_vtk_write_cell_scalars_float()

void yac_vtk_write_cell_scalars_float ( YAC_VTK_FILE * vtk_file,
float * scalars,
unsigned num_cells,
char * name )

writes an array of float scalar cell data values for each cell to a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]scalarsand array containing a scalar value for each cell
[in]num_cellsnumber of cells
[in]namename of the written field

/remark num_cells should be identically to the number of cells passed to a previous call to yac_vtk_write_cell_data /remark the size of scalars should be num_cells

Examples
test_vtk_output.c.

Definition at line 257 of file vtk_output.c.

Here is the call graph for this function:

◆ yac_vtk_write_cell_scalars_int()

void yac_vtk_write_cell_scalars_int ( YAC_VTK_FILE * vtk_file,
int * scalars,
unsigned num_cells,
char * name )

writes an array of integer scalar cell data values for each cell to a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]scalarsand array containing a scalar value for each cell
[in]num_cellsnumber of cells
[in]namename of the written field

/remark num_cells should be identically to the number of cells passed to a previous call to yac_vtk_write_cell_data /remark the size of scalars should be num_cells

Examples
test_vtk_output.c.

Definition at line 250 of file vtk_output.c.

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

◆ yac_vtk_write_cell_scalars_uint()

void yac_vtk_write_cell_scalars_uint ( YAC_VTK_FILE * vtk_file,
unsigned * scalars,
unsigned num_cells,
char * name )

writes an array of unsigned integer scalar cell data values for each cell to a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]scalarsand array containing a scalar value for each cell
[in]num_cellsnumber of cells
[in]namename of the written field

/remark num_cells should be identically to the number of cells passed to a previous call to yac_vtk_write_cell_data /remark the size of scalars should be num_cells

Examples
test_vtk_output.c.

Definition at line 243 of file vtk_output.c.

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

◆ yac_vtk_write_point_data()

void yac_vtk_write_point_data ( YAC_VTK_FILE * vtk_file,
double * point_data,
unsigned num_points )

writes the 3d coordinates of all points into the vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]point_dataarray containing the 3d coordinates of all points
[in]num_pointsnumber of points to be written
Remarks
the array associated to point_data should have the size 3 * num_points
points[i*3+0], points[i*3+1] and points[i*3+2] should contain the x, y and z coordinate of the i'th point
Examples
test_vtk_output.c.

Definition at line 69 of file vtk_output.c.

Here is the caller graph for this function:

◆ yac_vtk_write_point_data_ll()

void yac_vtk_write_point_data_ll ( YAC_VTK_FILE * vtk_file,
double * point_data_lon,
double * point_data_lat,
unsigned num_points )

writes the 3d coordinates of all points into the vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]point_data_lonarray containing the longitude coordinates of all points (in rad)
[in]point_data_latarray containing the latitude coordinates of all points (in rad)
[in]num_pointsnumber of points to be written
Remarks
the array associated to point_data should have the size 3 * num_points
points[i*3+0], points[i*3+1] and points[i*3+2] should contain the x, y and z coordinate of the i'th point
Examples
test_vtk_output.c.

Definition at line 149 of file vtk_output.c.

Here is the call graph for this function:

◆ yac_vtk_write_point_scalars()

static void yac_vtk_write_point_scalars ( YAC_VTK_FILE * vtk_file,
void * scalars,
unsigned num_points,
char * name,
enum scalars_dt dt )
static

Definition at line 204 of file vtk_output.c.

Here is the caller graph for this function:

◆ yac_vtk_write_point_scalars_double()

void yac_vtk_write_point_scalars_double ( YAC_VTK_FILE * vtk_file,
double * scalars,
unsigned num_points,
char * name )

writes an array of double scalar point data values for each point to a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]scalarsand array containing a scalar value for each point
[in]num_pointsnumber of points
[in]namename of the written field

/remark num_points should be identically to the number of points passed to a previous call to yac_vtk_write_point_data /remark the size of scalars should be num_points

Examples
test_vtk_output.c.

Definition at line 292 of file vtk_output.c.

Here is the call graph for this function:

◆ yac_vtk_write_point_scalars_float()

void yac_vtk_write_point_scalars_float ( YAC_VTK_FILE * vtk_file,
float * scalars,
unsigned num_points,
char * name )

writes an array of float scalar point data values for each point to a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]scalarsand array containing a scalar value for each point
[in]num_pointsnumber of points
[in]namename of the written field

/remark num_points should be identically to the number of points passed to a previous call to yac_vtk_write_point_data /remark the size of scalars should be num_points

Examples
test_vtk_output.c.

Definition at line 285 of file vtk_output.c.

Here is the call graph for this function:

◆ yac_vtk_write_point_scalars_int()

void yac_vtk_write_point_scalars_int ( YAC_VTK_FILE * vtk_file,
int * scalars,
unsigned num_points,
char * name )

writes an array of integer scalar point data values for each point to a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]scalarsand array containing a scalar value for each point
[in]num_pointsnumber of points
[in]namename of the written field

/remark num_points should be identically to the number of points passed to a previous call to yac_vtk_write_point_data /remark the size of scalars should be num_points

Examples
test_vtk_output.c.

Definition at line 278 of file vtk_output.c.

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

◆ yac_vtk_write_point_scalars_uint()

void yac_vtk_write_point_scalars_uint ( YAC_VTK_FILE * vtk_file,
unsigned * scalars,
unsigned num_points,
char * name )

writes an array of unsigned integer scalar point data values for each point to a vtk file

Parameters
[in]vtk_filefile pointer to an already open file
[in]scalarsand array containing a scalar value for each point
[in]num_pointsnumber of points
[in]namename of the written field

/remark num_points should be identically to the number of points passed to a previous call to yac_vtk_write_point_data /remark the size of scalars should be num_points

Examples
test_vtk_output.c.

Definition at line 271 of file vtk_output.c.

Here is the call graph for this function:

Variable Documentation

◆ scalars_dt_names

const char* scalars_dt_names[4]
Initial value:
= {
"int",
"unsigned_int",
"float",
"double"
}

Definition at line 22 of file vtk_output.c.