FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
F5B.h
Go to the documentation of this file.
1#ifndef __F5_Bundle_h
2#define __F5_Bundle_h
3
4#include "hdf5inc.h"
5#include "F5types.h"
6#include "F5Bchart.h"
7#include "F5F.h"
8
9#include <time.h>
10
11#include "F5WinDLLApi.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/**\defgroup bundle Basic Operations dealing with semantic structures below the end-user API.
18 */
19extern F5_API const char*F5_default_time_attrib_names[];
20
21typedef enum
22{
23 /** No specification at all for time */
25 /** The time is in free units, i.e. all units involved can be scaled freely */
37
38 /** The time unit is the duration that it takes light to travel one meter */
40
42
43
45{
46 /** The numerical value of the time parameter */
47 double value;
48
49 /** The Greenwhich mean time to which the value is relative */
50 time_t offset;
51
52 /** The absolute value of time, which refers to offset + value */
53 time_t datetime;
54
55 /** How is the numerical value to be interpreted */
57
58 /** Some additional informative comment */
59 /** This refers to a static string, it is used, but */
60 /** untouched by the F5 functions */
61 char *comment;
62
63};
64
66
67#define F5_TIMESLICE_NAME_LENGTH (64-8)
68
69/**@ingroup bundle
70 Data type entry for time tables.
71 */
78
79
80/**@ingroup bundle
81 Create a transient type that is compatible
82 with the TimeTableEntry data structure.
83 It must be release via H5Tclose() by the
84 calling code.
85 */
87
88
89/**@ingroup bundle
90 Initialize a time table for the given location.
91 @param timetable_type_id The type for time table entries,
92 such as provided by F5Bcreate_timetable_type(),
93 but it may well be (and should be) a named type
94 instead of a transient type.
95 @return false if the time table already existed.
96 F5_API int F5Binit_timetable(hid_t loc_id, hid_t timetable_type_id);
97 */
98
99/**@ingroup bundle
100 Append entries to the time table associated with a
101 certain location.
102 @param timetable_type_location_id the location ID where the
103 named datatype for timetable entries will be stored,
104 in case it needs to be created.
105 */
106F5_API hsize_t F5Bappend_timetable(hid_t loc_id,
107 hid_t timetable_type_location_id,
108 const TimeTableEntry*TTE,
109 hsize_t append_dims);
110
111
112/**@ingroup bundle
113 Get the number of entries in the respective time table.
114 */
115F5_API hsize_t F5Bget_timetable_size(hid_t loc_id);
116
117
118/**@ingroup bundle
119 Read the entries of a time table.
120 */
121hsize_t F5Bread_timetable(hid_t loc_id,
122 TimeTableEntry*TTE,
123 hsize_t table_size);
124
125
126
127
128/**@ingroup bundle
129 Allocate a new F5_TimeParameter structure in memory.
130 Actually, one could also pass a static structure, but
131 using this function and F5deleteTimePArameter(), the call
132 is safe even if the TimeParameter structure is changed
133 in a future version of F5.
134 */
136
137/**@ingroup bundle
138 Deallocate a F5_TimeParameter structure from memory.
139 It needs to be passed a pointer to a pointer, whereby
140 the pointer is set to zero on deallocation. So it is
141 safe to call this function multiple times on the
142 same pointer (just for experimental convenience!).
143 */
145
146/**@ingroup bundle
147 Set the time unit globally for the given file.
148 @return Non-zero indicates that an incompatible time unit has
149 already been set and was not overriden. The caller should
150 take special care to write new data into a different file
151 then.
152 */
153F5_API int F5setTimeUnit(hid_t file_id, const F5_TimeParameter*);
154
155/**@ingroup bundle
156 Get the time unit information as specified in the file.
157 */
159
160/**@ingroup bundle
161 Construct the name used for a timeslice, the toplevel hierarchy.
162
163 Retrieve the name of the time slice assocciated with the given time.
164 The time is specified as a pointer, such that it may be NULL to indicate
165 a static dataset.
166*/
167F5_API char*F5I_timegroup(const double*time, char*destbuf, size_t len);
168
169/**@ingroup bundle
170 Append a time slice in the given time unit.
171 Only one time unit is allowed per file.
172 If another time unit has already been defined in the file,
173 the function will return without touching the file.
174 */
175F5_API hid_t F5Bappend_timeslice(hid_t file_id, const F5_TimeParameter*time);
176
177/**\ingroup bundle
178 Get the HDF5 identifier for a given time slice.
179 A new group is created in the file if none exists yet.
180 @param file_id HDF5 File identifier.
181 @param time The time is specified as a pointer, such that it may be NULL to indicate
182 a static dataset.
183 @return HDF5 identifier for the newly created or opened Time Slice group.
184 \todo Maybe move to another header.
185 @todo Add consistency check on re-open of an existing group
186 */
187F5_API hid_t F5Bappend_slice(hid_t file_id, const double*time);
188
189/**\ingroup bundle
190 Initialize an F5Path from a file for reading.
191 The coordinate system is set to the default cartesian coordinates.
192 No timeslice, grid, field etc. ID's are defined yet, these need
193 to be filled in by iteration. This function is called internally
194 by F5iterate_timeslices() for creating an F5Path object that
195 is then modified to contain a valid group ID for each timeslice,
196 grid, field, ...
197 Currently, it is hard-coded for reading cartesian coordinates
198 only. The preferred way is to employ iterators on reading files.
199 */
200F5_API F5Path*F5Binitialize_path(hid_t File_id);
201
202
203/**\ingroup bundle
204 Get the next slice for given time attriute names.
205 @deprecated
206 */
207F5_API hid_t F5BgetMostRecentSlice(double*t, hid_t FileID,
208 const char**time_attrib_names);
209
210/**\ingroup bundle
211 Get the MostRecentSlice out of a HDF5 file with the given name.
212 */
213F5_API hid_t F5BgetMostRecentFileSlice(double t, const char*filename);
214
215/**\ingroup bundle
216 Get the GridVertexData for given grid-, chart- and fieldnames.
217 */
218F5_API hid_t F5BgetGridVertexData(hid_t SliceID,
219 const char*gridname,
220 const char*chartname,
221 const char*fieldname);
222
223
224
225/** \brief Swap from C array order to Fortran array order and back.
226 *
227 * \param dimensions
228 * Number of dimensions.
229 *
230 * \param in
231 * Input vector.
232 *
233 * \param out
234 * Output vector.
235 *
236 * Use it like
237\code
238 hsize_t c_dims[FIBER_MAX_RANK];
239
240 F5order_swap (3, dims, c_dims);
241 id = F5Screate_simple (...);
242\endcode
243 */
244F5_API void F5Bswap_dims (int dimensions, const hsize_t* in, hsize_t* out);
245
246#ifdef __cplusplus
247}
248#endif
249
250
251#endif /* __F5_Bundle_h */
struct _F5_TimeParameter F5_TimeParameter
Definition F5B.h:65
F5_API const char * F5_default_time_attrib_names[]
Definition F5Bslice.c:10
#define F5_TIMESLICE_NAME_LENGTH
Definition F5B.h:67
F5_TimeSemantics
Definition F5B.h:22
@ MILLISECONDS
Definition F5B.h:29
@ NANOSECONDS
Definition F5B.h:27
@ METRES
Definition F5B.h:39
@ MINUTES
Definition F5B.h:31
@ HOURS
Definition F5B.h:32
@ YEARS
Definition F5B.h:34
@ SECONDS
Definition F5B.h:30
@ UNSPECIFIED
Definition F5B.h:24
@ UNITLESS
Definition F5B.h:26
@ MICROSECONDS
Definition F5B.h:28
@ MEGAYEARS
Definition F5B.h:35
@ DAYS
Definition F5B.h:33
@ ELECTRONVOLTS
Definition F5B.h:36
F5_API void F5Bswap_dims(int dimensions, const hsize_t *in, hsize_t *out)
Swap from C array order to Fortran array order and back.
Definition F5B.c:230
#define F5_API
Definition F5WinDLLApi.h:11
F5_API hid_t F5Bcreate_timetable_type(void)
Definition F5Bslice.c:167
F5_API hsize_t F5Bget_timetable_size(hid_t loc_id)
Definition F5Bslice.c:328
F5_API hid_t F5Bappend_slice(hid_t file_id, const double *time)
Definition F5Bslice.c:140
F5_API F5_TimeParameter * F5BnewTimeParameter(void)
F5_API hsize_t F5Bappend_timetable(hid_t loc_id, hid_t timetable_type_location_id, const TimeTableEntry *TTE, hsize_t append_dims)
Definition F5Bslice.c:261
F5_API int F5setTimeUnit(hid_t file_id, const F5_TimeParameter *)
Definition F5Bslice.c:115
F5_API hid_t F5BgetMostRecentSlice(double *t, hid_t FileID, const char **time_attrib_names)
Definition F5Bslice.c:55
F5_API int F5getTimeUnit(hid_t file_id, F5_TimeParameter *)
hsize_t F5Bread_timetable(hid_t loc_id, TimeTableEntry *TTE, hsize_t table_size)
Definition F5Bslice.c:366
F5_API hid_t F5BgetMostRecentFileSlice(double t, const char *filename)
Definition F5Bslice.c:70
F5_API F5Path * F5Binitialize_path(hid_t File_id)
Definition F5B.c:156
F5_API void F5deleteTimeParameter(F5_TimeParameter **)
struct _TimeTableEntry TimeTableEntry
F5_API hid_t F5BgetGridVertexData(hid_t SliceID, const char *gridname, const char *chartname, const char *fieldname)
Definition F5Bgrid.c:5
F5_API hid_t F5Bappend_timeslice(hid_t file_id, const F5_TimeParameter *time)
Definition F5Bslice.c:134
F5_API char * F5I_timegroup(const double *time, char *destbuf, size_t len)
Definition F5Bslice.c:90
char * comment
Definition F5B.h:61
double value
Definition F5B.h:47
F5_TimeSemantics TimeSemantics
Definition F5B.h:56
time_t offset
Definition F5B.h:50
time_t datetime
Definition F5B.h:53
char TimesliceName[F5_TIMESLICE_NAME_LENGTH]
Definition F5B.h:75
double TimeValue
Definition F5B.h:74