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

Data Structures

struct  F5Vertices_and_Connectivity

Typedefs

typedef struct F5Vertices_and_Connectivity F5Vertices_and_Connectivity_t

Functions

F5_API void F5closeVC (F5Vertices_and_Connectivity_t *)
F5_API F5PathF5write_triangular_surface (hid_t file_id, double time, const char *name, const F5_point3f_t *Coords, int nCoords, const F5_triangle32_t *Triangles, int nTriangles)
F5_API F5PathF5Cwrite_triangular_surface (hid_t file_id, double time, const char *name, const F5_point3f_t *Coords, int nCoords, const F5_triangle32_t *Triangles, int nTriangles, const char *coordinate_system)
F5_API F5PathF5Flink_triangular_surface (F5Path *target, double time, const char *gridname, const F5_point3f_t *Coords, int nCoords, const F5_triangle_t *Triangles, int nTriangles, const char *coordinate_system)
F5_API void F5write_triangular_surface_vertex_vectors (hid_t file_id, double time, const char *name, const F5_point3f_t *Coords, int nCoords, const F5_triangle_t *Triangles, int nTriangles, const char *fieldname, const F5_vec3_float_t *VertexNormals)
F5_API void F5write_triangular_surface_cell_vectors (hid_t file_id, double time, const char *name, const F5_vec3_point_t *Coords, int nCoords, const F5_triangle_t *Triangles, int nTriangles, const char *fieldname, const F5_vec3_float_t *CellNormals)
F5_API void F5write_regular_surface (hid_t file_id, double time, const char *name, const F5_vec3_point_t *Coords, int Xdims, int Ydims)
F5_API void F5write_regular_surface_vertex_field_rgb (hid_t file_id, double time, const char *name, const F5_vec3_point_t *Coords, int Xdims, int Ydims, const char *fieldname, F5_rgb_t *data)
F5_API void F5Cwrite_regular_surface (hid_t file_id, double time, const char *name, const F5_vec3_point_t *Coords, int Xdims, int Ydims, const char *coordinate_system)
F5_API void F5write_quad_surface (hid_t file_id, double time, const char *name, const F5_vec3_point_t *Coords, int nCoords, const F5_quad_t *Quads, int nQuads)
F5_API void F5Cwrite_quad_surface (hid_t file_id, double time, const char *name, const F5_vec3_point_t *Coords, int nCoords, const F5_quad_t *Quads, int nQuads, const char *coordinate_system)
F5_API void F5write_irregular_surface (hid_t file_id, double time, const char *name, const F5_vec3_point_t *Coords, int nCells, const int *CellSizes, const int **CellVertices)

Detailed Description

Typedef Documentation

◆ F5Vertices_and_Connectivity_t

Examples
ObjtoF5.c.

Definition at line 35 of file F5surface.h.

Function Documentation

◆ F5closeVC()

F5_API void F5closeVC ( F5Vertices_and_Connectivity_t * VC)

Close whatever can be closed here.

Definition at line 9 of file F5surface.c.

10{
11 if (VC)
12 {
13 F5Fclose( VC->Vertices );
14 VC->Vertices = NULL;
15
16 F5Fclose( VC->Cells );
17 VC->Cells = NULL;
18 }
19}
void F5Fclose(F5Path *f)
Definition F5F.c:92

References F5Vertices_and_Connectivity::Cells, F5Fclose(), and F5Vertices_and_Connectivity::Vertices.

◆ F5Cwrite_quad_surface()

F5_API void F5Cwrite_quad_surface ( hid_t file_id,
double time,
const char * name,
const F5_vec3_point_t * Coords,
int nCoords,
const F5_quad_t * Quads,
int nQuads,
const char * coordinate_system )

Write a surface constructed by cells with four points (quads). Similar to F5write_quad_surface(), but allow specification of non-standard cartesian coordinate system.

References F5_API, and name.

◆ F5Cwrite_regular_surface()

F5_API void F5Cwrite_regular_surface ( hid_t file_id,
double time,
const char * name,
const F5_vec3_point_t * Coords,
int Xdims,
int Ydims,
const char * coordinate_system )

Write a regular surface. Similar to F5write_regular_surface(), but allow specification of non-standard cartesian coordinate system.

