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

Typedefs

typedef int F5_gridproperty_t(F5Path *grid, const char *coordinate_system)

Functions

F5_API int F5P_is_uniform (F5Path *grid, const char *coordinate_system)
F5_API int F5P_is_Zstacked (F5Path *grid, const char *coordinate_system)
F5_API int F5P_is_rectilinear (F5Path *grid, const char *coordinate_system)
F5_API int F5P_is_curvilinear (F5Path *grid, const char *coordinate_system)
F5_API int F5P_is_triangular_surface (F5Path *grid, const char *coordinate_system)
F5_API int F5P_is_particle_system (F5Path *grid, const char *coordinate_system)
F5_API int F5P_has_vertices (F5Path *grid, const char *coordinate_system)
F5_API int F5P_has_vertex_fields (F5Path *grid, const char *coordinate_system)
F5_API int F5P_has_cell_fields (F5Path *grid, const char *coordinate_system)

Detailed Description

Typedef Documentation

◆ F5_gridproperty_t

typedef int F5_gridproperty_t(F5Path *grid, const char *coordinate_system)

Prototype for functions determining grid properties.

Returns
true if the property is matched, otherwise false.
Examples
RegularReader.c.

Definition at line 63 of file F5P.h.

Function Documentation

◆ F5P_has_cell_fields()

F5_API int F5P_has_cell_fields ( F5Path * grid,
const char * coordinate_system )

Check if the grid has some data fields defined on its cells

References F5_API.

◆ F5P_has_vertex_fields()

F5_API int F5P_has_vertex_fields ( F5Path * grid,
const char * coordinate_system )

Check if the grid has some fields in the specified coordinate system

References F5_API.

◆ F5P_has_vertices()

F5_API int F5P_has_vertices ( F5Path * grid,
const char * coordinate_system )

Check if the grid has positions in the specified coordinate system

Definition at line 299 of file F5P.c.

300{
301hid_t Top_id, Rep_id;
302int ok;
303
304 if (!grid->Grid_hid)
305 return 0;
306
307 if (grid->Topology_hid)
308 Top_id = grid->Topology_hid;
309 else
310 Top_id = H5Gopen2(grid->Grid_hid, FIBER_HDF5_POINTS, H5P_DEFAULT);
311
312 Rep_id = H5Gopen2( Top_id, coordinate_system, H5P_DEFAULT );
313
316
317 H5Gclose( Rep_id );
318
319 if (!grid->Topology_hid)
320 H5Gclose( Top_id );
321
322 return ok;
323}
return ok
Definition F5P.c:95
#define FIBER_HDF5_POINTS
Definition F5defs.h:55
#define FIBER_HDF5_POSITIONS_STRING
Definition F5defs.h:63
#define H5Gclose(x)
Definition F5X.h:144
int F5Gexist(hid_t location, const char *name)
Definition F5X.c:307
int F5Dexist(hid_t location, const char *name)
Definition F5X.c:321
hid_t Grid_hid
Definition F5Path.h:53
hid_t Topology_hid
Definition F5Path.h:57

References F5Dexist(), F5Gexist(), FIBER_HDF5_POINTS, FIBER_HDF5_POSITIONS_STRING, F5Path::Grid_hid, H5Gclose, ok, and F5Path::Topology_hid.

◆ F5P_is_curvilinear()

F5_API int F5P_is_curvilinear ( F5Path * grid,
const char * coordinate_system )

The grid is curvilinear if the positions is a dataset of rank n with n>1 or it is a group with n scalar field that are named like the coordinate entries.

Definition at line 163 of file F5P.c.

