FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
F5uniform.h
Go to the documentation of this file.
1/*
2 *
3 * $Id: F5uniform.h,v 1.25 2007/01/16 18:42:49 werner Exp $
4 *
5 * $Log: F5uniform.h,v $
6 * Revision 1.25 2007/01/16 18:42:49 werner
7 * Revision of the chart/coordinate interface in FiberLib2, simpler, easier,
8 * more existent now.
9 *
10 * Revision 1.24 2005/10/28 05:00:21 werner
11 * slight improvement of documentation and vector field example added.
12 * will add particle vectors and surface vectors soon.
13 *
14 * Revision 1.23 2004/03/22 15:30:05 werner
15 * Generalized treatment of refinement within the framework of relative representations. Closer to better support of downsampling topologies.
16 * Improved documentation.
17 *
18 * Revision 1.22 2004/03/10 16:27:14 werner
19 * Introduced a type for rational numbers to specify coordinates of
20 * refinement levels that are not exactly vertex-aligned.
21 * Preliminiary Carpet F5 thorn appears to implement the fiber concept correctly
22 * at first sight.
23 *
24 * Revision 1.21 2003/11/12 15:21:31 zib
25 * added more ContentType stuff
26 *
27 * Revision 1.20 2003/11/06 20:50:12 zib
28 * fixed typo
29 *
30 * Revision 1.19 2003/11/04 19:24:10 werner
31 * Revised version including a table of contents and field info per grid, and
32 * also telling the grids per field (reverse look). The API has been revised
33 * somewhat, such that F5F... function are all functions operation on F5Path
34 * objects with fields defined.
35 *
36 * Revision 1.18 2003/08/12 12:30:09 werner
37 * API change: do not return F5Path* when the argument is only modified, just return boolean
38 * indicating success.
39 *
40 * Revision 1.17 2003/07/17 10:36:41 werner
41 * Corrected documentation.
42 * Added F5Iignore() function to tell which groups shall be ignored during iteration.
43 *
44 * Revision 1.16 2003/06/16 11:00:20 werner
45 * Changed the iterator functions to use F5Path objects instead of HDF5 ID's.
46 * This makes encapsulates more of HDF5 and insists more of using F5,
47 * but makes retrieving the F5 information easier.
48 * Also changed back the shared data types to nameless types. Thus type
49 * attributes cannot be determined directly, but when using F5 functions this
50 * information, e.g. the Memory Order that is associated with a coordinate system
51 * is available anyway.
52 *
53 * Revision 1.15 2003/06/14 12:09:25 werner
54 * Incorporated Steffen's complains about the Size attribute of pseudo-datasets,
55 * these are now written with an explicit DataSpace naming which is "reversed" like
56 * native HDF5 dataspaces, and an "extent" attributes, which specifies integer
57 * coordinates.
58 * Also optimized saving of types to only save types which have actually been used
59 * for datasets (which is somewhat more work and requires more care when writing
60 * datasets to register used datatypes).
61 * Moreover shared datatypes are used now when possible to ease the access to
62 * centralized datatype properties. However, this required replacing some attributes
63 * with datasets in write_linear(), due to HDF5 insufficiencies. Hopefully this does not
64 * introduce problems, it shouldn't.
65 *
66 * Revision 1.14 2003/06/13 16:30:57 zib
67 * added F5Bswap_dims. renamed prop_id -> property_id
68 * using F5Bswap is pending until size/Size/dataspacesize discussion
69 * has settled.
70 *
71 * Revision 1.13 2003/05/27 11:52:15 zib
72 * added F5_API stuff to build dll, if you like to build
73 * a static lib you'll have to define F5_STATIC during every
74 * build using the headers
75 *
76 * Revision 1.12 2003/05/09 15:50:57 werner
77 * Ongoing support for user-defined coordinate systems.
78 *
79 * Revision 1.11 2003/05/06 11:00:29 werner
80 * Added property lists to F5 field write() functions and
81 * added an interface function for writing data in different refinement levels,
82 * as a special case of AMR data.
83 *
84 * Revision 1.10 2003/04/28 09:07:12 werner
85 * Disabled error message when creating a link to a group that already exists.
86 *
87 * Revision 1.9 2003/01/28 14:55:43 tino
88 * Implemented F5write_uniform_cartesian3Dv(s)
89 *
90 * Revision 1.8 2003/01/28 00:34:21 tino
91 * Only some small changes to docu.
92 *
93 * Revision 1.7 2002/12/21 19:02:11 werner
94 * added a bunch of various coordinate systems
95 * and better support on using them.
96 *
97 * Revision 1.6 2002/12/20 13:55:53 tino
98 * Small change on Documentation
99 *
100 * Revision 1.5 2002/12/18 11:38:14 werner
101 * improved documentation
102 *
103 * Revision 1.4 2002/12/11 16:29:25 werner
104 * Simplified API, added documentation.
105 * Still some functions need to be implemented.
106 *
107 * Revision 1.3 2002/12/10 15:43:19 werner
108 * Added files for generating a good doxygen documentation.
109 * Also included some preliminiary licensing as derived from Light++.
110 * Modifications (enhancements!) are welcome, of course.
111 *
112 * Revision 1.2 2002/12/10 13:03:14 werner
113 * Improved field interface, now also used for the uniform grid fields
114 *
115 * Revision 1.1 2002/10/17 15:29:28 werner
116 * Added a couple of more or less randomly introduced functions, all of them
117 * might be useful, but it really needs a better API design, otherwise we
118 * end up with hundrets of functions. Some kind of object-oriented C-API
119 * would be cool.
120 *
121 *
122 */
123
124#ifndef __F5uniform_H
125#define __F5uniform_H
126
127#include "F5F.h"
128#include "F5coordinates.h"
129#include "F5L.h"
130
131#include "F5WinDLLApi.h"
132
133#define FIBER_REGULAR_GRID_URL FIBER_VERSION_URL "RegularGrid-0.1.0/"
134
135#ifdef __cplusplus
136extern "C"
137{
138#endif
139
140/** \defgroup regular Regular Grids
141*/
142
143/** @{ */
144
145/**
146 Create a representation that is rectilinear, uniform or stacked in the given
147 coordinate system.
148
149 @param origin The origin of the grid, must be of the coordinate type that
150 is associated with the coordinate system.
151 @param spacing The distance among neighboring points of the grid, must be of
152 the vector type of the coordinate system, i.e. the coordinate
153 type that stores coordinate differences.
154 @param coordinate_system The coordinate system.
155 May be NULL to refer to the standard cartesian chart.
156
157 @param property_id HDF5 property for storing the coordinate arrays in the file,
158 e.g. chunked and/or compressed. May be F5P_DEFAULT.
159 The property will be used to create 1D arrays.
160 The coordinate arrays are usually small compared
161 to the field data. Therefore, the default should be fine
162 for all cases.
163
164 @param ... The argument list is to be succeeded by a list of data
165 pointers, each of them pointing to a one-dimensional
166 array of data values. One array per coordinate needs to
167 be specified (but may be NULL), with exactly the same type
168 as in the coordinate system's point type.
169*/
170F5_API F5Path*F5Rcreate_rectilinear(hid_t File_id, double time,
171 const char*gridname,
172 const void*origin,
173 const void*spacing,
174 hsize_t*dims,
175 const char*coordinate_system,
176 hid_t property_id,
177 ...);
178
179F5_API int F5get_extension(F5Path*grid, hsize_t dims[FIBER_MAX_RANK]);
180
181
182/**
183 Create a regular grid with rectilinear or stacked coordinates.
184 If the one-dimensional coordinate arrays are omitted, then a linear
185 mapping based on the origin and spacing parameters is assumed.
186 If all coordinate arrays are given, then the origin and spacing
187 information is not used. Otherwise, if none of the coordinate arrays
188 is given, then the coordinates will be uniform.
189 \see F5create_uniform_cartesian3D(),F5create_rectilinear()
190
191 @param x Coordinate values in x direction, may be NULL.
192 @param y Coordinate values in y direction, may be NULL.
193 @param z Coordinate values in z direction, may be NULL.
194
195*/
196F5_API F5Path*F5Rcreate_rectilinear_cartesian3D(hid_t File_id, double time,
197 const char*gridname,
198 const F5_vec3_point_t*origin,
199 const F5_vec3_float_t*spacing,
200 hsize_t dims[3],
201 const char*coordinate_system,
202 hid_t property_id,
203 float*x,float*y,float*z);
204
205
206/**
207 Create a regular grid with curvilinear coordinates.
208 \see F5create_uniform_cartesian3D(),F5create_rectilinear()
209*/
210F5Path*F5Rcreate_curvilinear_cartesian3D(hid_t File_id, double time,
211 const char*gridname,
212 const F5_vec3_point_t*coords,
213 hsize_t dims[3],
214 const char*coordinate_system,
215 hid_t property_id);
216
217/** \defgroup unigrid Uniform Grids
218*/
219
220/** @{ */
221
222/**
223 Create a regular grid which is uniform in the specified coordinate system.
224
225 @param origin The origin of the grid, must be of the coordinate type that
226 is associated with the coordinate system.
227 @param spacing The distance among neighboring points of the grid, must be of
228 the vector type of the coordinate system, i.e. the coordinate
229 type that stores coordinate differences.
230 @param coordinate_system The coordinate system.
231 May be NULL to refer to the standard cartesian chart.
232
233 @return A new F5Path pointer. Call F5close() if it is no longer used.
234 */
235F5_API F5Path*F5Rcreate_uniform(hid_t File_id, double time,
236 const char*gridname,
237 const void*origin,
238 const void*spacing,
239 hsize_t*dims,
240 const char*coordinate_system);
241
242
243/** Create a regular three-dimensional grid which is uniform in the specified
244 coordinate system.
245
246 @param coordinate_system The coordinate system.
247 May be NULL to refer to a standard chart.
248
249 @return A new F5Path pointer. Call F5close() if it is no longer used.
250 */
251F5_API F5Path*F5Rcreate_uniform_cartesian3D(hid_t file_id, double time,
252 const char*gridname,
253 const F5_vec3_point_t*origin,
254 const F5_vec3_float_t*spacing,
255 hsize_t dims[3],
256 const char*coordinate_system);
257
258F5_API F5Path*F5Rcreate_uniform_cartesian3Dbbox(hid_t File_id, double time,
259 const char*gridname,
260 const F5_vec3_point_t*start,
261 const F5_vec3_point_t*end,
262 hsize_t dims[3],
263 const char*coordinate_system);
264
265/**
266 * Write a data field given on uniform cartesian grid into file.
267
268 @param coordinate_system The coordinate system.
269 May be NULL to refer to a standard chart.
270
271
272 @return A new F5Path pointer. Call F5close() if it is no longer used.
273 */
274F5_API F5Path* F5Fwrite_uniform_cartesian3D(hid_t file_id, double time,
275 const char*gridname,
276 const F5_vec3_point_t*origin,
277 const F5_vec3_float_t*spacing,
278 hsize_t dims[3],
279 const char*fieldname,
280 hid_t fieldtype,
281 const void * dataPtr,
282 const char*coordinate_system,
283 hid_t property_id);
284
285/**
286Write a bunch of data fields given on the same uniform cartesian grid.
287This variation of the uniform grid writer function uses a variable number
288of arguments list. Each field is defined by a triple of
289<PRE>
290 const char *fieldname
291 hid_t fieldtype
292 const void *dataPtr
293</PRE>
294If either the fieldname or the dataPtr are NULL, then the traversal of the
295argument is terminated.
296
297@param coordinate_system The coordinate system.
298 May be NULL to refer to a standard chart.
299
300@return The number of successfully written fields.
301 */
302F5_API int F5write_uniform_cartesian3Dv(hid_t file_id, double time,
303 const char*gridname,
304 const F5_vec3_point_t*origin,
305 const F5_vec3_float_t*spacing,
306 hsize_t dims[3],
307 const char*coordinate_system,
308 hid_t property_id,
309 ...);
310
311/**
312Write a bunch of data fields given on the same uniform cartesian grid.
313This variation of the uniform grid writer function uses a variable number
314of arguments list. Each field is defined by a triple of
315<PRE>
316 const char *fieldname
317 hid_t fieldtype
318 const void **dataPtr
319</PRE>
320If either the fieldname or the dataPtr are NULL, then the traversal of the
321argument is terminated.
322
323@param coordinate_system The coordinate system.
324 May be NULL to refer to a standard chart.
325
326@return The number of successfully written fields.
327 */
328F5_API int F5write_uniform_cartesian3Dvs(hid_t file_id, double time,
329 const char*gridname,
330 const F5_vec3_point_t*origin,
331 const F5_vec3_float_t*spacing,
332 hsize_t dims[3],
333 const char*coordinate_system,
334 hid_t property_id,
335 ...);
336
337/**
338Write a data field given on uniform cartesian grid for a given coordinate system
339into file.
340If the data is a compound data type, then it is given as distinct
341homogeneous arrays in memory.
342
343@param coordinate_system The coordinate system.
344 May be NULL to refer to a standard chart.
345
346@return A new F5Path pointer. Call F5close() if it is no longer used.
347 */
348F5_API F5Path* F5Fwrite_uniform_cartesian3Ds(hid_t file_id, double time,
349 const char*gridname,
350 const F5_vec3_point_t*origin,
351 const F5_vec3_float_t*spacing,
352 hsize_t dims[3],
353 const char*fieldname,
354 hid_t fieldtype,
355 const void ** dataPtr,
356 const char*coordinate_system,
357 hid_t property_id);
358
359
360/* A sparse uniform grid only has values at explicitely specified indices, which are decribed
361 in a field called Sparse. Sparse contains 1D indices (which can be mapped to and from an
362 N dimensional index.
363 Origin, delta and dimensions size are stored in the positions field (as group attributes).
364 Alternative version, see below.
365*/
366F5_API F5Path*F5Rcreate_uniform_sparse( hid_t file_id, double time,
367 const char*gridname,
368 const void*origin,
369 const void*spacing,
370 hsize_t*dims,
371 const char*coordinate_system,
372 const hsize_t*sparse_idx_Ptr,
373 const hsize_t sparse_size,
374 hid_t property_id );
375
376/* Experimental alterntive, by using attributes on the index field 'Sparse'. Seems a bit more consistent. */
377F5_API F5Path*F5Rcreate_uniform_sparse2( hid_t file_id, double time,
378 const char*gridname,
379 const F5_vec3_double_t*origin,
380 const F5_vec3_double_t*spacing,
381 hsize_t*dims,
382 const char*coordinate_system,
383 const hsize_t*sparse_idx_Ptr,
384 hsize_t sparse_size,
385 hid_t property_id );
386
387
388#if 0
389/**
390 Get the vertex data for a given grid- and fieldname in cartesion coordinates.
391 */
392F5_API hid_t F5BgetUniformCartesianGridVertexData3D(hid_t SliceID,
393 const char*gridname,
394 const char*fieldname,
395 F5_vec3_point_t*bbox_min, F5_vec3_point_t*bbox_max,
396 int dims[3]);
397#endif
398
399
400
401/** @} */
402
403/** @} */
404
405
406#ifdef __cplusplus
407} /* extern "C" */
408#endif
409
410#endif /* __F5uniform_H */
411
#define F5_API
Definition F5WinDLLApi.h:11
F5_point3f_t F5_vec3_point_t
#define FIBER_MAX_RANK
Definition F5defs.h:105
F5Path * F5Rcreate_curvilinear_cartesian3D(hid_t File_id, double time, const char *gridname, const F5_vec3_point_t *coords, hsize_t dims[3], const char *coordinate_system, hid_t property_id)
Definition F5uniform.c:147
F5_API F5Path * F5Rcreate_rectilinear(hid_t File_id, double time, const char *gridname, const void *origin, const void *spacing, hsize_t *dims, const char *coordinate_system, hid_t property_id,...)
Definition F5uniform.c:169
F5_API int F5get_extension(F5Path *grid, hsize_t dims[FIBER_MAX_RANK])
Definition F5uniform.c:522
F5_API F5Path * F5Rcreate_rectilinear_cartesian3D(hid_t File_id, double time, const char *gridname, const F5_vec3_point_t *origin, const F5_vec3_float_t *spacing, hsize_t dims[3], const char *coordinate_system, hid_t property_id, float *x, float *y, float *z)
Definition F5uniform.c:242
F5_API F5Path * F5Rcreate_uniform_cartesian3Dbbox(hid_t File_id, double time, const char *gridname, const F5_vec3_point_t *start, const F5_vec3_point_t *end, hsize_t dims[3], const char *coordinate_system)
Definition F5uniform.c:110
F5_API F5Path * F5Rcreate_uniform(hid_t File_id, double time, const char *gridname, const void *origin, const void *spacing, hsize_t *dims, const char *coordinate_system)
F5_API int F5write_uniform_cartesian3Dvs(hid_t file_id, double time, const char *gridname, const F5_vec3_point_t *origin, const F5_vec3_float_t *spacing, hsize_t dims[3], const char *coordinate_system, hid_t property_id,...)
Definition F5uniform.c:388
F5_API F5Path * F5Rcreate_uniform_sparse2(hid_t file_id, double time, const char *gridname, const F5_vec3_double_t *origin, const F5_vec3_double_t *spacing, hsize_t *dims, const char *coordinate_system, const hsize_t *sparse_idx_Ptr, hsize_t sparse_size, hid_t property_id)
Definition F5uniform.c:579
F5_API F5Path * F5Fwrite_uniform_cartesian3Ds(hid_t file_id, double time, const char *gridname, const F5_vec3_point_t *origin, const F5_vec3_float_t *spacing, hsize_t dims[3], const char *fieldname, hid_t fieldtype, const void **dataPtr, const char *coordinate_system, hid_t property_id)
Definition F5uniform.c:301
F5_API F5Path * F5Fwrite_uniform_cartesian3D(hid_t file_id, double time, const char *gridname, const F5_vec3_point_t *origin, const F5_vec3_float_t *spacing, hsize_t dims[3], const char *fieldname, hid_t fieldtype, const void *dataPtr, const char *coordinate_system, hid_t property_id)
Definition F5uniform.c:271
F5_API int F5write_uniform_cartesian3Dv(hid_t file_id, double time, const char *gridname, const F5_vec3_point_t *origin, const F5_vec3_float_t *spacing, hsize_t dims[3], const char *coordinate_system, hid_t property_id,...)
Definition F5uniform.c:332
F5_API F5Path * F5Rcreate_uniform_sparse(hid_t file_id, double time, const char *gridname, const void *origin, const void *spacing, hsize_t *dims, const char *coordinate_system, const hsize_t *sparse_idx_Ptr, const hsize_t sparse_size, hid_t property_id)
Definition F5uniform.c:545
F5_API F5Path * F5Rcreate_uniform_cartesian3D(hid_t file_id, double time, const char *gridname, const F5_vec3_point_t *origin, const F5_vec3_float_t *spacing, hsize_t dims[3], const char *coordinate_system)
Definition F5uniform.c:73