FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
F5types.h
Go to the documentation of this file.
1#ifndef __F5_types_H
2#define __F5_types_H
3
4#include "hdf5inc.h"
5#include "F5defs.h"
6
7#include "F5WinDLLApi.h"
8
9#include <stdint.h> /* required for int32_t */
10
11#ifdef __cplusplus
12extern "C"
13{
14#endif
15
16typedef unsigned char F5_byte_t;
17typedef unsigned char F5_uint8_t;
18
19typedef unsigned short F5_int16_t;
21typedef uint32_t F5_uint32_t;
22typedef uint64_t F5_uint64_t;
23typedef int32_t F5_int32_t;
24typedef float F5_float_t;
25typedef double F5_double_t;
26
27typedef struct { F5_byte_t r,g,b; } F5_rgb_t;
28typedef struct { F5_byte_t r,g,b,a; } F5_rgba_t;
29typedef struct { F5_byte_t b,g,r; } F5_bgr_t;
30typedef struct { F5_int16_t r,g,b; } F5_rgb16_t;
31typedef struct { F5_int16_t r,g,b,a; } F5_rgba16_t;
32
33/** floating-point colors */
34typedef struct { F5_float_t r,g,b; } F5_rgb_real_t;
35typedef struct { F5_float_t r,g,b,a; } F5_rgba_real_t;
36
37#define F5T_RGB F5T_rgb_g()
38#define F5T_RGBA F5T_rgba_g()
39#define F5T_BGR F5T_bgr_g()
40#define F5T_RGB16 F5T_rgb16_g()
41#define F5T_RGBA16 F5T_rgba16_g()
42#define F5T_RGB_REAL F5T_rgb_real_g()
43#define F5T_RGBA_REAL F5T_rgba_real_g()
44
45
46F5_API hid_t F5T_rgb_g();
47F5_API hid_t F5T_rgba_g();
48F5_API hid_t F5T_bgr_g();
49F5_API hid_t F5T_rgb16_g();
50F5_API hid_t F5T_rgba16_g();
54
55/**
56 Given a tensor of rank three with indices i,j,k,
57 then its corresponding linear index is given by
58 Li = i+rank*j+rank*rank*k
59 Not all of the tensor components might reside actually
60 in memory, but due to symmetries only some of them do.
61 The indexing array is used to map the linear index to
62 the actual memory index:
63
64 Rijk = data[ indexing[ Li ] ]
65
66 The parity array specifies the sign change when accessing
67 components in addition to the indexing. It may be zero for
68 components which are never non-zero. Usually it will just be
69 +1 or -1 . The final tensor value is given by
70
71 Rijk = data[ indexing[ Li ] ] * parity[ Li ]
72
73 The size of the indexing and parity arrays is given by the components member.
74
75 The covariance array gives the upper or lower indexing scheme.
76 For a rank 3 tensor, it has three entries that may be positive or negative.
77
78 The reverse_indexing array provides the inverse mapping of the indexing array.
79
80 The metric member specifies relative to which metric tensor field this
81 indicable field is actually a tensor field.
82 */
83typedef struct
84{
85 /** Descriptive name. */
86 char *name;
87 /** HDF5 Type ID */
88 hid_t type_id;
89 /** Rank of the tensor */
90 int rank,
91 /** Dimensionality of the underlying manifold */
93 /** Actual components which require storage */
95 /**
96 Index mapping array per component from linear component index to memory component, size(indexing)=dimension^rank.
97 If all entries are zero, then this information has not yet been defined.
98 If the pointer is zero, then no symmetries are defined, i.e. all components
99 are relevant.
100 */
102 /** Sign change information during indexing per component, size(parity)=dimension^rank */
103 int *parity;
104 /** Upper/Lower indexing information per index, size(covariance)=rank */
106 /** Reverse indexing information, size(reverse_indexing) = components */
108 /** Name of a metric tensor field */
109 char *metric;
110 /** Textual description of non-tensorial transformation rules */
112
114
115/**
116 Create a new tensor type description.
117 All arrays are allocated, but set to zero.
118 @param name A descriptive name, eg. vector, covector, metric, Christoffel, Riemann, Ricci ...
119 Be careful to choose a meaningful name and distringuish among the type
120 of the tensor an various instances of this type. For instance, "Ricci" is
121 not necessarily a good name, as it is a symmetric tensor of rank two, exactly
122 the same as the metric. So in practice these should be two tensor fields of
123 different names bu with the same type.
124 @param rank The rank of the tensor field, e.g. 2 for a two-form. Note that covariance
125 properties need to be set in the covariance array.
126 @param dimension The dimensions of the base manifold.
127 @param components The actual number of variables that need to be kept in memory.
128 Due to symmetry/asymmetry relationships, this might only be a subset
129 of the full set of components.
130 */
131F5_API F5Ttensor_t*newF5Ttensor(const char*name, int rank, int dimension, int components);
132
133/**
134 Save tensor type to file and return a copy.
135 All internal arrays are copied, no reference counting.
136 */
138
139/**
140 Remove a tensor description.
141 */
143
144/**
145 Check if the two types are equivalent.
146 This requires that each type of a compound type has the
147 the same name and the same class.
148 Also, all attributes must be equal.
149 */
150F5_API int F5Tis_convertible(hid_t first_type, hid_t second_type);
151
152/**
153 Get a field type for F5 array descriptions.
154 */
156
157/**
158 Create a named field type for F5 array descriptions by
159 saving the transient enum type to a file.
160 */
161F5_API hid_t F5Tsave_F5field_enum(hid_t loc_id);
162
163/**
164 Set a field type in a file.
165 */
166F5_API herr_t F5Tset_field_enum(hid_t loc_id, hid_t enum_type_id, ArrayType what);
167
168/**
169 Return a human-readable description of the array type,
170 for convenience on console or log file outputs.
171 */
173
174/**
175 Get the field type for a field, which is supposed to be
176 an HDF5 group or dataset.
177
178 We try to open an attribute named FIBER_ARRAY_TYPE_ENUM, its type
179 is supposed to be a named data type bound to the file.
180 The attributes of this \b type will be the version number
181 information for the given loc_id .
182 The \b value of this attribute will be an enum compatible
183 with the ArrayType enum from which the information is retrieved.
184 There are some fallback mechanisms in case there are troubles,
185 such as no such attribute existing.
186 */
188 int*major_version, int*minor_version, int*release_version);
189
190/**
191 Set the array type of a procedural array.
192 @param ProcIDLocation Group ID where the enumeration type is stored in the file.
193 */
194F5_API herr_t F5Tset_field_ProcArray_enum(hid_t loc_id, ProceduralArrayType what, hid_t ProcIDLocation);
195
196F5_API ProceduralArrayType F5Tget_field_ProcArray_enum(hid_t loc_id, hid_t enum_type_id,
197 int*major_version, int*minor_version, int*release_version);
198
199/**
200 * Prints type info
201 */
202
203F5_API void F5Tprint(hid_t type);
204
205#ifdef __cplusplus
206} /* extern "C" */
207#endif
208
209
210#endif /* __F5_types_H */
name
Definition F5P.c:82
#define F5_API
Definition F5WinDLLApi.h:11
ProceduralArrayType
Definition F5defs.h:283
ArrayType
Definition F5defs.h:267
F5_API int deleteF5Ttensor(F5Ttensor_t *)
Definition F5types.c:622
F5_API F5Ttensor_t * F5Ttensor_commit(hid_t loc_id, F5Ttensor_t *)
F5_API ProceduralArrayType F5Tget_field_ProcArray_enum(hid_t loc_id, hid_t enum_type_id, int *major_version, int *minor_version, int *release_version)
Definition F5types.c:490
F5_API hid_t F5T_rgb16_g()
Definition F5types.c:64
F5_API herr_t F5Tset_field_enum(hid_t loc_id, hid_t enum_type_id, ArrayType what)
Definition F5types.c:268
F5_API F5Ttensor_t * newF5Ttensor(const char *name, int rank, int dimension, int components)
Definition F5types.c:552
F5_API hid_t F5Ttransient_F5field_Array_enum()
Definition F5types.c:189
F5_API hid_t F5T_vec3_double_g()
Definition F5types.c:150
F5_API hid_t F5T_bgr_g()
Definition F5types.c:50
unsigned short F5_int16_t
Definition F5types.h:19
uint64_t F5_uint64_t
Definition F5types.h:22
float F5_float_t
Definition F5types.h:24
F5_API herr_t F5Tset_field_ProcArray_enum(hid_t loc_id, ProceduralArrayType what, hid_t ProcIDLocation)
Definition F5types.c:455
unsigned char F5_uint8_t
Definition F5types.h:17
unsigned char F5_byte_t
Definition F5types.h:16
F5_API hid_t F5Tsave_F5field_enum(hid_t loc_id)
Definition F5types.c:222
F5_API void F5Tprint(hid_t type)
Definition F5types.c:695
F5_API hid_t F5T_rgb_real_g()
Definition F5types.c:92
F5_API hid_t F5T_rgba_real_g()
Definition F5types.c:105
int32_t F5_int32_t
Definition F5types.h:23
F5_API hid_t F5T_rgba16_g()
Definition F5types.c:78
F5_API hid_t F5T_rgba_g()
Definition F5types.c:36
F5_API const char * F5Tget_field_description(ArrayType what)
Definition F5types.c:249
uint32_t F5_uint32_t
Definition F5types.h:21
F5_API int F5Tis_convertible(hid_t first_type, hid_t second_type)
Definition F5types.c:637
double F5_double_t
Definition F5types.h:25
F5_int16_t F5_uint16_t
Definition F5types.h:20
F5_API hid_t F5T_rgb_g()
Definition F5types.c:23
F5_API ArrayType F5Tget_field_Array_enum(hid_t loc_id, int *major_version, int *minor_version, int *release_version)
Definition F5types.c:305
int * parity
Definition F5types.h:103
int components
Definition F5types.h:94
int * indexing
Definition F5types.h:101
char * transformation_rule
Definition F5types.h:111
int * covariance
Definition F5types.h:105
char * name
Definition F5types.h:86
hid_t type_id
Definition F5types.h:88
int dimension
Definition F5types.h:92
char * metric
Definition F5types.h:109
int * reverse_indexing
Definition F5types.h:107
F5_byte_t g
Definition F5types.h:29
F5_byte_t r
Definition F5types.h:29
F5_byte_t b
Definition F5types.h:29
F5_int16_t b
Definition F5types.h:30
F5_int16_t g
Definition F5types.h:30
F5_int16_t r
Definition F5types.h:30
F5_float_t r
Definition F5types.h:34
F5_float_t b
Definition F5types.h:34
F5_float_t g
Definition F5types.h:34
F5_byte_t b
Definition F5types.h:27
F5_byte_t r
Definition F5types.h:27
F5_byte_t g
Definition F5types.h:27
F5_int16_t a
Definition F5types.h:31
F5_int16_t g
Definition F5types.h:31
F5_int16_t b
Definition F5types.h:31
F5_int16_t r
Definition F5types.h:31
F5_float_t a
Definition F5types.h:35
F5_float_t g
Definition F5types.h:35
F5_float_t r
Definition F5types.h:35
F5_float_t b
Definition F5types.h:35
F5_byte_t a
Definition F5types.h:28
F5_byte_t g
Definition F5types.h:28
F5_byte_t r
Definition F5types.h:28
F5_byte_t b
Definition F5types.h:28