FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
F5Bchart.h
Go to the documentation of this file.
1/*
2 $Id: F5Bchart.h,v 1.23 2008/03/19 21:21:43 werner Exp $
3*/
4
5#ifndef __F5_F5Bchart_H
6#define __F5_F5Bchart_H
7
8#include "hdf5inc.h"
9#include "F5defs.h"
10#include "F5types.h"
11
12#include "F5WinDLLApi.h"
13
14#ifdef __cplusplus
15extern "C"
16{
17#endif
18
19enum
20{
21 /** number of additional file types in ChartPrecisions */
23};
24
25
26/**
27 A structure containing a set of commonly used
28 types per chart, notation according to geometric
29 algebra and differential geometry.
30 @relates F5Bchart_add_tangential_types()
31
32Constructor:void F5Bchart_init_tangential_types(F5_ChartPrecisionTypes*IDs,
33 const char*coordnames[],
34 int dimension,
35 hid_t coord_type);
36
37Destructor: void F5B_delete_tangential_types(F5_ChartPrecisionTypes*IDs);
38
39 */
41{
42 /** HDF5 type ID for points */
44
45 /** HDF5 type ID for directions (tangential vectors) */
47
48 /** HDF5 type ID for covectors */
50
51 /** HDF5 type ID for bivectors */
53
54 /** HDF5 type ID for bicovectors */
56
58
60
62
64
65 /**
66 Additional file types that may be stored here.
67 */
69};
70
72
73/**
74 Initializes the Poind_hit_t with some newly constructed
75 transient HDF5 type while setting all other entries to 0.
76 */
78 const char*coordnames[],
79 int dimension,
80 hid_t coord_type);
81
82
84 const char*coordnames[],
85 int dimension,
86 hid_t coord_type);
87
88/**
89 Add a type ID to the additional file types, ready to
90 be deleted by F5B_delete_tangential_types(F5_ChartPrecisionTypes*IDs);
91 */
93 hid_t type_id);
94
95/**
96 Destructor for F5_ChartPrecisionTypes.
97 */
99
101 hid_t location);
102
103
104/**
105 Description of a class of coordinate systems,
106 i.e. coordinate system that are allowed to share
107 their positional types.
108 */
109typedef struct
110{
111 /** name for this class of coordinate systems (e.g. cartesian 3D, polar 2D, ...) */
112 const char*domain_name;
113
114 unsigned refs; /**< reference counter */
115
116 /**
117 Each type of coordinate system is associated with a certain
118 ordering of multidimensional data.
119 This is the place to specify whether FORTRAN or C order is used
120 for multidimensional arrays.
121 @note The predefined F5 coordinate systems use FORTRAN order for
122 compatibility with
123 - numerical simulation programs, which are mostly written in FORTRAN
124 - OpenGL, where the lowest dimension (x) runs fastest
125 - the Amira visualization system
126 - the canonical indexing of images, where the lowest dimension x runs
127 faster than y
128 This convention is reversed as compared to a native definition of a
129 matrix using C arrays of the form
130 <PRE>
131 float matrix[X][Y];
132 </PRE>
133 Here, the dimension Y would run faster in memory than X.
134 If data are stored in this layout (C order), they have to be put
135 into another coordinate system within the context of F5.
136 Different indexing layouts can be mapped onto each other like
137 a coordinate transformation rule. Such a mapping might be
138 straightforward, but involves some computation (which is similar
139 to true coordinate transformations).
140 */
143
145 OneBytePrecision, /**< 1 Byte, 8 bit */
146 HalfPrecision, /**< 2 Byte, 16 bit */
147 SinglePrecision, /**< 4 Byte, 32 bit */
148 DoublePrecision, /**< 8 Byte, 64 bit */
149 ExtendedPrecision; /**< 16 Byte, 128 bit */
150
151 /**
152 Array of pointers to tensor type descriptions.
153 Terminated by NULL pointer;
154 */
156
157}
159
160
163
164/**@ingroup F5B
165 Given the size of some type in byte, yield the appropriate
166 precision type structur from a chart domain.
167 The function will fail if the TypeSize is anything but 1,2,4,8 or 16.
168 */
170
171/**@ingroup F5B
172 Given some compound type, yield the precision type corresponding to the
173 compound type's first member.
174 The function will fail if the provided type is not a compound type.
175 */
177
178
179/**
180 Prototype of a function creating a new class of coordinate systems.
181 (Chart domain constructor).
182 */
183typedef ChartDomain_IDs*(*new_global_chart_f)();
184
185/**\ingroup F5B
186 Construct a new domain type.
187 A domain type specifies how points from one topology are mapped onto
188 another one. It is a subset of a chart, in that it defines the
189 basic mapping from points onto another, but no tangential types
190 like vectors.
191@TODO Add complementary cleanup function.
192 */
193F5_API ChartDomain_IDs*F5B_new_global_domain(const char*coordnames[],
194 int dimension,
195 const char*name,
196 const int perm_vector[],
197 int cell_dimensionality,
198 hid_t SinglePrecisionType,
199 hid_t DoublePrecisionType
200 );
201
202
203/**\ingroup F5B
204 Construct a new coordinate type.
205 @param coordnames Array of names for each coordinate.
206 @param dimension Dimensionality of this coordinate system.
207 @param name Some naming for all instances of this coordinate systems.
208 @todo Reorder argument list.
209 @TODO Add complementary cleanup function.
210
211 Creates a chart with floating point types.
212
213 Only the creation of homogeneous coordinates is supported
214 through this interface.
215*/
217 int dimension,
218 const char*name,
219 const int perm_vector[FIBER_MAX_RANK] );
220
221F5_API ChartDomain_IDs*F5B_new_global_int_chart(const char*coordnames[],
222 int dimension,
223 const char*name,
224 const int perm_vector[FIBER_MAX_RANK]);
225
226/**
227 Create a domain with positions in n-dimensional integer coordinates,
228 where 32bit and 64bit are available ( H5T_NATIVE_B32 and H5T_NATIVE_B64
229 in HDF5.)
230 */
231F5_API ChartDomain_IDs*F5B_new_global_int_domain(const char*coordnames[],
232 int dimension,
233 const char*name,
234 const int perm_vector[FIBER_MAX_RANK],
235 int cell_dimensionality);
236
238 int dimension,
239 const char*name,
240 const int perm_vector[],
241 int cell_dimensionality);
242
243
244/*F5_API ChartDomain_IDs*F5Bcopy_chart(ChartDomain_IDs*oldchart, const char*newname); */
245
246/**
247 Make a copy of a coordinate domain. All types are created from the
248 existing information as if it were created from scratch.
249 This function may be used to convert named data types into
250 transient types. This is e.g. useful when reading a file.
251@TODO Add complementary cleanup function.
252 */
254
255
256/**
257 Get the dimensionality of this chart.
258 This information is taken from the number of elements of
259 the associated point type.
260 */
262
263#ifdef __cplusplus
264#define F5_FORTRAN_ORDER reinterpret_cast<int*>(0)
265#define F5_C_ORDER reinterpret_cast<int*>(-1)
266#else
267#define F5_FORTRAN_ORDER ((int*)(0))
268#define F5_C_ORDER ((int*)(-1))
269#endif
270
271/**
272 Permute a given dimensions array according to the given permutation vector.
273 @param source_dims The source dimensions.
274 @param target_dims The target dimensions array, may be identical to the source
275 dimensions array.
276 @return A pointer to the target dimensions array.
277
278 @param perm_vector The permutation vector, may be F5_FORTRAN_ORDER, F5_C_ORDER
279 or an explicity integer array specifying an arbitrary reodering
280 of indices.
281
282 @see F5B_fortran_permute_vector()
283
284 @todo Make the define F5_FORTRAN_ORDER identical to the return value of
285 F5B_fortran_permute_vector(). This is a possible optimization, currently there
286 are two equivalent ways of specifying FORTRAN ordering.
287 */
288F5_API hsize_t*F5B_permute_dimensions(hsize_t*target_dims,
289 int rank,
290 const hsize_t*source_dims,
291 int perm_vector[FIBER_MAX_RANK],
292 int perm_vector_size);
293
294/**
295 Return a (static) permutation vector for fortran memory layout.
296 It always has FIBER_MAX_RANK entries, i.e. is of the form
297 { FIBER_MAX_RANK-1, FIBER_MAX_RANK-2, ..., 2,1,0 }
298 */
300
301/**
302 Free the memory resources that are associated with a certain
303 coordinate system.
304*/
306
308
310F5_API ChartDomain_IDs*F5B_read_global_chart(hid_t ChartsID, const char*name);
311
312F5_API ChartDomain_IDs*F5B_read_chart_domain(hid_t ChartDomainLocationID, const char*DefaultChartName);
313
315
316#ifdef __cplusplus
317} /* extern "C" */
318#endif
319
320#endif /* __F5_F5Bchart_H */
321
F5_API ChartDomain_IDs * F5Bcopy_chart_domain(const ChartDomain_IDs *IDs)
Definition F5Bchart.c:851
F5_API hsize_t * F5B_permute_dimensions(hsize_t *target_dims, int rank, const hsize_t *source_dims, int perm_vector[FIBER_MAX_RANK], int perm_vector_size)
Definition F5Bchart.c:72
F5_API void F5B_delete_global_chart(ChartDomain_IDs *ID)
Definition F5Bchart.c:632
F5_API ChartDomain_IDs * F5B_read_chart_domain(hid_t ChartDomainLocationID, const char *DefaultChartName)
Definition F5Bchart.c:720
F5_API void F5Bt_add_tangential_types(F5_ChartPrecisionTypes *H5Types, const char *coordnames[], int dimension, hid_t coord_type)
F5_API ChartDomain_IDs * F5B_read_global_chart(hid_t ChartsID, const char *name)
Definition F5Bchart.c:696
F5_API F5_ChartPrecisionTypes * F5Bget_precision_by_size(ChartDomain_IDs *CD, int TypeSize)
Definition F5Bchart.c:916
F5_API ChartDomain_IDs * F5B_save_global_chart(const ChartDomain_IDs *IDs, hid_t Domain_hid)
Definition F5Bchart.c:801
F5_API ChartDomain_IDs * F5B_new_global_float_chart(const char *coordnames[], int dimension, const char *name, const int perm_vector[FIBER_MAX_RANK])
Definition F5Bchart.c:496
F5_API int F5Bget_chart_dims(const ChartDomain_IDs *IDs)
Definition F5Bchart.c:899
F5_API void F5B_delete_tangential_types(F5_ChartPrecisionTypes *IDs)
Definition F5Bchart.c:610
F5_API ChartDomain_IDs * F5B_new_global_cartesian_chart3D()
F5_API void F5Bchart_read_tangential_types(F5_ChartPrecisionTypes *H5Types, hid_t location)
Definition F5Bchart.c:674
F5_API void F5Bincrement_domain_refs(ChartDomain_IDs *ChartDomain)
Definition F5B.c:68
F5_API const int * F5B_fortran_permute_vector()
Definition F5Bchart.c:36
F5_API void F5B_init_tangential_types(F5_ChartPrecisionTypes *H5Types, const char *coordnames[], int dimension, hid_t coord_type)
Definition F5Bchart.c:290
F5_API int F5B_inject_precision_type(F5_ChartPrecisionTypes *IDs, hid_t type_id)
Definition F5Bchart.c:477
struct _F5_ChartPrecisionTypes F5_ChartPrecisionTypes
Definition F5Bchart.h:71
F5_API F5Ttensor_t * F5Bget_tensor_type_byname(ChartDomain_IDs *CD, const char *name)
F5_API void F5Binsert_tensor_type(ChartDomain_IDs *CD, F5Ttensor_t *)
Definition F5Bchart.c:588
F5_API ChartDomain_IDs * F5B_new_global_domain(const char *coordnames[], int dimension, const char *name, const int perm_vector[], int cell_dimensionality, hid_t SinglePrecisionType, hid_t DoublePrecisionType)
Definition F5Bchart.c:212
@ F5ChartPrecisionMaxNumberOfFileTypes
Definition F5Bchart.h:22
F5_API ChartDomain_IDs * F5B_new_global_int_domain(const char *coordnames[], int dimension, const char *name, const int perm_vector[FIBER_MAX_RANK], int cell_dimensionality)
Definition F5Bchart.c:529
F5_API ChartDomain_IDs * F5B_new_global_int_chart(const char *coordnames[], int dimension, const char *name, const int perm_vector[FIBER_MAX_RANK])
Definition F5Bchart.c:514
F5_API F5_ChartPrecisionTypes * F5Bget_precision_by_type(ChartDomain_IDs *CD, hid_t type_id)
Definition F5Bchart.c:931
F5_API ChartDomain_IDs * F5B_new_global_fractional_domain(const char *coordnames[], int dimension, const char *name, const int perm_vector[], int cell_dimensionality)
Definition F5Bchart.c:571
name
Definition F5P.c:82
#define F5_API
Definition F5WinDLLApi.h:11
#define FIBER_MAX_RANK
Definition F5defs.h:105
F5_ChartPrecisionTypes DoublePrecision
Definition F5Bchart.h:148
int cell_dimensionality
Definition F5Bchart.h:142
F5_ChartPrecisionTypes HalfPrecision
Definition F5Bchart.h:146
int perm_vector[FIBER_MAX_RANK]
Definition F5Bchart.h:141
const char * domain_name
Definition F5Bchart.h:112
F5_ChartPrecisionTypes SinglePrecision
Definition F5Bchart.h:147
F5_ChartPrecisionTypes OneBytePrecision
Definition F5Bchart.h:145
F5_ChartPrecisionTypes ExtendedPrecision
Definition F5Bchart.h:149
F5Ttensor_t ** TensorTypes
Definition F5Bchart.h:155
unsigned refs
Definition F5Bchart.h:114
hid_t AdditionalFileTypes[F5ChartPrecisionMaxNumberOfFileTypes]
Definition F5Bchart.h:68