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

Topics

 Uniform Grids

Functions

F5_API F5PathF5Rcreate_rectilinear (hid_t File_id, double time, const char *gridname, const void *origin, const void *spacing, hsize_t *dims, const char *coordinate_system, hid_t property_id,...)
F5_API int F5get_extension (F5Path *grid, hsize_t dims[FIBER_MAX_RANK])
F5_API F5PathF5Rcreate_rectilinear_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, hid_t property_id, float *x, float *y, float *z)
F5PathF5Rcreate_curvilinear_cartesian3D (hid_t File_id, double time, const char *gridname, const F5_vec3_point_t *coords, hsize_t dims[3], const char *coordinate_system, hid_t property_id)

Detailed Description

Function Documentation

◆ F5get_extension()

F5_API int F5get_extension ( F5Path * grid,
hsize_t dims[FIBER_MAX_RANK] )

Definition at line 522 of file F5uniform.c.

523{
524hid_t Top_id;
525struct Dims data;
526 data.grid = grid;
527
528 if (!grid->Grid_hid)
529 return -1;
530
531 if (grid->Topology_hid)
532 Top_id = grid->Topology_hid;
533 else
534 Top_id = H5Gopen2(grid->Grid_hid, FIBER_HDF5_POINTS, H5P_DEFAULT);
535
536 data.dims = dims;
537 H5Giterate(Top_id, ".", NULL, search_extension, &data);
538
539 if (!grid->Topology_hid)
540 H5Gclose( Top_id );
541
542 return data.rank;
543}
#define FIBER_HDF5_POINTS
Definition F5defs.h:55
#define H5Gclose(x)
Definition F5X.h:144
F5Path * grid
Definition F5uniform.c:446
hsize_t * dims
Definition F5uniform.c:445
hid_t Grid_hid
Definition F5Path.h:53
hid_t Topology_hid
Definition F5Path.h:57

References Dims::dims, FIBER_HDF5_POINTS, FIBER_MAX_RANK, Dims::grid, F5Path::Grid_hid, H5Gclose, Dims::rank, and F5Path::Topology_hid.

Referenced by F5P_is_curvilinear(), F5P_is_particle_system(), and F5P_is_regular3D().

◆ F5Rcreate_curvilinear_cartesian3D()

F5Path * F5Rcreate_curvilinear_cartesian3D ( hid_t File_id,
double time,
const char * gridname,
const F5_vec3_point_t * coords,
hsize_t dims[3],
const char * coordinate_system,
hid_t property_id )

Create a regular grid with curvilinear coordinates.

See also
F5create_uniform_cartesian3D(),F5create_rectilinear()

Definition at line 147 of file F5uniform.c.

153{
154F5Path*f = F5Rcreate_cartesian_3D(File_id, time, gridname, coordinate_system);
155
157 3, dims, F5T_COORD3_FLOAT, 0, coords, property_id);
158
159 F5Fclose(f);
160
161 return f;
162}
#define F5T_COORD3_FLOAT
#define FIBER_HDF5_POSITIONS_STRING
Definition F5defs.h:63
void F5Fclose(F5Path *f)
Definition F5F.c:92
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
F5Path * F5Rcreate_cartesian_3D(hid_t File_id, double time, const char *gridname, const char *coordinate_system)
Definition F5R.c:135

References F5Fclose(), F5Fwrite(), F5Rcreate_cartesian_3D(), F5T_COORD3_FLOAT, and FIBER_HDF5_POSITIONS_STRING.

◆ F5Rcreate_rectilinear()

F5_API F5Path * F5Rcreate_rectilinear ( hid_t File_id,
double time,
const char * gridname,
const void * origin,
const void * spacing,
hsize_t * dims,
const char * coordinate_system,
hid_t property_id,
... )

Create a representation that is rectilinear, uniform or stacked in the given 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.
property_idHDF5 property for storing the coordinate arrays in the file, e.g. chunked and/or compressed. May be F5P_DEFAULT. The property will be used to create 1D arrays. The coordinate arrays are usually small compared to the field data. Therefore, the default should be fine for all cases.
...The argument list is to be succeeded by a list of data pointers, each of them pointing to a one-dimensional array of data values. One array per coordinate needs to be specified (but may be NULL), with exactly the same type as in the coordinate system's point type.
Note
Memory to File type conversion is not supported yet!
Should better be named "save_rectilinear", since this function writes data to disc, not only creates dataset entries.

Definition at line 169 of file F5uniform.c.

