FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
Uniform Grids

Functions

F5_API F5PathF5Rcreate_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 F5PathF5Rcreate_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)
F5_API F5PathF5Rcreate_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)
F5_API F5PathF5Fwrite_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)
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,...)
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,...)
F5_API F5PathF5Fwrite_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)
F5_API F5PathF5Rcreate_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)
F5_API F5PathF5Rcreate_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)

Detailed Description

Function Documentation

◆ F5Fwrite_uniform_cartesian3D()

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 )

Write a data field given on uniform cartesian grid into file.

@param coordinate_system The coordinate system.
            May be NULL to refer to a standard chart.
Returns
A new F5Path pointer. Call F5close() if it is no longer used.

Definition at line 271 of file F5uniform.c.

280{
281F5Path*f = F5Rcreate_uniform_cartesian3D(file_id, time,
282 gridname,
283 origin,
284 spacing,
285 dims,
286 coordinate_system);
287 /* write the data into the dataset */
288
289 if ( F5Fwrite(f, fieldname, 3, dims, fieldtype, 0, dataPtr, prop_id) != F5_SUCCESS)
290 {
291 F5close(f);
292 return NULL;
293 }
294 F5Cset (f, fieldname, FIBER_REGULAR_GRID_URL "StandardCartesian/Uniform/VertexCentered");
295
296 return f;
297}
F5_API int F5Cset(F5Path *fpath, const char *fieldname, const char *content_type)
@ F5_SUCCESS
Definition F5F.h:226
#define FIBER_REGULAR_GRID_URL
Definition F5uniform.h:133
F5ErrorCode F5Fwrite(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id)
Definition F5F.c:467
void F5close(F5Path *f)
Definition F5B.c:186
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

References F5_SUCCESS, F5close(), F5Cset(), F5Fwrite(), F5Rcreate_uniform_cartesian3D(), and FIBER_REGULAR_GRID_URL.

◆ F5Fwrite_uniform_cartesian3Ds()

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 )

Write a data field given on uniform cartesian grid for a given coordinate system into file. If the data is a compound data type, then it is given as distinct homogeneous arrays in memory.

Parameters
coordinate_systemThe coordinate system. May be NULL to refer to a standard chart.
Returns
A new F5Path pointer. Call F5close() if it is no longer used.

Definition at line 301 of file F5uniform.c.

311{
312F5Path*f = F5Rcreate_uniform_cartesian3D(file_id, time,
313 gridname,
314 origin,
315 spacing,
316 dims,
317 coordinate_system);
318
319 /* write the data into the dataset */
320
321 if (! F5Fwrites(f, fieldname, 3, dims, fieldtype, 0, dataPtr, property_id) )
322 {
323 F5close(f);
324 return NULL;
325 }
326 return f;
327}
F5_API int F5Fwrites(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void **dataPtr, hid_t property_id)
Definition F5F.c:690

References F5close(), F5Fwrites(), and F5Rcreate_uniform_cartesian3D().

◆ F5Rcreate_uniform()

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 )

Create a regular grid which is uniform in the specified coordinate system.

Parameters
originThe origin of the grid, must be of the coordinate type that is associated with the coordinate system.
spacingThe distance among neighboring points of the grid, must be of the vector type of the coordinate system, i.e. the coordinate type that stores coordinate differences.
coordinate_systemThe coordinate system. May be NULL to refer to the standard cartesian chart.
Returns
A new F5Path pointer. Call F5close() if it is no longer used.

References F5_API.

◆ F5Rcreate_uniform_cartesian3D()

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 )

Create a regular three-dimensional grid which is uniform in the specified coordinate system.

Parameters
coordinate_systemThe coordinate system. May be NULL to refer to a standard chart.
Returns
A new F5Path pointer. Call F5close() if it is no longer used.

Definition at line 73 of file F5uniform.c.

