F5uniform.h

00001 /*
00002  *
00003  * $Id: F5uniform.h,v 1.25 2007/01/16 18:42:49 werner Exp $
00004  *
00005  * $Log: F5uniform.h,v $
00006  * Revision 1.25  2007/01/16 18:42:49  werner
00007  * Revision of the chart/coordinate interface in FiberLib2, simpler, easier,
00008  * more existent now.
00009  *
00010  * Revision 1.24  2005/10/28 05:00:21  werner
00011  * slight improvement of documentation and vector field example added.
00012  * will add particle vectors and surface vectors soon.
00013  *
00014  * Revision 1.23  2004/03/22 15:30:05  werner
00015  * Generalized treatment of refinement within the framework of relative representations. Closer to better support of downsampling topologies.
00016  * Improved documentation.
00017  *
00018  * Revision 1.22  2004/03/10 16:27:14  werner
00019  * Introduced a type for rational numbers to specify coordinates of
00020  * refinement levels that are not exactly vertex-aligned.
00021  * Preliminiary Carpet F5 thorn appears to implement the fiber concept correctly
00022  * at first sight.
00023  *
00024  * Revision 1.21  2003/11/12 15:21:31  zib
00025  * added more ContentType stuff
00026  *
00027  * Revision 1.20  2003/11/06 20:50:12  zib
00028  * fixed typo
00029  *
00030  * Revision 1.19  2003/11/04 19:24:10  werner
00031  * Revised version including a table of contents and field info per grid, and
00032  * also telling the grids per field (reverse look). The API has been revised
00033  * somewhat, such that F5F... function are all functions operation on F5Path
00034  * objects with fields defined.
00035  *
00036  * Revision 1.18  2003/08/12 12:30:09  werner
00037  * API change: do not return F5Path* when the argument is only modified, just return boolean
00038  * indicating success.
00039  *
00040  * Revision 1.17  2003/07/17 10:36:41  werner
00041  * Corrected documentation.
00042  * Added F5Iignore() function to tell which groups shall be ignored during iteration.
00043  *
00044  * Revision 1.16  2003/06/16 11:00:20  werner
00045  * Changed the iterator functions to use F5Path objects instead of HDF5 ID's.
00046  * This makes encapsulates more of HDF5 and insists more of using F5,
00047  * but makes retrieving the F5 information easier.
00048  * Also changed back the shared data types to nameless types. Thus type
00049  * attributes cannot be determined directly, but when using F5 functions this
00050  * information, e.g. the Memory Order that is associated with a coordinate system
00051  * is available anyway.
00052  *
00053  * Revision 1.15  2003/06/14 12:09:25  werner
00054  * Incorporated Steffen's complains about the Size attribute of pseudo-datasets,
00055  * these are now written with an explicit DataSpace naming which is "reversed" like
00056  *  native HDF5 dataspaces, and an "extent" attributes, which specifies integer
00057  * coordinates.
00058  * Also optimized saving of types to only save types which have actually been used
00059  * for datasets (which is somewhat more work and requires more care when writing
00060  * datasets to register used datatypes).
00061  * Moreover shared datatypes are used now when possible to ease the access to
00062  * centralized datatype properties. However, this required replacing some attributes
00063  * with datasets in write_linear(), due to HDF5 insufficiencies. Hopefully this does not
00064  * introduce problems, it shouldn't.
00065  *
00066  * Revision 1.14  2003/06/13 16:30:57  zib
00067  * added F5Bswap_dims. renamed prop_id -> property_id
00068  * using F5Bswap is pending until size/Size/dataspacesize discussion
00069  * has settled.
00070  *
00071  * Revision 1.13  2003/05/27 11:52:15  zib
00072  * added F5_API stuff to build dll, if you like to build
00073  * a static lib you'll have to define F5_STATIC during every
00074  * build using the headers
00075  *
00076  * Revision 1.12  2003/05/09 15:50:57  werner
00077  * Ongoing support for user-defined coordinate systems.
00078  *
00079  * Revision 1.11  2003/05/06 11:00:29  werner
00080  * Added property lists to F5 field write() functions and
00081  * added an interface function for writing data in different refinement levels,
00082  * as a special case of AMR data.
00083  *
00084  * Revision 1.10  2003/04/28 09:07:12  werner
00085  * Disabled error message when creating a link to a group that already exists.
00086  *
00087  * Revision 1.9  2003/01/28 14:55:43  tino
00088  * Implemented F5write_uniform_cartesian3Dv(s)
00089  *
00090  * Revision 1.8  2003/01/28 00:34:21  tino
00091  * Only some small changes to docu.
00092  *
00093  * Revision 1.7  2002/12/21 19:02:11  werner
00094  * added a bunch of various coordinate systems
00095  * and better support on using them.
00096  *
00097  * Revision 1.6  2002/12/20 13:55:53  tino
00098  * Small change on Documentation
00099  *
00100  * Revision 1.5  2002/12/18 11:38:14  werner
00101  * improved documentation
00102  *
00103  * Revision 1.4  2002/12/11 16:29:25  werner
00104  * Simplified API, added documentation.
00105  * Still some functions need to be implemented.
00106  *
00107  * Revision 1.3  2002/12/10 15:43:19  werner
00108  * Added files for generating a good doxygen documentation.
00109  * Also included some preliminiary licensing as derived from Light++.
00110  * Modifications (enhancements!) are welcome, of course.
00111  *
00112  * Revision 1.2  2002/12/10 13:03:14  werner
00113  * Improved field interface, now also used for the uniform grid fields
00114  *
00115  * Revision 1.1  2002/10/17 15:29:28  werner
00116  * Added a couple of more or less randomly introduced functions, all of them
00117  * might be useful, but it really needs a better API design, otherwise we
00118  * end up with hundrets of functions. Some kind of object-oriented C-API
00119  * would be cool.
00120  *
00121  *
00122  */
00123 
00124 #ifndef __F5uniform_H
00125 #define __F5uniform_H
00126 
00127 #include <F5/F5F.h>
00128 #include <F5/F5coordinates.h>
00129 #include <F5/F5L.h>
00130 
00131 #include "F5WinDLLApi.h"
00132 
00133 #define FIBER_REGULAR_GRID_URL FIBER_VERSION_URL "RegularGrid-0.1.0/"
00134  
00135 #ifdef  __cplusplus
00136 extern "C"
00137 {
00138 #endif
00139 
00170 F5_API F5Path*F5Rcreate_rectilinear(hid_t File_id, double time,
00171                                      const char*gridname,
00172                                      const void*origin,
00173                                      const void*spacing,
00174                                      hsize_t*dims,
00175                                      const char*coordinate_system,
00176                                      hid_t property_id,
00177                                      ...);
00178 
00179 F5_API int F5get_extension(F5Path*grid,  hsize_t dims[FIBER_MAX_RANK]);
00180 
00181 
00196 F5_API F5Path*F5Rcreate_rectilinear_cartesian3D(hid_t File_id, double time,
00197                                      const char*gridname,
00198                                      const F5_vec3_point_t*origin,
00199                                      const F5_vec3_float_t*spacing,
00200                                      hsize_t dims[3],
00201                                      const char*coordinate_system,
00202                                      hid_t property_id,
00203                                      float*x,float*y,float*z);
00204 
00205 
00210 F5Path*F5Rcreate_curvilinear_cartesian3D(hid_t File_id, double time,
00211                                          const char*gridname,
00212                                          const F5_vec3_point_t*coords,
00213                                          hsize_t dims[3],
00214                                          const char*coordinate_system,
00215                                          hid_t property_id);
00216         
00235 F5_API F5Path*F5Rcreate_uniform(hid_t File_id, double time,
00236                                 const char*gridname,
00237                                 const void*origin,
00238                                 const void*spacing,
00239                                 hsize_t*dims,
00240                                 const char*coordinate_system);
00241 
00242 
00251 F5_API F5Path*F5Rcreate_uniform_cartesian3D(hid_t file_id, double time,
00252                                             const char*gridname,
00253                                             const F5_vec3_point_t*origin,
00254                                             const F5_vec3_float_t*spacing,
00255                                             hsize_t dims[3],
00256                                             const char*coordinate_system);
00257 
00258 F5_API F5Path*F5Rcreate_uniform_cartesian3Dbbox(hid_t File_id, double time,
00259                                                 const char*gridname,
00260                                                 const F5_vec3_point_t*start,
00261                                                 const F5_vec3_point_t*end,
00262                                                 hsize_t dims[3],
00263                                                 const char*coordinate_system);
00264 
00274 F5_API F5Path* F5Fwrite_uniform_cartesian3D(hid_t file_id, double time,
00275                                             const char*gridname,
00276                                             const F5_vec3_point_t*origin,
00277                                             const F5_vec3_float_t*spacing,
00278                                             hsize_t dims[3],
00279                                             const char*fieldname,
00280                                             hid_t fieldtype, 
00281                                             const void * dataPtr,
00282                                             const char*coordinate_system, 
00283                                             hid_t property_id);
00284 
00302 F5_API int F5write_uniform_cartesian3Dv(hid_t file_id, double time,
00303                                  const char*gridname,
00304                                  const F5_vec3_point_t*origin,
00305                                  const F5_vec3_float_t*spacing,
00306                                  hsize_t dims[3],
00307                                  const char*coordinate_system,
00308                                  hid_t property_id,
00309                                  ...);
00310 
00328 F5_API int F5write_uniform_cartesian3Dvs(hid_t file_id, double time,
00329                                  const char*gridname,
00330                                  const F5_vec3_point_t*origin,
00331                                  const F5_vec3_float_t*spacing,
00332                                  hsize_t dims[3],
00333                                  const char*coordinate_system,
00334                                  hid_t property_id,
00335                                  ...);
00336         
00348 F5_API F5Path* F5Fwrite_uniform_cartesian3Ds(hid_t file_id, double time,
00349                                              const char*gridname,
00350                                              const F5_vec3_point_t*origin,
00351                                              const F5_vec3_float_t*spacing,
00352                                              hsize_t dims[3],
00353                                              const char*fieldname,
00354                                              hid_t fieldtype, 
00355                                              const void ** dataPtr,
00356                                              const char*coordinate_system,
00357                                              hid_t property_id);
00358 
00359 
00360 
00361 
00362 
00363 #if 0
00364 
00367 F5_API hid_t F5BgetUniformCartesianGridVertexData3D(hid_t SliceID,
00368                                                     const char*gridname,
00369                                                     const char*fieldname,
00370                                                     F5_vec3_point_t*bbox_min, F5_vec3_point_t*bbox_max,
00371                                                     int dims[3]);
00372 #endif
00373 
00374 
00375 
00381 #ifdef  __cplusplus
00382 }    /* extern "C" */
00383 #endif
00384 
00385 #endif  /* __F5uniform_H */
00386