164{
165hid_t Top_id, Rep_id, type_id;
166hsize_t dims[FIBER_MAX_RANK];
167int rank;
168int ok = 0;
169
170 if (!grid->Grid_hid)
171 return 0;
172
173 rank = F5get_extension(grid, dims);
174
175 if (rank<2) return 0;
176
177 if (grid->Topology_hid)
178 Top_id = grid->Topology_hid;
179 else
180 Top_id = H5Gopen2(grid->Grid_hid, FIBER_HDF5_POINTS, H5P_DEFAULT);
181
182 Rep_id = H5Gopen2( Top_id, coordinate_system, H5P_DEFAULT );
183
185
186 if (!ok)
187 {
189 if (ok)
190 {
191 int i, n;
192 char*name;
193 hid_t pos_id = H5Gopen2(Rep_id, FIBER_HDF5_POSITIONS_STRING, H5P_DEFAULT);
194 type_id = F5Lget_type(pos_id, 1, 0);
195 n = H5Tget_nmembers(type_id);
196 for(i=0; i<n; i++)
197 {
198 name = H5Tget_member_name(type_id, i);
199 if (!F5Dexist(pos_id, name))
200 {
201 ok = 0;
202 break;
203 }
204 free(name);
205 }
206
207 H5Tclose(type_id);
208 H5Gclose(pos_id);
209 }
210 }
211
212 H5Gclose( Rep_id );
213
214 if (!grid->Topology_hid)
215 H5Gclose( Top_id );
216
217 return ok;
218}
H5Tclose(type_id)
name
Definition F5P.c:82
free(name)
#define FIBER_MAX_RANK
Definition F5defs.h:105
hid_t F5Lget_type(hid_t Field_hid, int FieldIDisGroup, hid_t fapl_id)
Definition F5L.c:173
int F5get_extension(F5Path *grid, hsize_t dims[FIBER_MAX_RANK])
Definition F5uniform.c:522

References F5Dexist(), F5get_extension(), F5Gexist(), F5Lget_type(), FIBER_HDF5_POINTS, FIBER_HDF5_POSITIONS_STRING, FIBER_MAX_RANK, free(), F5Path::Grid_hid, H5Gclose, H5Tclose(), name, ok, and F5Path::Topology_hid.

◆ F5P_is_particle_system()

F5_API int F5P_is_particle_system ( F5Path * grid,
const char * coordinate_system )

No Connectivity information is given, and the dimensionality of the Positions is 1.

Definition at line 278 of file F5P.c.

279{
280hsize_t dims[FIBER_MAX_RANK];
281int rank = F5get_extension(grid, dims);
282
283 if (rank==1)
284 {
285 if (!grid->Grid_hid)
286 return 0;
287
288 if (!F5Gexist(grid->Grid_hid, FIBER_HDF5_CELLS) )
289 return 1;
290
291 return 0;
292 }
293
294 return 0;
295}
#define FIBER_HDF5_CELLS
Definition F5defs.h:57

References F5get_extension(), F5Gexist(), FIBER_HDF5_CELLS, FIBER_MAX_RANK, and F5Path::Grid_hid.

◆ F5P_is_rectilinear()

F5_API int F5P_is_rectilinear ( F5Path * grid,
const char * coordinate_system )

Definition at line 113 of file F5P.c.

114{
115hid_t Top_id, Rep_id;
116int ok;
117
118 if (!grid->Grid_hid)
119 return 0;
120
121 if (grid->Topology_hid)
122 Top_id = grid->Topology_hid;
123 else
124 Top_id = H5Gopen2(grid->Grid_hid, FIBER_HDF5_POINTS, H5P_DEFAULT);
125
126 Rep_id = H5Gopen2( Top_id, coordinate_system, H5P_DEFAULT );
127
129 if (ok)
130 {
131 int i, n;
132 char*name;
133 hid_t pos_id = H5Gopen2(Rep_id, FIBER_HDF5_POSITIONS_STRING, H5P_DEFAULT);
134 hid_t type_id = F5Lget_type(pos_id, 1, 0);
135 n = H5Tget_nmembers(type_id);
136 for(i=0; i<n; i++)
137 {
138 name = H5Tget_member_name(type_id, i);
139 if (!F5Dexist(pos_id, name))
140 {
141 ok = 0;
142 free(name);
143 break;
144 }
145 free(name);
146 }
147 H5Tclose(type_id);
148 H5Gclose(pos_id);
149 }
150 H5Gclose( Rep_id );
151
152 if (!grid->Topology_hid)
153 H5Gclose( Top_id );
154
155 return ok;
156}
int F5Lis_linear(hid_t Rep_id, const char *fieldname)
Definition F5L.c:985

References F5Dexist(), F5Lget_type(), F5Lis_linear(), FIBER_HDF5_POINTS, FIBER_HDF5_POSITIONS_STRING, free(), F5Path::Grid_hid, H5Gclose, H5Tclose(), name, ok, and F5Path::Topology_hid.