79{
80F5Path*f = F5Rcreate_cartesian_3D(File_id, time, gridname, coordinate_system);
81F5_vec3_point_t end, center;
82
83 F5Cset (f, FIBER_HDF5_POSITIONS_STRING, FIBER_REGULAR_GRID_URL "StandardCartesian/Uniform/");
85 3, dims, F5T_COORD3_FLOAT, origin, spacing);
86
87 end.x = origin->x + spacing->x*(dims[0]-1);
88 end.y = origin->y + spacing->y*(dims[1]-1);
89 end.z = origin->z + spacing->z*(dims[2]-1);
90
91 center.x = 0.5*(origin->x + end.x);
92 center.y = 0.5*(origin->y + end.y);
93 center.z = 0.5*(origin->z + end.z);
94
95
96 {F5_vec3_point_t minmax[2];
97 minmax[0].x = origin->x; minmax[0].y = origin->y; minmax[0].z = origin->z;
98 minmax[1].x = end.x; minmax[1].y = end.y; minmax[1].z = end.z;
99
100 F5Fset_range(f, NULL, minmax);
101 }
102
103 F5Fset_average(f, NULL, &center);
104
105 F5Fclose(f);
106
107 return f;
108}
F5_API int F5Fset_range(F5Path *f, const char *fragment_name, const void *minmax)
Definition F5F.c:1737
F5_API int F5Fset_average(F5Path *f, const char *fragment_name, const void *avg)
Definition F5Fmeta.c:808
F5_point3f_t F5_vec3_point_t
#define F5T_COORD3_FLOAT
#define FIBER_HDF5_POSITIONS_STRING
Definition F5defs.h:63
F5_API int F5Fwrite_linear(F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, const void *base, const void *delta)
Definition F5F.c:1464
void F5Fclose(F5Path *f)
Definition F5F.c:92
F5Path * F5Rcreate_cartesian_3D(hid_t File_id, double time, const char *gridname, const char *coordinate_system)
Definition F5R.c:135

References F5Cset(), F5Fclose(), F5Fset_average(), F5Fset_range(), F5Fwrite_linear(), F5Rcreate_cartesian_3D(), F5T_COORD3_FLOAT, FIBER_HDF5_POSITIONS_STRING, FIBER_REGULAR_GRID_URL, F5_point3_float_t::x, F5_vec3_float_t::x, F5_point3_float_t::y, F5_vec3_float_t::y, F5_point3_float_t::z, and F5_vec3_float_t::z.

Referenced by F5Fwrite_uniform_cartesian3D(), F5Fwrite_uniform_cartesian3Ds(), F5Rcreate_uniform_sparse(), F5write_uniform_cartesian3Dv(), and F5write_uniform_cartesian3Dvs().

◆ F5Rcreate_uniform_cartesian3Dbbox()

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 at line 110 of file F5uniform.c.

116{
117F5Path*f = F5Rcreate_cartesian_3D(File_id, time, gridname, coordinate_system);
118F5_vec3_float_t spacing;
119F5_vec3_point_t center;
120
121 F5Cset (f, FIBER_HDF5_POSITIONS_STRING, FIBER_REGULAR_GRID_URL "StandardCartesian/Uniform/");
122
123 spacing.x = (end->x - start->x) / (dims[0]-1);
124 spacing.y = (end->y - start->y) / (dims[1]-1);
125 spacing.z = (end->z - start->z) / (dims[2]-1);
126
127 center.x = 0.5*(start->x + end->x);
128 center.y = 0.5*(start->y + end->y);
129 center.z = 0.5*(start->z + end->z);
130
132 3, dims, F5T_COORD3_FLOAT, start, &spacing);
133
134 {
135 F5_vec3_point_t minmax[2];
136 minmax[0].x = start->x; minmax[0].y = start->y; minmax[0].z = start->z;
137 minmax[1].x = end->x; minmax[1].y = end->y; minmax[1].z = end->z;
138 F5Fset_range(f, NULL, minmax);
139 }
140 F5Fset_average(f, NULL, &center);
141
142 F5Fclose(f);
143
144 return f;
145}