Todo
merge with F5Cwrite_regular_surface

Definition at line 167 of file F5surface.c.

171{
172F5Path*f = F5Rcreate_cartesian_nD(File_id, time, gridname, 2, coordinate_system);
173
174 /* write the data into the dataset */
175 {
176 /* write points for the regular
177 TODO: --- Use F5Fwrite() here ---!!
178 */
179
180 hsize_t dims[2];
181 dims[0] = Ydims; /* (or vice versa, check!) */
182 dims[1] = Xdims;
183 {
184 hid_t coord_ds = H5Screate_simple(2, dims, NULL);
185 hid_t creator_hid = H5Pcreate(H5P_DATASET_CREATE);
187 f->FileIDs->SinglePrecision.Point_hid_t, coord_ds, creator_hid);
188 H5Dwrite(id, f->FileIDs->SinglePrecision.Point_hid_t, H5S_ALL, H5S_ALL, H5P_DEFAULT, Coords);
189 H5Dclose(id);
190 H5Sclose(coord_ds);
191 H5Pclose(creator_hid);
192 }}
193
195
196 F5close(f);
197}
#define FIBER_HDF5_POSITIONS_STRING
Definition F5defs.h:63
void F5I_add_field(F5Path *fpath, const char *fieldname)
Definition F5private.c:178
void F5close(F5Path *f)
Definition F5B.c:186
F5Path * F5Rcreate_cartesian_nD(hid_t File_id, double time, const char *gridname, int Dims, const char *coordinate_system)
Definition F5R.c:116
hid_t F5Dappend(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t create_plist_id)
Definition F5X.c:239
F5_ChartPrecisionTypes SinglePrecision
Definition F5Bchart.h:147
ChartDomain_IDs * FileIDs
Definition F5Path.h:35
hid_t Representation_hid
Definition F5Path.h:58

References F5close(), F5Dappend(), F5I_add_field(), F5Rcreate_cartesian_nD(), FIBER_HDF5_POSITIONS_STRING, F5Path::FileIDs, _F5_ChartPrecisionTypes::Point_hid_t, F5Path::Representation_hid, and ChartDomain_IDs::SinglePrecision.

Referenced by F5write_regular_surface().

◆ F5Cwrite_triangular_surface()

F5_API F5Path * F5Cwrite_triangular_surface ( hid_t file_id,
double time,
const char * name,
const F5_point3f_t * Coords,
int nCoords,
const F5_triangle32_t * Triangles,
int nTriangles,
const char * coordinate_system )

Write a triangular surface. Similar to F5write_triangular_surface(), but allow specification of non-standard cartesian coordinate system.

Todo
merge with F5write_triangular_surface

Definition at line 49 of file F5surface.c.

55{
57 VC = F5Cwrite_triangular_surface_vc(File_id, time,
58 gridname,
59 Coords, nCoords,
60 Triangles, nTriangles,
61 coordinate_system);
62
63 F5Fclose( VC.Cells );
64
65 return VC.Vertices;
66}
F5Vertices_and_Connectivity_t F5Cwrite_triangular_surface_vc(hid_t File_id, double time, const char *gridname, const F5_vec3_point_t *Coords, int nCoords, const F5_triangle_t *Triangles, int nTriangles, const char *coordinate_system)
Definition F5surface.c:69
struct F5Vertices_and_Connectivity F5Vertices_and_Connectivity_t
Definition F5surface.h:35

References F5Vertices_and_Connectivity::Cells, F5Cwrite_triangular_surface_vc(), F5Fclose(), and F5Vertices_and_Connectivity::Vertices.

Referenced by F5write_triangular_surface().

◆ F5Flink_triangular_surface()

F5_API F5Path * F5Flink_triangular_surface ( F5Path * target,
double time,
const char * gridname,
const F5_point3f_t * Coords,
int nCoords,
const F5_triangle_t * Triangles,
int nTriangles,
const char * coordinate_system )

Similar to F5write_triangular_surface(), but instead of writing the vertices and triangles as its own dataset, it references those of another surface object. The vertices and triangles are then shared (in HDF5: symbolic links to the target surface).

