FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
Creating F5Path objects and field representations.

Functions

F5PathF5Rcreate_relative_vertex_Qrefinement3D (hid_t File_id, double time, const char *gridname, const hsize_t current_refinement[3], double target_time, const hsize_t target_refinement[3])
F5PathF5Rcreate_relative_vertex_Irefinement3D (hid_t File_id, double time, const char *gridname, const hsize_t current_refinement[3], double target_time, const hsize_t target_refinement[3])
int F5Rlink_default_vertex_topology (F5Path *grid, const hsize_t target_refinement[3])
F5_API F5PathF5Rcreate_cartesian_3D (hid_t File_id, double time, const char *gridname, const char *coordinate_system)
F5_API F5PathF5Rcreate_cartesian_nD (hid_t File_id, double time, const char *gridname, int Dims, const char *coordinate_system)
F5_API F5PathF5Rcreate_static_cartesian (hid_t File_id, const char *gridname, const char *coordinate_system)
F5_API F5PathF5Rcreate_coordinate_topology (hid_t File_id, const double *time, const char *gridname, const char *coordinate_system, const char *TopologyName, int IndexDepth, int SkeletonDimensionality, int Dimensionality, const hsize_t *refinement)
F5_API F5PathF5Rcreate_triangles_as_vertices_topology (hid_t File_id, double time, const char *gridname)
F5_API F5PathF5Rcreate_edges_as_vertices_topology (hid_t File_id, double time, const char *gridname)
F5_API F5PathF5Rcreate_faces_as_vertices_topology (hid_t File_id, double time, const char *gridname)
F5_API F5PathF5Rcreate_tetrahedrons_as_vertices_topology (hid_t File_id, double time, const char *gridname)
F5_API F5PathF5Rcreate_hexaedrons_as_vertices_topology (hid_t File_id, double time, const char *gridname)
F5_API F5PathF5Rcreate_vertex_refinement3D (hid_t File_id, double time, const char *gridname, const hsize_t refinement[3], const char *coordinate_system)
F5_API void F5Rcreate_downsampling (F5Path *Topology, const hsize_t *downsampling)
F5_API void F5Rcreate_subsampling (F5Path *Topology, const hsize_t *subsampling)
F5_API int F5Rset_timestep (F5Path *path, long timestep)
F5_API long * F5Rget_timestep (F5Path *path, long *timestep)

Detailed Description

These functions create F5Path objects for subsequent usage by F5F field functions. They are created directly from HDF5 id's and native types.

Function Documentation

◆ F5Rcreate_cartesian_3D()

F5_API F5Path * F5Rcreate_cartesian_3D ( hid_t File_id,
double time,
const char * gridname,
const char * coordinate_system )

Create a Field object for a given representation of a grid's vertices in a certain coordinate system for a three-dimensional distribution of vertices, i.e. a 3D grid. Not to be used for surfaces, lines or point clouds - use F5Rcreate_cartesian_nD() for this case.

Returns
A new F5Path pointer. Call F5close() if it is no longer used.

Definition at line 135 of file F5R.c.

138{
139 return F5Rcreate_cartesian_nD(File_id, time,
140 gridname, 3, coordinate_system);
141}
F5Path * F5Rcreate_cartesian_nD(hid_t File_id, double time, const char *gridname, int Dims, const char *coordinate_system)
Definition F5R.c:116

References F5Rcreate_cartesian_nD().

Referenced by F5Rcreate_curvilinear_cartesian3D(), F5Rcreate_rectilinear(), F5Rcreate_uniform_cartesian3D(), F5Rcreate_uniform_cartesian3Dbbox(), F5Rcreate_uniformd(), and F5Rcreate_uniformf().

◆ F5Rcreate_cartesian_nD()

F5_API F5Path * F5Rcreate_cartesian_nD ( hid_t File_id,
double time,
const char * gridname,
int Dims,
const char * coordinate_system )

Create a Field object for a given representation of a grid's vertices in a certain coordinate system, specifying the dimensionality of the grid vertices.

Returns
A new F5Path pointer. Call F5close() if it is no longer used.

Definition at line 116 of file F5R.c.