References F5Cset(), F5Fclose(), F5Fset_average(), F5Fset_range(), F5Fwrite_linear(), F5Rcreate_cartesian_3D(), F5T_COORD3_FLOAT, FIBER_HDF5_POSITIONS_STRING, FIBER_REGULAR_GRID_URL, F5_point3_float_t::x, F5_vec3_float_t::x, F5_point3_float_t::y, F5_vec3_float_t::y, F5_point3_float_t::z, and F5_vec3_float_t::z.

◆ F5Rcreate_uniform_sparse()

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 at line 545 of file F5uniform.c.

554{
555F5Path*f = F5Rcreate_uniform_cartesian3D(file_id, time,
556 gridname,
557 (const F5_point3_float_t*)origin,
558 (const F5_vec3_float_t*)spacing,
559 dims,
560 coordinate_system);
561
562 /* write the data into the dataset, todo: code-review, how to handle rank? 3 vs 1 */
564 1, &sparse_size,
565 F5file_type(f, H5T_NATIVE_HSIZE), H5T_NATIVE_HSIZE, sparse_idx_Ptr,
567 property_id);
568
569 /*
570 // if (! F5Fwrite(f, FIBER_HDF5_SPARSE, 1, &sparse_size, H5T_NATIVE_HSIZE, 0, sparse_idx_Ptr, property_id) )
571 //{
572 // F5close(f);
573 // return NULL;
574 //}
575 */
576 return f;
577}
hid_t F5file_type(F5Path *fpath, hid_t fieldtype)
Definition F5Bchart.c:941
hid_t F5LTmake_enum_type(F5Path *fpath)
Definition F5LT.c:179
#define FIBER_HDF5_SPARSE
Definition F5defs.h:65
hid_t F5Lwrite(hid_t R_id, const char *fieldname, int dimension, const hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t enum_type, hid_t dcpl_id)
Definition F5L.c:357
hid_t Representation_hid
Definition F5Path.h:58
hid_t Field_hid
Definition F5Path.h:59

References Dims::dims, F5_API, F5file_type(), F5LTmake_enum_type(), F5Lwrite(), F5Rcreate_uniform_cartesian3D(), FIBER_HDF5_SPARSE, F5Path::Field_hid, and F5Path::Representation_hid.

◆ F5Rcreate_uniform_sparse2()

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 at line 579 of file F5uniform.c.

588{
589F5Path*f = F5Rcreate_cartesian_nD(file_id, time,
590 gridname, 1, coordinate_system);
591
592 if (! F5Fwrite(f, FIBER_HDF5_SPARSE, 1, &sparse_size, H5T_NATIVE_HSIZE, 0, sparse_idx_Ptr, property_id) )
593 {
594 // F5close(f);
595 // return NULL;
596 }
597
598 assert( F5Fset_attribute( f, FIBER_UNIFORMARRAY_BASE_ATTRIBUTE, origin, 3, H5T_NATIVE_DOUBLE, 0 ) );
599 assert( F5Fset_attribute( f, FIBER_UNIFORMARRAY_DELTA_ATTRIBUTE, spacing, 3, H5T_NATIVE_DOUBLE, 0 ) );
600 assert( F5Fset_attribute( f, FIBER_UNIFORMARRAY_ELEMENTS_ATTRIBUTE, dims, 3, H5T_NATIVE_HSIZE, 0 ) );
601
602 return f;
603}
F5_API int F5Fset_attribute(F5Path *f, const char *attribute_name, const void *data, hsize_t N, hid_t mem_type_id, int force)
Definition F5Fmeta.c:216
#define FIBER_UNIFORMARRAY_DELTA_ATTRIBUTE
Definition F5defs.h:159
#define FIBER_UNIFORMARRAY_ELEMENTS_ATTRIBUTE
Definition F5defs.h:157
#define FIBER_UNIFORMARRAY_BASE_ATTRIBUTE
Definition F5defs.h:158
F5Path * F5Rcreate_cartesian_nD(hid_t File_id, double time, const char *gridname, int Dims, const char *coordinate_system)
Definition F5R.c:116