◆ F5P_is_triangular_surface()

F5_API int F5P_is_triangular_surface ( F5Path * grid,
const char * coordinate_system )

Definition at line 221 of file F5P.c.

222{
223hid_t Cell_Top_id, Cell_Vertices_id, Vertices_id, Vertices_Type_id;
224int ok;
225
226 if (!F5Gexist(grid->Grid_hid, FIBER_HDF5_CELLS) )
227 if( !F5Gexist(grid->Grid_hid, FIBER_HDF5_FACES) )
228 return 0;
229 else
230 Cell_Top_id = H5Gopen2(grid->Grid_hid, FIBER_HDF5_FACES, H5P_DEFAULT);
231 else
232 Cell_Top_id = H5Gopen2(grid->Grid_hid, FIBER_HDF5_CELLS, H5P_DEFAULT);
233
234 if (!F5Gexist(Cell_Top_id, FIBER_HDF5_POINTS) )
235 {
236 H5Gclose( Cell_Top_id );
237 return 0;
238 }
239
240 Cell_Vertices_id = F5Gtry_to_open(Cell_Top_id, FIBER_HDF5_POINTS);
241 if (Cell_Vertices_id<1)
242 {
243 H5Gclose( Cell_Top_id );
244 return 0;
245 }
246
247 Vertices_id = F5Dtry_to_open(Cell_Vertices_id, FIBER_HDF5_POSITIONS_STRING);
248 if (Vertices_id<1)
249 {
250 H5Gclose( Cell_Top_id );
251 H5Gclose( Cell_Vertices_id );
252 return 0;
253 }
254
255 Vertices_Type_id = H5Dget_type(Vertices_id);
256
257 if (H5Tequal(Vertices_Type_id, F5T_TRIANGLE32)>0 )
258 {
259 ok = 1;
260 }
261 else if (H5Tequal(Vertices_Type_id, F5T_TRIANGLE64)>0 )
262 {
263 ok = 1;
264 }
265 else
266 ok = 0;
267
268 H5Tclose( Vertices_Type_id );
269 H5Gclose( Cell_Top_id );
270 H5Gclose( Cell_Vertices_id );
271 H5Dclose( Vertices_id );
272 return ok;
273}
#define F5T_TRIANGLE64
#define F5T_TRIANGLE32
#define FIBER_HDF5_FACES
Definition F5defs.h:60
hid_t F5Dtry_to_open(hid_t location, const char *name)
Definition F5X.c:335
hid_t F5Gtry_to_open(hid_t location, const char *name)
Definition F5X.c:297

References F5Dtry_to_open(), F5Gexist(), F5Gtry_to_open(), F5T_TRIANGLE32, F5T_TRIANGLE64, FIBER_HDF5_CELLS, FIBER_HDF5_FACES, FIBER_HDF5_POINTS, FIBER_HDF5_POSITIONS_STRING, F5Path::Grid_hid, H5Gclose, H5Tclose(), and ok.

◆ F5P_is_uniform()

F5_API int F5P_is_uniform ( F5Path * grid,
const char * coordinate_system )

Definition at line 21 of file F5P.c.

22{
23hid_t Top_id, Rep_id;
24int ok;
25
26 if (!grid->Grid_hid)
27 return 0;
28
29 if (grid->Topology_hid)
30 Top_id = grid->Topology_hid;
31 else
32 Top_id = H5Gopen2(grid->Grid_hid, FIBER_HDF5_POINTS, H5P_DEFAULT);
33
34 Rep_id = H5Gopen2( Top_id, coordinate_system, H5P_DEFAULT );
35
37
38 H5Gclose( Rep_id );
39
40 if (!grid->Topology_hid)
41 H5Gclose( Top_id );
42
43 return ok;
44}

References F5Lis_linear(), FIBER_HDF5_POINTS, FIBER_HDF5_POSITIONS_STRING, F5Path::Grid_hid, H5Gclose, ok, and F5Path::Topology_hid.

◆ F5P_is_Zstacked()

F5_API int F5P_is_Zstacked ( F5Path * grid,
const char * coordinate_system )

References F5_API.