120{
121F5Path*myPath;
122 F5printf(3, " ---- F5Rcreate_cartesian(T=%g, grid=`%s', coordinates=`%s')",
123 time, gridname, (coordinate_system?coordinate_system:"Default coordinates"));
124
126 myPath = F5Rcreate_coordinate_topology(File_id, &time,
127 gridname,
128 coordinate_system,
130 0, Dims, Dims, 0);
132 return myPath;
133}
#define FIBER_HDF5_POINTS
Definition F5defs.h:55
int F5printf_indent
Definition F5private.c:349
#define F5printf(verbosity,...)
Definition F5private.h:60
F5Path * F5Rcreate_coordinate_topology(hid_t File_id, const double *time, const char *gridname, const char *coordinate_system, const char *TopologyName, int IndexDepth, int SkeletonDimensionality, int Dimensionality, const hsize_t *refinement)
Definition F5R.c:80

References F5printf, F5printf_indent, F5Rcreate_coordinate_topology(), and FIBER_HDF5_POINTS.

Referenced by F5Cwrite_regular_surface(), F5Cwrite_triangular_surface_vc(), F5Flink_triangular_surface(), F5Rcreate_cartesian_3D(), F5Rcreate_uniform_sparse2(), F5write_particle_cartesian3Dv(), F5write_particle_cartesian3DvU(), F5write_particle_double_cartesian3Dv(), F5write_particle_positions(), and saveF5image().

◆ F5Rcreate_coordinate_topology()

F5_API F5Path * F5Rcreate_coordinate_topology ( hid_t File_id,
const double * time,
const char * gridname,
const char * coordinate_system,
const char * TopologyName,
int IndexDepth,
int SkeletonDimensionality,
int Dimensionality,
const hsize_t * refinement )

Create a representation for a specific topological space on the grid in a certain coordinate system. Mostly of internal use.

A convenience function to create a 3D cartesian chart topology. To create topologies in different coordinate systems call F5LTcreate( ... ) directly.

Definition at line 80 of file F5R.c.

87{
88const char*cs = coordinate_system ? coordinate_system : FIBER_HDF5_DEFAULT_CHART;
89ChartDomain_IDs*ChartDomain = (strcmp(cs, FIBER_HDF5_DEFAULT_CHART)==0)
91F5Path*f;
92/*
93 if (ChartDomain == F5B_standard_cartesian_chart3D() )
94 {
95 F5printf(45, "F5Rcreate_coordinate_topology(): Using Std chart.");
96 //assert(ChartDomain->perm_vector == F5_FORTRAN_ORDER);
97 }
98 if (!ChartDomain) F5printf(45, "F5Rcreate_coordinate_topology(): No chart domain.");
99*/
100 f = F5LTcreate(File_id, time,
101 gridname,
102 ChartDomain,
104 cs,
106 IndexDepth,
107 SkeletonDimensionality, Dimensionality,
108 refinement);
109
110 if (f) F5LTmake_enum_type(f);
111
112 return f;
113}
F5_API ChartDomain_IDs * F5B_new_global_cartesian_chart3D()
hid_t F5LTmake_enum_type(F5Path *fpath)
Definition F5LT.c:179
void TopologyName(char *name, int nlength, const hsize_t *level, int Centering, int dims)
Definition F5R.c:300
#define FIBER_HDF5_DEFAULT_CHART
Definition F5defs.h:74
F5Path * F5LTcreate(hid_t File_id, const double *time, const char *gridname, ChartDomain_IDs *ChartDomain, ChartDomain_IDs *coord_creator(), const char *coordinate_system, const char *TopologyName, int IndexDepth, int SkeletonDimensionality, int Dimensionality, const hsize_t *refinement)
Definition F5LT.c:712
ChartDomain_IDs * F5B_standard_cartesian_chart3D()

References F5B_new_global_cartesian_chart3D(), F5B_standard_cartesian_chart3D(), F5LTcreate(), F5LTmake_enum_type(), FIBER_HDF5_DEFAULT_CHART, and TopologyName().

Referenced by F5Rcreate_cartesian_nD(), F5Rcreate_static_cartesian_3D(), and F5Rcreate_vertex_refinement3D().

◆ F5Rcreate_downsampling()

