grid.h

Go to the documentation of this file.
00001 #ifndef __SEAM_GRID
00002 #define __SEAM_GRID
00003 
00004 /* tolerance parameter - in C++ would get
00005    from numeric limits. use: two grid locations
00006    x and y are identified if abs(x-y) < TOL*d.
00007 */
00008 #define TOL 100.0*REAL_EPS
00009 
00010 // define boundary index between external, internal extended axis indices
00011 #define EXTINT 100
00012 
00013 #include "utils.h"
00014 #include "except.hh"
00015 
00025 typedef struct s_axis {
00027   size_t n; 
00029   ireal d;
00031   ireal o;
00033   int id;
00034 } axis;
00035 
00039 void init_default_axis(axis * a);
00040   
00047 void init_axis(axis * a, size_t n, ireal d, ireal o);
00048   
00053 void copy_axis(axis * tgt, const axis * src);
00054 
00058 void print_axis(axis a);
00059   
00064 void fprint_axis(FILE * fp, axis a);
00065 void fprint_num_axis(FILE * fp, int i, axis a);
00071 int compare_axis(axis a1, axis a2);
00077 typedef struct {
00078   int dim;
00079   int gdim;
00080   axis axes[RARR_MAX_NDIM];
00081 } grid;
00082   
00086 void init_default_grid(grid * g);
00087 
00095 int init_grid(grid * g, int dim, int gdim);
00096 
00101 void copy_grid(grid * tgt, const grid * src);
00102 
00106 void print_grid(grid a);
00107   
00112 void fprint_grid(FILE * fp, grid a);
00113   
00117 int compare_grid(const grid g1, const grid g2);
00118 
00123 int compatible_grid(const grid g1, const grid g2);
00124 
00127 int get_dimension_grid(grid g);
00128 
00132 int get_datasize_grid(grid g);
00133 
00137 int get_extended_datasize_grid(grid g);
00138 
00142 size_t get_global_datasize_grid(grid g);
00143 
00145 ireal get_cellvol_grid(grid g);
00146 
00148 ireal get_extended_cellvol_grid(grid g);
00149 
00151 ireal get_global_cellvol_grid(grid g);
00152 
00157 int get_panelnum_grid(grid g);
00158 
00162 void get_n(IPNT n, grid g);
00166 void get_d(_RPNT d, grid g);
00170 void get_o(_RPNT o, grid g);
00171 
00175 void get_gs(IPNT gs, grid g);
00176 
00180 void get_ge(IPNT ge, grid g);
00181 
00184 void get_id(IPNT id, grid g);
00185 
00190 void get_ord(IPNT a, grid g);
00191 
00197 bool grid_union(grid * g, axis const * ax);
00198 
00203 bool init_step(grid g, IPNT step, bool fwd);
00204 
00209 bool next_step(grid g, IPNT step);
00210 
00211 #endif /* __SEAM_GRID */
00212 
00213 

Generated on 5 Jan 2017 for IWAVEGRID by  doxygen 1.4.7