177{
178int i, component_count;
179F5Path*f = F5Rcreate_cartesian_3D(File_id, time, gridname, coordinate_system);
180
181hid_t Point_hid_t = f->myChart->SinglePrecision.Point_hid_t;
182int nDims = H5Tget_nmembers(Point_hid_t);
183va_list vl;
184
186 nDims, dims, Point_hid_t, origin, spacing))
187 {
188 F5close(f);
189 return NULL;
190 }
191
192 /* Init the step through the argument list */
193 va_start(vl, property_id);
194
195 component_count = 0;
196 for(i=0; i<nDims; i++)
197 {
198 hsize_t length = dims[i];
199 const void*dataPtr = va_arg(vl, const void*);
200 hid_t component_id;
201 char * name;
202 hid_t member_type;
203
204 if (!dataPtr) continue;
205 component_count++;
206
207 name = H5Tget_member_name(Point_hid_t, i);
208
209 member_type = H5Tget_member_type(Point_hid_t, i);
210
211 component_id = F5Lwrite1D(f->Field_hid, name, length, member_type, 0, dataPtr,
212 F5LTmake_enum_type(f), property_id);
213 H5Dclose(component_id);
214 H5Tclose(member_type);
215 free(name);
216 }
217
219
220/*
221 if (nDims==2)
222 F5I_add_grid(f, gridname, time, HAVE_REGULAR_CELLS2D);
223 else if (nDims==3)
224 F5I_add_grid(f, gridname, time, HAVE_REGULAR_CELLS3D);
225
226 if (component_count == nDims)
227 F5I_add_grid(f, gridname, time, HAVE_CARTESIAN_RECTILINEAR_POSITIONS);
228 else if (component_count == 0)
229 F5I_add_grid(f, gridname, time, HAVE_CARTESIAN_UNIFORM_POSITIONS);
230 else
231 F5I_add_grid(f, gridname, time, gridtype);
232*/
233
234 /* Close the Step through */
235 va_end(vl);
236
237 F5Fclose(f);
238
239 return f;
240}
hid_t F5LTmake_enum_type(F5Path *fpath)
Definition F5LT.c:179
H5Tclose(type_id)
name
Definition F5P.c:82
free(name)
void F5I_add_field(F5Path *fpath, const char *fieldname)
Definition F5private.c:178
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 F5close(F5Path *f)
Definition F5B.c:186
hid_t F5Lwrite1D(hid_t R_id, const char *fieldname, hsize_t nElements, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t enum_type, hid_t property_id)
Definition F5L.c:408
F5_ChartPrecisionTypes SinglePrecision
Definition F5Bchart.h:147
hid_t Field_hid
Definition F5Path.h:59
ChartDomain_IDs * myChart
Definition F5Path.h:33

References F5close(), F5Fclose(), F5Fwrite_linear(), F5I_add_field(), F5LTmake_enum_type(), F5Lwrite1D(), F5Rcreate_cartesian_3D(), FIBER_HDF5_POSITIONS_STRING, F5Path::Field_hid, free(), H5Tclose(), F5Path::myChart, name, _F5_ChartPrecisionTypes::Point_hid_t, and ChartDomain_IDs::SinglePrecision.

Referenced by F5Rcreate_rectilinear_cartesian3D().

◆ F5Rcreate_rectilinear_cartesian3D()

F5_API F5Path * F5Rcreate_rectilinear_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,
hid_t property_id,
float * x,
float * y,
float * z )

Create a regular grid with rectilinear or stacked coordinates. If the one-dimensional coordinate arrays are omitted, then a linear mapping based on the origin and spacing parameters is assumed. If all coordinate arrays are given, then the origin and spacing information is not used. Otherwise, if none of the coordinate arrays is given, then the coordinates will be uniform.

See also
F5create_uniform_cartesian3D(),F5create_rectilinear()
Parameters
xCoordinate values in x direction, may be NULL.
yCoordinate values in y direction, may be NULL.
zCoordinate values in z direction, may be NULL.

Definition at line 242 of file F5uniform.c.

250{
251 F5Path* path = F5Rcreate_rectilinear(File_id, time,
252 gridname,
253 origin,
254 spacing,
255 dims,
256 coordinate_system,
257 property_id,
258 x,y,z);
259 if (path) {
260 if (!x && !y && !z) {
261 F5Cset (path, FIBER_HDF5_POSITIONS_STRING, FIBER_REGULAR_GRID_URL "StandardCartesian/Uniform/");
262 } else if (z && !x && !y) {
263 F5Cset (path, FIBER_HDF5_POSITIONS_STRING, FIBER_REGULAR_GRID_URL "StandardCartesian/zStacked/");
264 } else {
265 F5Cset (path, FIBER_HDF5_POSITIONS_STRING, FIBER_REGULAR_GRID_URL "StandardCartesian/Rectilinear/");
266 }
267 }
268 return path;
269}
F5_API int F5Cset(F5Path *fpath, const char *fieldname, const char *content_type)
#define FIBER_REGULAR_GRID_URL
Definition F5uniform.h:133
F5Path * F5Rcreate_rectilinear(hid_t File_id, double time, const char *gridname, const void *origin, const void *spacing, hsize_t *dims, const char *coordinate_system, hid_t property_id,...)
Definition F5uniform.c:169

References F5Cset(), F5Rcreate_rectilinear(), FIBER_HDF5_POSITIONS_STRING, and FIBER_REGULAR_GRID_URL.