F5_API void F5Rcreate_downsampling ( F5Path * Topology,
const hsize_t * downsampling )

Create a topology suitable for downsampled data, i.e. where the average of another topology's cells are stored. The index depth of the new topology will be one more than that of the original one.

Definition at line 590 of file F5R.c.

591{
592 F5Rcreate_sampling(Topology, downsampling, +1, '@');
593}

◆ F5Rcreate_edges_as_vertices_topology()

F5_API F5Path * F5Rcreate_edges_as_vertices_topology ( hid_t File_id,
double time,
const char * gridname )

Create the default topology of the edges of a grid, as specified by vertices.

Returns
An F5Path object referring to the edges. All subsequent field operations on this F5Path object will refer to fields on the edges.

Definition at line 177 of file F5R.c.

178{
179F5Path*f = F5LTcreate(File_id, &time,
180 gridname,
181 F5B_standard_edge_cells(), /* ChartDomain */
182 F5B_new_global_edge_cells, /* F5B_new_global_cartesian_chart3D*/
185 1, /* IndexDepth */
186 1, /* SkeletonDimensionality */
187 1, /* Dimensionality */
188 0); /* Refinement */
189
190 if (f) F5LTmake_enum_type(f);
191
192 return f;
193}
ChartDomain_IDs * F5B_new_global_edge_cells()
F5_API ChartDomain_IDs * F5B_standard_edge_cells()
#define FIBER_HDF5_EDGES
Definition F5defs.h:58

References F5B_new_global_edge_cells(), F5B_standard_edge_cells(), F5LTcreate(), F5LTmake_enum_type(), FIBER_HDF5_EDGES, and FIBER_HDF5_POINTS.

◆ F5Rcreate_faces_as_vertices_topology()

F5_API F5Path * F5Rcreate_faces_as_vertices_topology ( hid_t File_id,
double time,
const char * gridname )

Create the default topology of the facet of a grid, as specified by vertices.

Returns
An F5Path object referring to the facet. All subsequent field operations on this F5Path object will refer to fields on the facet.

References F5_API, and name.

◆ F5Rcreate_hexaedrons_as_vertices_topology()

F5_API F5Path * F5Rcreate_hexaedrons_as_vertices_topology ( hid_t File_id,
double time,
const char * gridname )

Create the default topology of the cells of a grid as hexahedrons, as specified by vertices. It will be a 3-dimensional grid.

Returns
An F5Path object referring to the hexahedral cells. All subsequent field operations on this F5Path object will refer to fields on the hexahedrons.

Definition at line 233 of file F5R.c.

234{
235F5Path*f = F5LTcreate(File_id, &time,
236 gridname,
237 F5B_standard_hexahedral_cells(), /* ChartDomain */
238 F5B_new_global_hexahedral_cells, /*F5B_new_global_cartesian_chart3D*/
241 1, /* IndexDepth */
242 3, /* int SkeletonDimensionality */
243 3, /* Dimensionality */
244 0); /* refinement */
245
246 if (f) F5LTmake_enum_type(f);
247
248 return f;
249}
ChartDomain_IDs * F5B_new_global_hexahedral_cells()
F5_API ChartDomain_IDs * F5B_standard_hexahedral_cells()
#define FIBER_HDF5_CELLS
Definition F5defs.h:57

References F5B_new_global_hexahedral_cells(), F5B_standard_hexahedral_cells(), F5LTcreate(), F5LTmake_enum_type(), FIBER_HDF5_CELLS, and FIBER_HDF5_POINTS.

◆ F5Rcreate_relative_vertex_Irefinement3D()

F5_API F5Path * F5Rcreate_relative_vertex_Irefinement3D ( hid_t File_id,
double time,
const char * gridname,
const hsize_t current_refinement[3],
double target_time,
const hsize_t target_refinement[3] )

Define refinement by integer numbers. Here, the vertices of the refined objects have to match up exactly with the vertices of the coarse levels. It is only possible to refine entire cells on the coarse grid.

Create a refinement topology whose refined cells fully cover coarse cells. The border vertices line up exactly, i.e. the positions of a subregion may be given in integers of a coarse region.

