grid_io.h
Go to the documentation of this file.00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef GRID_IO_H
00046 #define GRID_IO_H
00047 #include "stdlib.h"
00048 #include "stdio.h"
00049
00050
00051
00052
00053 #ifndef MAX_GRID_ROWS
00054 #define MAX_GRID_ROWS 66
00055 #endif
00056
00057 #define GRID_TITLE_LENGTH 80
00058 #define GRID_TAG_LENGTH 80
00061 typedef struct {
00062 char title[GRID_TITLE_LENGTH];
00063 int number_of_rows;
00064 int number_of_nodes;
00065 struct { float x, y; } size;
00066 } GR_HEADER;
00067
00069 typedef struct {
00070 int *xstart;
00071 int *xend;
00072 int *cum_node_count;
00073 } GR_CONFIG;
00074
00076 typedef struct {
00077 GR_HEADER header;
00078 GR_CONFIG config;
00079 } GRID;
00080
00081
00082
00083 struct GR_FORTRAN_FILE_STRUC {
00084 FILE *fptr;
00085 int unit_number;
00086 struct GR_FORTRAN_FILE_STRUC *next;
00087 };
00088 typedef struct GR_FORTRAN_FILE_STRUC GR_FORTRAN_FILE;
00089
00090
00091 #ifdef __cplusplus
00092 extern "C" {
00093 #endif
00094 int grid_write_header(FILE *file, GRID *grid);
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098
00099 #ifdef __cplusplus
00100 extern "C" {
00101 #endif
00102 int grid_read_header(FILE *file, GRID *grid);
00103 #ifdef __cplusplus
00104 }
00105 #endif
00106
00107 #ifdef __cplusplus
00108 extern "C" {
00109 #endif
00110 int grid_write(FILE *file, GRID *grid, char *tag, float *values);
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114
00115 #ifdef __cplusplus
00116 extern "C" {
00117 #endif
00118 int grid_read(FILE *file, GRID *grid, char *tag, float *values);
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122
00123
00124
00125 #ifdef __cplusplus
00126 extern "C" {
00127 #endif
00128 int grid_skip(FILE *file, GRID *grid, int num);
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132
00133 #ifdef __cplusplus
00134 extern "C" {
00135 #endif
00136 int grid_tag_search(FILE *file, GRID *grid, char *string);
00137 #ifdef __cplusplus
00138 }
00139 #endif
00140
00141 #ifdef __cplusplus
00142 extern "C" {
00143 #endif
00144 int grid_top(FILE *file, GRID *grid);
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148
00149 #ifdef __cplusplus
00150 extern "C" {
00151 #endif
00152 int grid_bottom(FILE *file, GRID *grid);
00153 #ifdef __cplusplus
00154 }
00155 #endif
00156
00157 #ifdef __cplusplus
00158 extern "C" {
00159 #endif
00160 int grid_count_snapshots(FILE *file, GRID *grid);
00161 #ifdef __cplusplus
00162 }
00163 #endif
00164
00165 #ifdef __cplusplus
00166 extern "C" {
00167 #endif
00168 int grid_free(GRID *grid);
00169 #ifdef __cplusplus
00170 }
00171 #endif
00172
00173
00174 #endif