References Dims::dims, F5_API, F5Fset_attribute(), F5Fwrite(), F5Rcreate_cartesian_nD(), FIBER_HDF5_SPARSE, FIBER_UNIFORMARRAY_BASE_ATTRIBUTE, FIBER_UNIFORMARRAY_DELTA_ATTRIBUTE, and FIBER_UNIFORMARRAY_ELEMENTS_ATTRIBUTE.

◆ F5write_uniform_cartesian3Dv()

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,
... )

Write a bunch of data fields given on the same uniform cartesian grid. This variation of the uniform grid writer function uses a variable number of arguments list. Each field is defined by a triple of

  const char *fieldname
  hid_t fieldtype
  const void  *dataPtr

If either the fieldname or the dataPtr are NULL, then the traversal of the argument is terminated.

Parameters
coordinate_systemThe coordinate system. May be NULL to refer to a standard chart.
Returns
The number of successfully written fields.

Definition at line 332 of file F5uniform.c.

340{
341 const char* fieldname;
342 hid_t fieldtype;
343 const void* dataPtr;
344 va_list vl;
345 int NumOfWrittenFields = 0;
346
347 /* Create the Field */
348 F5Path* f = F5Rcreate_uniform_cartesian3D(file_id, time,
349 gridname,
350 origin,
351 spacing,
352 dims,
353 coordinate_system);
354
355 /* Init the step through the argument list */
356 va_start(vl, property_id);
357
358 /* Step through the argument list */
359 for(;;)
360 {
361 /* Get the Name of the field */
362 fieldname = va_arg(vl, const char*);
363 /* Get the type of the field */
364 fieldtype = va_arg(vl, hid_t);
365 /* Get the pointer to the field */
366 dataPtr = va_arg(vl, const void*);
367
368 /* Break? */
369 if ( (fieldname == NULL) || (dataPtr == NULL) )
370 break;
371
372 /* Write the stuff */
373 F5Fwrite(f, fieldname, 3, dims, fieldtype, 0, dataPtr, property_id);
374 NumOfWrittenFields++;
375 }
376
377 /* Close the Step through */
378 va_end(vl);
379
380 /* Close the field */
381 F5close(f);
382
383 return NumOfWrittenFields;
384}

References F5close(), F5Fwrite(), and F5Rcreate_uniform_cartesian3D().

◆ F5write_uniform_cartesian3Dvs()

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,
... )

Write a bunch of data fields given on the same uniform cartesian grid. This variation of the uniform grid writer function uses a variable number of arguments list. Each field is defined by a triple of

  const char *fieldname
  hid_t fieldtype
  const void **dataPtr

If either the fieldname or the dataPtr are NULL, then the traversal of the argument is terminated.

Parameters
coordinate_systemThe coordinate system. May be NULL to refer to a standard chart.
Returns
The number of successfully written fields.

Definition at line 388 of file F5uniform.c.

396{
397 const char* fieldname;
398 hid_t fieldtype;
399 const void** dataPtr;
400 va_list vl;
401 int NumOfWrittenFields = 0;
402
403 /* Create the Field */
404 F5Path* f = F5Rcreate_uniform_cartesian3D(file_id, time,
405 gridname,
406 origin,
407 spacing,
408 dims,
409 coordinate_system);
410
411 /* Init the step through the argument list */
412 va_start(vl, property_id);
413
414 /* Step through the argument list */
415 for(;;)
416 {
417 /* Get the Name of the field */
418 fieldname = va_arg(vl, const char*);
419 /* Get the type of the field */
420 fieldtype = va_arg(vl, hid_t);
421 /* Get the pointer to the field */
422 dataPtr = va_arg(vl, const void**);
423
424 /* Break? */
425 if ( (fieldname == NULL) || (dataPtr == NULL) )
426 break;
427
428 /* Write the stuff */
429 F5Fwrites(f, fieldname, 3, dims, fieldtype, 0, dataPtr, property_id);
430 NumOfWrittenFields++;
431 }
432
433 /* Close the Step through */
434 va_end(vl);
435
436 /* Close the field */
437 F5close(f);
438
439 return NumOfWrittenFields;
440}

References F5close(), F5Fwrites(), and F5Rcreate_uniform_cartesian3D().