Definition at line 423 of file F5R.c.

428{
429char CurrentTname[1024];
430char TargetTname[1024];
431F5Path* retval;
432char timename[128];
433char FullTargetTname[2048];
434 assert(current_refinement);
435 assert(target_refinement);
436 TopologyName(CurrentTname, sizeof(CurrentTname), current_refinement, 0,3);
437 TopologyName(TargetTname , sizeof(TargetTname) , target_refinement, 0,3);
438
439 retval = F5LTcreate(File_id, &time,
440 gridname,
441 0,
443 TargetTname, /* representation_name */
444 CurrentTname, /* TopologyName */
445 0, /* IndexDepth */
446 3, /* int SkeletonDimensionality */
447 3, /* Dimensionality */
448 current_refinement); /* const hsize_t*refinement */
449
450
451 F5I_timegroup(&target_time, timename, sizeof(timename) );
452#ifdef _MSC_VER
453 _snprintf
454#else
455 snprintf
456#endif
457 (FullTargetTname, sizeof(FullTargetTname),
458 "/%s/%s/%s",
459 timename, gridname, TargetTname );
460
461/* TODO: Check for existing representer, and if another value exists, create unique one! */
462 F5Glink(retval->Representation_hid, H5G_LINK_SOFT, FullTargetTname, FIBER_HDF5_REPRESENTER);
463
464 return retval;
465}
#define FIBER_HDF5_REPRESENTER
Definition F5defs.h:114
herr_t F5Glink(hid_t loc_id, H5G_link_t link_type, const char *current_name, const char *new_name)
Definition F5private.c:162
F5_API char * F5I_timegroup(const double *time, char *destbuf, size_t len)
Definition F5Bslice.c:90
ChartDomain_IDs * F5B_new_integer_regular_domain3D()
hid_t Representation_hid
Definition F5Path.h:58

References F5B_new_integer_regular_domain3D(), F5Glink(), F5I_timegroup(), F5LTcreate(), FIBER_HDF5_REPRESENTER, F5Path::Representation_hid, and TopologyName().

◆ F5Rcreate_relative_vertex_Qrefinement3D()

F5_API F5Path * F5Rcreate_relative_vertex_Qrefinement3D ( hid_t File_id,
double time,
const char * gridname,
const hsize_t current_refinement[3],
double target_time,
const hsize_t target_refinement[3] )

Define refinement by rational numbers. Here, the vertices of the refined objects may cover fractions of the coarser cells. Still, vertices have to line up exactly and no refined cell may be split by the boundary of a coarser cell.

Create a refinement topology whose refined cells may partially cover coarse cells. The refinement coordinates are given as rational numbers.

Definition at line 369 of file F5R.c.

374{
375char CurrentTname[1024];
376char TargetTname[1024];
377F5Path* retval;
378char timename[128];
379char FullTargetTname[2048];
380 assert(current_refinement);
381 assert(target_refinement);
382 TopologyName(CurrentTname, sizeof(CurrentTname), current_refinement, 0,3);
383 TopologyName(TargetTname , sizeof(TargetTname) , target_refinement, 0,3);
384
385 F5printf(30, "F5Rcreate_relative_vertex_Qrefinement3D()\n");
386 retval = F5LTcreate(File_id, &time,
387 gridname,
388 0,
390 TargetTname, /* representation_name */
391 CurrentTname, /* TopologyName */
392 0, /* IndexDepth */
393 3, /* int SkeletonDimensionality, */
394 3, /* Dimensionality */
395 current_refinement); /* const hsize_t*refinement */
396
397
398 F5printf(30, "F5Rcreate_relative_vertex_Qrefinement3D() - timegroup\n");
399 F5I_timegroup(&target_time, timename, sizeof(timename) );
400#ifdef _MSC_VER
401 _snprintf
402#else
403 snprintf
404#endif
405 (FullTargetTname, sizeof(FullTargetTname),
406 "/%s/%s/%s",
407 timename, gridname, TargetTname );
408
409/* TODO: Check for existing representer, and if another value exists, create unique one! */
410 F5Glink(retval->Representation_hid, H5G_LINK_SOFT, FullTargetTname, FIBER_HDF5_REPRESENTER);
411
412 F5printf(30, "~F5Rcreate_relative_vertex_Qrefinement3D()\n");
413
414 return retval;
415}
ChartDomain_IDs * F5B_new_rational_regular_domain3D()