Parameters
CoordsThe vertices of this surface; if none are given, re-use the vertices from the target surface.
TrianglesThe triangles of this surfaces; if none are given, reuse the triangles from the target surface.
Note
Only the Vertex coordinates and Triangle connectivity are shared, all other fields remain separate.
Todo
make F5Flink_triangular_surface() failsafe. Extend the concept of linking datasets for sharing available for other grid types as well.

Definition at line 100 of file F5surface.c.

106{
107F5Path*Cells=0;
108F5Path*Vertices = F5Rcreate_cartesian_nD(target->File_hid, time, gridname, 2, coordinate_system);
109 if (!Vertices)
110 return Vertices;
111
112 if (!Coords)
113 {
115 H5G_LINK_HARD,
117 }
118 else
119 {
120 /* write points for the Triangles */
121 F5Fwrite_1D(Vertices, FIBER_HDF5_POSITIONS_STRING, nCoords,
123 Coords, F5P_DEFAULT);
124 }
125
126 Cells = F5Rcreate_triangles_as_vertices_topology(target->File_hid, time, gridname);
127
128 if (!Triangles)
129 {
130 /* TODO: check for errors here! The target ID might not
131 exist at all, and this might indicate that the target
132 is not a triangular surface at all, and that we must not
133 do what we're doing here anyway!! */
134
135 hid_t Connectivity = H5Gopen2( target->Grid_hid, FIBER_HDF5_FACES, H5P_DEFAULT );
136 hid_t AsVertices = H5Gopen2( Connectivity, FIBER_HDF5_POINTS, H5P_DEFAULT );
137 H5Glink2( AsVertices, FIBER_HDF5_POSITIONS_STRING,
138 H5G_LINK_HARD,
140 }
141 else
142 {
143 F5Fwrite_1D(Cells, FIBER_HDF5_POSITIONS_STRING, nTriangles,
145 Triangles, F5P_DEFAULT);
146 }
147
148 F5Fclose( Cells );
149
150 return Vertices;
151}
F5_API F5ErrorCode F5Fwrite_1D(F5Path *fpath, const char *fieldname, hsize_t nElements, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id)
Definition F5F.c:631
#define F5P_DEFAULT
Definition F5L.h:20
#define F5T_COORD3_FLOAT
#define F5T_TRIANGLE32
#define FIBER_HDF5_FACES
Definition F5defs.h:60
#define FIBER_HDF5_POINTS
Definition F5defs.h:55
F5Path * F5Rcreate_triangles_as_vertices_topology(hid_t File_id, double time, const char *gridname)
Definition F5R.c:158
hid_t Grid_hid
Definition F5Path.h:53
hid_t File_hid
Definition F5Path.h:50

References F5Fclose(), F5Fwrite_1D(), F5P_DEFAULT, F5Rcreate_cartesian_nD(), F5Rcreate_triangles_as_vertices_topology(), F5T_COORD3_FLOAT, F5T_TRIANGLE32, FIBER_HDF5_FACES, FIBER_HDF5_POINTS, FIBER_HDF5_POSITIONS_STRING, F5Path::File_hid, F5Path::FileIDs, F5Path::Grid_hid, _F5_ChartPrecisionTypes::Point_hid_t, F5Path::Representation_hid, and ChartDomain_IDs::SinglePrecision.

◆ F5write_irregular_surface()

F5_API void F5write_irregular_surface ( hid_t file_id,
double time,
const char * name,
const F5_vec3_point_t * Coords,
int nCells,
const int * CellSizes,
const int ** CellVertices )

A surface with changing number of vertices per cell.

References F5_API, and name.

◆ F5write_quad_surface()

F5_API void F5write_quad_surface ( hid_t file_id,
double time,
const char * name,
const F5_vec3_point_t * Coords,
int nCoords,
const F5_quad_t * Quads,
int nQuads )

A surface constructed by cells with four points (quads)

References F5_API, and name.

◆ F5write_regular_surface()

F5_API void F5write_regular_surface ( hid_t file_id,
double time,
const char * name,
const F5_vec3_point_t * Coords,
int Xdims,
int Ydims )

Write a regular surface.

Parameters
file_idSome HDF5 id corresponding to some already opened HDF5 file.
timeThe physical time for this data set.
nameSome textual description of this surface; should be simple (avoid spaces, special characters and extensively long names). It is used to identify surfaces over multiple timesteps, so must be identical for subsequent calls on evolving surfaces.
CoordsThe cartesian coordinates of the points
XdimsExtension in first dimension
YdimsExtension in first dimension

Definition at line 154 of file F5surface.c.

158{
159 F5Cwrite_regular_surface(file_id, time,
160 name,
161 Coords, Xdims, Ydims,
163
164}
name
Definition F5P.c:82
#define FIBER_HDF5_DEFAULT_CHART
Definition F5defs.h:74
void F5Cwrite_regular_surface(hid_t File_id, double time, const char *gridname, const F5_vec3_point_t *Coords, int Xdims, int Ydims, const char *coordinate_system)
Definition F5surface.c:167

References F5Cwrite_regular_surface(), FIBER_HDF5_DEFAULT_CHART, and name.

◆ F5write_regular_surface_vertex_field_rgb()

F5_API void F5write_regular_surface_vertex_field_rgb ( hid_t file_id,
double time,
const char * name,
const F5_vec3_point_t * Coords,
int Xdims,
int Ydims,
const char * fieldname,
F5_rgb_t * data )

A regular surface with a data field on the vertices.

Note
Put data into the `Rep_hid' */ F5_API void F5write_regular_surface_vertex_field_dbl(hid_t file_id, double time, const char*name, const F5_vec3_point_t*Coords, int Xdims, int Ydims, const char*fieldname, double*data);

/** A regular surface with a data field on the cells.

Note
Put data into the `Cell_Rep_hid'
Todo
use newer field interface */ F5_API void F5write_regular_surface_cell_field_dbl(hid_t file_id, double time, const char*name, const F5_vec3_point_t*Coords, int Xdims, int Ydims, const char*fieldname, double*data);

/** A field of colors given on the vertices.

Todo
use newer field interface

References F5_API, and name.

◆ F5write_triangular_surface()

F5_API F5Path * F5write_triangular_surface ( hid_t file_id,
double time,
const char * name,
const F5_point3f_t * Coords,
int nCoords,
const F5_triangle32_t * Triangles,
int nTriangles )

Write a triangular surface.

Parameters
file_idSome HDF5 id corresponding to some already opened HDF5 file.
timeThe physical time for this data set.
nameSome textual description of this surface; should be simple (avoid spaces, special characters and extensively long names). It is used to identify surfaces over multiple timesteps, so must be identical for subsequent calls on evolving surfaces.
CoordsThe cartesian coordinates of the points
nCoordsHow many points are there
TrianglesThe connectivity of the triangles, ie. which points belong to each triangle
nTrianglesHow many triangles are there
Todo
Use the new Field interface from uniform grids
Note
This version saves data in SINGLE PRECISION, both for coordinates as well as triangle indices. If you need another precision, inspect the source of this function and do it manually.

Definition at line 23 of file F5surface.c.

27{
28 return F5Cwrite_triangular_surface(file_id, time,
29 name,
30 Coords, nCoords,
31 Triangles, nTriangles,
33}
F5Path * F5Cwrite_triangular_surface(hid_t File_id, double time, const char *gridname, const F5_vec3_point_t *Coords, int nCoords, const F5_triangle_t *Triangles, int nTriangles, const char *coordinate_system)
Definition F5surface.c:49

References F5Cwrite_triangular_surface(), FIBER_HDF5_DEFAULT_CHART, and name.

◆ F5write_triangular_surface_cell_vectors()

F5_API void F5write_triangular_surface_cell_vectors ( hid_t file_id,
double time,
const char * name,
const F5_vec3_point_t * Coords,
int nCoords,
const F5_triangle_t * Triangles,
int nTriangles,
const char * fieldname,
const F5_vec3_float_t * CellNormals )

CellNormals to be added to the Cell_Rep_hid_t

References F5_API, and name.

◆ F5write_triangular_surface_vertex_vectors()

F5_API void F5write_triangular_surface_vertex_vectors ( hid_t file_id,
double time,
const char * name,
const F5_point3f_t * Coords,
int nCoords,
const F5_triangle_t * Triangles,
int nTriangles,
const char * fieldname,
const F5_vec3_float_t * VertexNormals )

VertexNormals to be added to the Rep_hid_t

References F5_API, and name.