References F5B_new_rational_regular_domain3D(), F5Glink(), F5I_timegroup(), F5LTcreate(), F5printf, FIBER_HDF5_REPRESENTER, F5Path::Representation_hid, and TopologyName().

◆ F5Rcreate_static_cartesian()

F5_API F5Path * F5Rcreate_static_cartesian ( hid_t File_id,
const char * gridname,
const char * coordinate_system )

Construct a Field object for a representation of a grid's vertices in a certain coordinate system.

Parameters
ChartDomainA coordinate system domain object. It may be NULL to create a new one via the coord_creator parameter locally for this field. If a class of coordinate systems shall be used for multiple grids (which is required to enable interpolation), then a shared ChartDomain object needs to be given. If is reference counted among all grids that use it (taken care of in F5close() ).
coord_creatorA procedure to create a new class of coordinate systems.
coordinate_systemA name for an instance of the coordinate system, i.e. for the current chart object to use.
TopologyNameOn which topological space of the grid to create the coordinate representation (e.g. vertices, cells, edges, refinement level ...)
timeThe time to which the succeeding data will be attached. Use F5Rcreate_static_cartesian() if no time information is reasonable for the given data. Note that static data currently requires special handling when reading data, so it is recommended to adjust any data to a timeslice, except if there is an absolute requirement to specify that these data are constant for all thinkable times.
Returns
A new F5Path pointer. Call F5close() if it is no longer used.

Construct a Field object for a representation of a grid's vertices in a certain coordinate system that is independent from any time information.

Parameters
ChartDomainA coordinate system domain object. It may be NULL to create a new one via the coord_creator parameter locally for this field. If a class of coordinate systems shall be used for multiple grids (which is required to enable interpolation), then a shared ChartDomain object needs to be given. If is reference counted among all grids that use it (taken care of in F5close() ).
coord_creatorA procedure to create a new class of coordinate systems.
coordinate_systemA name for an instance of the coordinate system, i.e. for the current chart object to use.
TopologyNameOn which topological space of the grid to create the coordinate representation (e.g. vertices, cells, edges, refinement level ...)
Returns
A new F5Path pointer. Call F5close() if it is no longer used.

References F5_API, and TopologyName().

◆ F5Rcreate_subsampling()

F5_API void F5Rcreate_subsampling ( F5Path * Topology,
const hsize_t * subsampling )

Create a topology suitable for subsampled data, i.e. where a subset of another topology's cells are stored. Note that the same data can also be retrieved by HDF5 hyperslabbing, but storing an hyperslab as a contigous data set may be helpful for faster data access. The index depth of the new topology will be identical to the original one.

Definition at line 607 of file F5R.c.

608{
609 F5Rcreate_sampling(Topology, subsampling, 0, ':');
610}

◆ F5Rcreate_tetrahedrons_as_vertices_topology()

F5_API F5Path * F5Rcreate_tetrahedrons_as_vertices_topology ( hid_t File_id,
double time,
const char * gridname )

Create the default topology of the cells of a grid as tetrahedra, as specified by vertices. It will be a 3-dimensional grid.

Returns
An F5Path object referring to the cells. All subsequent field operations on this F5Path object will refer to fields on the cells.

Definition at line 214 of file F5R.c.

215{
216F5Path*f = F5LTcreate(File_id, &time,
217 gridname,
218 F5B_standard_tetrahedral_cells(), /* ChartDomain */
219 F5B_new_global_tetrahedral_cells, /*F5B_new_global_cartesian_chart3D*/
222 1, /* IndexDepth*/
223 3, /* int SkeletonDimensionality */
224 3, /* Dimensionality*/
225 0); /* refinement*/
226
227 if (f) F5LTmake_enum_type(f);
228
229 return f;
230}
ChartDomain_IDs * F5B_new_global_tetrahedral_cells()
F5_API ChartDomain_IDs * F5B_standard_tetrahedral_cells()

References F5B_new_global_tetrahedral_cells(), F5B_standard_tetrahedral_cells(), F5LTcreate(), F5LTmake_enum_type(), FIBER_HDF5_CELLS, and FIBER_HDF5_POINTS.

◆ F5Rcreate_triangles_as_vertices_topology()

F5_API F5Path * F5Rcreate_triangles_as_vertices_topology ( hid_t File_id,
double time,
const char * gridname )

Create the default topology of the cells of a grid as triangles, as specified by vertices. It will result in a two-dimensional grid.

Returns
An F5Path object referring to the cells (i.e. triangles). All subsequent field operations on this F5Path object will refer to fields on the triangles.

Definition at line 158 of file F5R.c.

159{
160F5Path*f = F5LTcreate(File_id, &time,
161 gridname,
162 F5B_standard_triangle_cells(), /* ChartDomain */
163 F5B_new_global_triangle_cells, /*F5B_new_global_cartesian_chart3D*/
166 1, /* IndexDepth */
167 2, /* Dimensionality */
168 2,
169 0 ); /* refinement */
170
171 if (f) F5LTmake_enum_type(f);
172
173 return f;
174}
ChartDomain_IDs * F5B_new_global_triangle_cells()
F5_API ChartDomain_IDs * F5B_standard_triangle_cells()
#define FIBER_HDF5_FACES
Definition F5defs.h:60

References F5B_new_global_triangle_cells(), F5B_standard_triangle_cells(), F5LTcreate(), F5LTmake_enum_type(), FIBER_HDF5_FACES, and FIBER_HDF5_POINTS.

Referenced by F5Cwrite_triangular_surface_vc(), and F5Flink_triangular_surface().

◆ F5Rcreate_vertex_refinement3D()

F5_API F5Path * F5Rcreate_vertex_refinement3D ( hid_t File_id,
double time,
const char * gridname,
const hsize_t refinement[3],
const char * coordinate_system )

Create an Field object for vertices of a grid in a certain coordinate system that is intended to store subsampled data of the full grid. Note that this function is intended to store contigous datasets, which can be hyperslabs of other datasets. It can be used as a "cache" for hyperslabbed data such that they require less disc space.

Note
This function only refers to the vertices of a grid. Use the AMR functions for more handling cell, face or edge-related data and/or if refined data only exist on a subset of the full coordinate space.
See also
F5Lwrite_fraction(), Adaptive Hierarchical Meshes
Parameters
refinementThe refinement factor as compared to the finest resolution. It will most likely be a power of two. Note that the coarsest resolution should get the smallest number and the finest resolution (i.e. the complete dataset) the largest number. It is recommended to start counting at zero, given a refinement level, this refinement to be given here will be a power of two given the level number.
Returns
A new F5Path pointer. Call F5close() if it is no longer used.

Definition at line 346 of file F5R.c.

350{
351char Tname[1024];
352 assert(refinement);
353 TopologyName(Tname, sizeof(Tname), refinement, 0,3);
354
355 return F5Rcreate_coordinate_topology(File_id, &time,
356 gridname,
357 coordinate_system,
358 Tname,
359 0, 3, 3, refinement);
360
361}

References F5Rcreate_coordinate_topology(), and TopologyName().

◆ F5Rget_timestep()

F5_API long * F5Rget_timestep ( F5Path * path,
long * timestep )

Get information about the optional integer timestep of an Grid object. All fields per grid object must refer to the same integer timestep. If a Grid object does not provide such timestep information, it may be an interpolated grid that can be computed from others that contain such timestep information. The timestep value by itself is arbitrary, but must be unique among all Grid objects with the same Grid identifier.

Returns
NULL, if no timestep information was found, or the F5Path does not refer to a Grid object.

Definition at line 44 of file F5R.c.

45{
46hid_t attr_id,
47 space_id;
48
49 if (!path || path->Grid_hid<0 || !timestep)
50 {
51 F5printf(1,"F5Rget_timestep(): got invalid grid or parameter.");
52 return NULL;
53 }
54
55 H5E_BEGIN_TRY
57 H5E_END_TRY
58
59 if (attr_id<0)
60 return NULL;
61
62 space_id = H5Aget_space(attr_id);
63 assert( space_id >0);;
64 if (H5Sget_simple_extent_npoints(space_id) != 1)
65 return NULL;
66
67 F_H5Aread(attr_id, H5T_NATIVE_LONG, timestep, FIBER_HDF5_TIMESTEP_ATTRIB);
68
69 H5Aclose(attr_id);
70 H5Sclose(space_id);
71
72 return timestep;
73}
#define FIBER_HDF5_TIMESTEP_ATTRIB
Definition F5defs.h:53
herr_t F_H5Aread(hid_t attr_id, hid_t mem_type_id, void *buf, const char *name)
Definition F5private.c:332
hid_t F5Aopen_name(hid_t location, const char *name)
Definition F5A.c:34
hid_t Grid_hid
Definition F5Path.h:53

References F5Aopen_name(), F5printf, F_H5Aread(), FIBER_HDF5_TIMESTEP_ATTRIB, and F5Path::Grid_hid.

Referenced by F5Rset_timestep().

◆ F5Rlink_default_vertex_topology()

F5_API int F5Rlink_default_vertex_topology ( F5Path * grid,
const hsize_t target_refinement[3] )

Treat some refinement level as the default level for refinement-unaware readers.

Creates a symbolic link from some refinement level on vertices to appear as the default points topology.

Parameters
gridA valid F5Path object pointing to some grid.
target_refinementThe refinement level that shall be visible as default.
Note
Currently only 3D refinements are supported.
If a point topology already exists, it will not be touched.

Create a symbolic links from some vertex refinement topology group to the default group "Points".

Returns
non-zero in case of errors, like invalid arguments.
Parameters
gridPointer to an F5Path object. It must contain a valid Grid_id identifiert.
Todo
Check for an eventually existing "Points" group and handle HDF5 error codes.

Definition at line 478 of file F5R.c.

480{
481char TargetTname[1024];
482 if (!grid) return -1;
483 if (grid->Grid_hid<1) return -2;
484 if (!target_refinement) return -3;
485 TopologyName(TargetTname, sizeof(TargetTname), target_refinement, 0,3);
486 {
487 F5Glink(grid->Grid_hid, H5G_LINK_SOFT, TargetTname, FIBER_HDF5_POINTS);
488 }
489 return 0;
490}

References F5Glink(), FIBER_HDF5_POINTS, F5Path::Grid_hid, and TopologyName().

◆ F5Rset_timestep()

F5_API int F5Rset_timestep ( F5Path * path,
long timestep )

Set information about an integer timestep (per Grid object!) This is an recommended attribute for data originating from subsequent simulations. It may be omitted on interpolated grid objects to specify that these are secondary data that can be reproduced from grids with Timestep information.

Returns
non-zero if the timestep could be set, and zero (false) if the grid object in charge already has a timestep attached with it but is inconsistent with the specified one.

Definition at line 10 of file F5R.c.

11{
12hid_t attr_id,
13 space_id;
14long have_timestep;
15
16 if (!path || path->Grid_hid<0)
17 {
18 F5printf(1,"F5Rset_timestep(,%ld): got invalid grid", timestep);
19 return 0;
20 }
21 if (F5Rget_timestep(path, &have_timestep) )
22 {
23 if (have_timestep==timestep)
24 return 1;
25
26 F5printf(1,"F5Rset_timestep(%ld): invalid timestep specified, "
27 "grid is already bound to %ld!", timestep, have_timestep);
28 return 0;
29 }
30
31 space_id= H5Screate(H5S_SCALAR);
32
33 attr_id = H5Acreate2(path->Grid_hid,
34 FIBER_HDF5_TIMESTEP_ATTRIB, H5T_NATIVE_LONG, space_id,
35 H5P_DEFAULT, H5P_DEFAULT);
36
37 H5Awrite(attr_id, H5T_NATIVE_LONG, &timestep);
38
39 H5Aclose(attr_id);
40 H5Sclose(space_id);
41 return 1;
42}
long * F5Rget_timestep(F5Path *path, long *timestep)
Definition F5R.c:44

References F5printf, F5Rget_timestep(), FIBER_HDF5_TIMESTEP_ATTRIB, and F5Path::Grid_hid.