FiberBundleHDF5  $Id: FiberHDF5.dfg,v 1.8 2006/12/12 12:32:50 werner Exp $
Functions
Field Operations

Functions

F5_API int F5Fopen (F5Path *f, const char *fieldname)
 
F5_API F5PathF5FopenMostRecentSlice (hid_t File_id, double *t, const char *gridname, const char *fieldname, const char *coordinate_system)
 
F5_API void F5Fclose (F5Path *f)
 
F5_API hid_t F5Fgrab (F5Path *f)
 
F5_API hid_t F5Fget_type2 (F5Path *f, hid_t elink_fapl_id)
 
F5_API hid_t F5Tget_space (F5Path *f)
 
F5_API int F5Fcreate (F5Path *fpath, const char *fieldname, int dimension, hsize_t *dims, hid_t fieldtype, hid_t property_id)
 
F5_API const char * F5Fwhatsup (F5ErrorCode)
 
F5_API F5ErrorCode F5Fwrite (F5Path *fpath, const char *fieldname, int dimension, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id)
 
F5_API F5ErrorCode F5FwriteHyperDimensional (F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id)
 
F5_API F5ErrorCode F5FwriteIMAGE (F5Path *fpath, const char *fieldname, int dimension, hsize_t *dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, hid_t property_id)
 
F5_API F5ErrorCode F5FwriteX (F5Path *fpath, const char *fieldname, int rank, const hsize_t dims[], hid_t fieldtype, hid_t memtype, const void *const dataPtr[], const int polynom_order[], const int component_map[], hid_t property_id)
 
F5_API int F5Fwrite_linear (F5Path *fpath, const char *fieldname, int rank, hsize_t *dims, hid_t fieldtype, const void *base, const void *delta)
 
F5_API F5ErrorCode F5Fwrite_fraction (F5Path *fpath, const char *fieldname, int rank, const hsize_t *full_dims, const hsize_t *fragment_dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t property_id)
 
F5_API F5ErrorCode F5Fwrite_fractionS (F5Path *fpath, const char *fieldname, int rank, const hsize_t *full_dims, const hsize_t *fragment_dims, hid_t fieldtype, hid_t memtype, const void *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t property_id)
 
F5_API int F5FSwrite_fraction (F5Path *fpath, const char *fieldname, int rank, const hsize_t *full_dims, const hsize_t *fragment_dims, hid_t fieldtype, hid_t memtype, const void *const *dataPtr, const hsize_t *datastart, const hsize_t *start_border, const hsize_t *end_border, const char *fraction_name, hid_t property_id, int AllowFullCoverage)
 
F5_API int F5Fwrite_linear_fraction (F5Path *fpath, const char *fieldname, int rank, const hsize_t *full_dims, const hsize_t *fragment_dims, hid_t fieldtype, const void *base, const void *delta, const hsize_t *datastart, const char *fraction_name)
 
F5_API int F5Fis_linear (F5Path *fpath, const char *fieldname)
 

Detailed Description

Interfacing data set creation/write routines using the F5Path structure. Calls the low-level Field operation functions, but is designed for the end-user.

Function Documentation

◆ F5Fclose()

F5_API void F5Fclose ( F5Path f)

◆ F5Fcreate()

F5_API int F5Fcreate ( F5Path fpath,
const char *  fieldname,
int  dimension,
hsize_t *  dims,
hid_t  fieldtype,
hid_t  property_id 
)

Create an HDF5 dataset for further treatment with raw HDF5 functions, e.g. to write an hyperslab instead of the full dataset at once.

Parameters
property_idAn HDF5 dataset property ID. If it is negative, then a default property will be created locally via
H5Pcreate(H5P_DATASET_CREATE)
.
dataspace_idPointer to an HDF5 identifier, that will be used to store a shared dataspace. It may be NULL, in which case a local dataspace is created. Until shared dataspaces are implemented in HDF5, this will make no difference in the actual HDF5 file.
fpathAn F5 Path object that has been created by a F5Rcreate() or related calls from the F5R group. Any previous field ID contained there will be closed and overwritten.
fieldnameThe name of the field. It may be chosen arbitrarily, but must not contain slashes "/". It is furthermore recommended to avoid special characters - even if they work - and to keep the name short and concise).
dimensionThe dimensionality of the data set.
dimsThe extension of the data set.
fieldtypeAn HDF5 type identifier.
See also
F5Lcreate()
Todo:
Add consistency check of sustained dataspace properties across multiple fields per representation.
Returns
zero if the entry could not be opened, non-zero otherwise.

References F5Fclose(), F5Lcreate(), F5Path::Field_hid, F5Path::myChart, ChartDomain_IDs::perm_vector, and F5Path::Representation_hid.

◆ F5Fget_type2()

F5_API hid_t F5Fget_type2 ( F5Path f,
hid_t  elink_fapl_id 
)

Get the data type of an field, given an F5 path.

Returns
An HDF5 datatype, caller must call H5Tclose().

References F5Lget_type(), and F5Path::Field_hid.

◆ F5Fgrab()

F5_API hid_t F5Fgrab ( F5Path f)

Take an HDF5 field identifier out of control of the F5Path. The path identifier is no longer pointing to a field after this operations, it is just a truncated path up to the representation group. It is the responsibility of the caller to close the returned HDF5 identifier, which can either be a group or dataset. This can be determined either by inspecting f->FieldIDisGroup or by H5Gget_objinfo() . Note that using this function allows to keep a field ID open for later use, but undermines the transparency of fields as beeing stored as either datasets or a group with multiple datasets.

References F5Path::Field_hid.

◆ F5Fis_linear()

F5_API int F5Fis_linear ( F5Path fpath,
const char *  fieldname 
)

Check if a field within an F5 path is a linear mapping of points to values.

Todo:
Implement. Similar to F5Lread_linear().

References F5Path::Representation_hid.

◆ F5Fopen()

F5_API int F5Fopen ( F5Path f,
const char *  fieldname 
)

Open a field entry within an F5Path object and leave all other entries intact. An previously opened field entry is closed before the new one is opened.

Returns
zero if the entry could not be opened, non-zero otherwise.
Note
F5 does no HDF5 error management by itself. If any error messages from HDF5 when trying to open a non-existing field shall be emitted, the application code has to set the HDF5 error handler. F5 guarantees to leave these error handlers intact, even if they are locally disabled during some operations.

References F5Fclose(), F5Path::Field_hid, and F5Path::Representation_hid.

◆ F5FSwrite_fraction()

F5_API int F5FSwrite_fraction ( F5Path fpath,
const char *  fieldname,
int  rank,
const hsize_t *  full_dims,
const hsize_t *  fragment_dims,
hid_t  fieldtype,
hid_t  memtype,
const void *const *  dataPtr,
const hsize_t *  datastart,
const hsize_t *  start_border,
const hsize_t *  end_border,
const char *  fraction_name,
hid_t  property_id,
int  AllowFullCoverage 
)

Write a dataset given as separate components which only covers a fraction of the entire representation's domain.

Parameters
dimensionThe dimension of the data set.
full_dimsThe extension of the full (virtual) data set in each dimension, i.e. the size of the entire field when reconstructed from all fragments covering this field.
datastartThe (multidimensional) start index of the saved data set.
fragment_dimsThe number of elements of this fraction.
fraction_nameAn optional string to name this fraction. It may be NULL to use an internal default.
AllowFullCoverageIf non-zero, then the data set is not written as a fragment in case its dimensions cover the entire data space. Use this reduction option with care. This automatism might lead to bad effects, especcially it eliminates the capability to add fragments later. By default, leave this parameter at 0.
Note
Subsampling can not be specified here. Subsampled data need to go into another Topology group.
Returns
true

References F5Fclose(), F5LSwrite_fraction(), F5Lwrites(), F5Path::Field_hid, and F5Path::Representation_hid.

◆ F5Fwhatsup()

F5_API const char* F5Fwhatsup ( F5ErrorCode  EC)

Return a string explaining the meaning of a certain error code.

◆ F5Fwrite()

F5_API F5ErrorCode F5Fwrite ( F5Path fpath,
const char *  fieldname,
int  dimension,
hsize_t *  dims,
hid_t  fieldtype,
hid_t  memtype,
const void *  dataPtr,
hid_t  property_id 
)

Write some data as a contiguous field under the given F5Path location with the given name.

The dimensions of the data must match exactly the dataspace of the containing Skeleton. Use F5FwriteHyperDimensional() to store a dataset that is higher-dimensional than the containing Skeleton.

Parameters
fpathThe F5Path pointing to the location of the Field. The field ID filled in. Any previous field ID contained there will be closed and overwritten.
property_idAn HDF5 dataset property ID. If it is negative, then a default property will be created locally via
H5Pcreate(H5P_DATASET_CREATE)
.
dimensionThe dimensionality of the data set. You may use F5Lwrite1D() as a convenience shortcut for one-dimensional data sets.
dimsThe extension of the data set.
Note
Fields are always associated to certain coordinates system. The field type must be consistent with its coordinate system, e.g. one may not store a vector field in polar coordinates in a cartesian chart. Formally, this can be done because not all API functions have the ability to check for this consistency. However, a field type which is not part of a certain coordinate system will be treated as non-existent when reading the file later.
If a field is a structure made by separate data arrays, e.g. a vector field with components x,y,z stored as three arrays of floats, then use function F5Lwrites().
Todo:
Implement, and add consistency check of sustained dataspace properties across multiple fields per representation.
Returns
error code telling the success of the write:

Referenced by F5Fwrite_uniform_cartesian3D(), F5Rcreate_curvilinear_cartesian3D(), and F5write_uniform_cartesian3Dv().

◆ F5Fwrite_fraction()

F5_API F5ErrorCode F5Fwrite_fraction ( F5Path fpath,
const char *  fieldname,
int  rank,
const hsize_t *  full_dims,
const hsize_t *  fragment_dims,
hid_t  fieldtype,
hid_t  memtype,
const void *  dataPtr,
const hsize_t *  datastart,
const hsize_t *  start_border,
const hsize_t *  end_border,
const char *  fraction_name,
hid_t  property_id 
)

Write a dataset which only covers a fraction of the entire representation's domain. Such datasets are called "fragmented".

Parameters
fpathAn F5 Path object that has been created by a F5Rcreate() or related calls from the F5R group. Any previous field ID contained there will be closed and overwritten.
rankThe rank (dimensionality) of the data set. Maximum value 8 is set by HDF5.
full_dimsThe extension of the full (virtual) data set in each dimension, i.e. the size of the entire field when reconstructed from all fragments covering this field.
datastartThe (multidimensional) start index of the saved data set. Also known as the minimum integer coordinates of this fragment in the coarse grid.
fragment_dimsThe number of elements of this fraction.
fraction_nameA string to name this fraction. It may be an arbitrary name, but should be consistently used among all fragmented fields. It may be NULL to use an internal default (this feauture is not implemented yet, so please DO specify a valid name here).
property_idAn HDF5 dataset property ID. If it is negative, then a default property will be created locally via H5Pcreate(H5P_DATASET_CREATE).
start_borderThe number of overlapping elements at the lower border (also known as ghost zones). It may be NULL if the fragments do no overlap.
end_borderThe number of overlapping elements at the upper border (also known as ghost zones). It may be NULL if the fragments do no overlap.
fieldtypeThe data type of the field as it should appear in the file.
memtypeThe data type of the field as it exists in memory. It may be negative if it is identical to the field type. For instance, if an array of doubles should be written into a file in single precision, specify fieldtype=H5T_NATIVE_DOUBLE and memtype=H5T_NATIVE_FLOAT .
Note
Subsampling can not be specified here. Subsampled data need to go into another Topology group.
Returns
An error code telling why the function failed.

References F5Fclose(), F5Lwrite(), F5Lwrite_fraction(), F5Path::Field_hid, and F5Path::Representation_hid.

◆ F5Fwrite_fractionS()

F5_API F5ErrorCode F5Fwrite_fractionS ( F5Path fpath,
const char *  fieldname,
int  rank,
const hsize_t *  full_dims,
const hsize_t *  fragment_dims,
hid_t  fieldtype,
hid_t  memtype,
const void *  dataPtr,
const hsize_t *  datastart,
const hsize_t *  start_border,
const hsize_t *  end_border,
const char *  fraction_name,
hid_t  property_id 
)

Write a dataset given as a compound as separate components, changing the in-memory data layout.

References F5Fclose(), F5Path::Field_hid, and F5Path::Representation_hid.

◆ F5Fwrite_linear()

F5_API int F5Fwrite_linear ( F5Path fpath,
const char *  fieldname,
int  rank,
hsize_t *  dims,
hid_t  fieldtype,
const void *  base,
const void *  delta 
)

Write a field which is a linear mapping of a base and delta value.

Parameters
fpathAn F5Path object referring to the location where the field shall be created. It must contain a valid Representation_hid. Its Field_hid will contain a reference to the newly created Field on return. If the F5Path object already contained a valid Field_hid, then this one will be closed by this call.
rankThe rank (dimensionality) of the data set.
dimsThe extension of the data set.
fieldtypeThe type of the field, being compatible to base and delta.
Returns
zero, if the entry could not be opened, non-zero if successful.
Todo:
Make this function compatible with F5FwriteX instead. Need to revise this function such that base and delta may be different types, for instance a point and a tangential vector. Possibly provide an alternative function where the min/max is specified instead.

References F5Fclose(), F5LAsave_dimensions(), F5Lwrite_linear(), F5Path::Field_hid, and F5Path::Representation_hid.

Referenced by F5Rcreate_rectilinear(), and F5Rcreate_uniform_cartesian3D().

◆ F5Fwrite_linear_fraction()

F5_API int F5Fwrite_linear_fraction ( F5Path fpath,
const char *  fieldname,
int  rank,
const hsize_t *  full_dims,
const hsize_t *  fragment_dims,
hid_t  fieldtype,
const void *  base,
const void *  delta,
const hsize_t *  datastart,
const char *  fraction_name 
)

Write a dataset given as small "linear mappings" which only covers a fraction of the entire representation's domain. Useful to specify local bounding boxes.

Parameters
dimensionThe dimension of the data set.
full_dimsThe extension of the full (virtual) data set in each dimension, i.e. the size of the entire field when reconstructed from all fragments covering this field.
datastartThe (multidimensional) start index of the saved data set.
fragment_dimsThe number of elements of this fraction.
fraction_nameAn optional string to name this fraction. It may be NULL to use an internal default.
Note
Subsampling can not be specified here. Subsampled data need to go into another Topology group.
Returns
true
See also
F5Fwrite_linear_fraction_overlap()

References F5Fclose(), F5Gappend(), F5LAsave_dimensions(), F5Lset_space(), F5Lwrite_linear(), F5Xclose(), F5Path::Field_hid, and F5Path::Representation_hid.

◆ F5FwriteHyperDimensional()

F5_API F5ErrorCode F5FwriteHyperDimensional ( F5Path fpath,
const char *  fieldname,
int  rank,
hsize_t *  dims,
hid_t  fieldtype,
hid_t  memtype,
const void *  dataPtr,
hid_t  property_id 
)

Write some data as a contiguous field under the given F5Path location with the given name where the data dimensions are higher than the underlying skeleton. This functionality is useful to store data where the higher dimensions express constant, but unknown, number of data elements per point in the base space.

◆ F5FwriteIMAGE()

F5_API F5ErrorCode F5FwriteIMAGE ( F5Path fpath,
const char *  fieldname,
int  dimension,
hsize_t *  dims,
hid_t  fieldtype,
hid_t  memtype,
const void *  dataPtr,
hid_t  property_id 
)

Save a dataset according to the specifications in https://support.hdfgroup.org/HDF5/doc/ADGuide/ImageSpec.html Only rank 2 dimensions are allowed here. All other arguments will lead to an error. Note that this specification is quite inconsistent, as an rgb data set is modeled as a three-dimensional array, not a two-dimensional array of type rgb. Still, we allow this format explicitely here since it is a standard.

References F5Fclose(), F5Lwrite(), F5Path::Field_hid, and F5Path::Representation_hid.

◆ F5FwriteX()

F5_API F5ErrorCode F5FwriteX ( F5Path fpath,
const char *  fieldname,
int  rank,
const hsize_t  dims[],
hid_t  fieldtype,
hid_t  memtype,
const void *const  dataPtr[],
const int  polynom_order[],
const int  component_map[],
hid_t  property_id 
)

Write a field which is defined procedurally as a polynomial function of each manifold coordinate index.

Parameters
rankDimensionality of the base manifold
dims[rank]Extension of the base manifold
fieldtypeThe type of the field as it should appear in the file
memtypeThe type of the field as it resides in memory
dataPtr[COMPONENTS]An array of polynom coefficients for each component of fieldtype
polynom_order[COMPONENTS]The order of each component's polynom
component_map[rank]Mapping from manifold index to component

References F5Fclose(), F5Path::Field_hid, F5Path::GlobalChart_hid, and F5Path::Representation_hid.

◆ F5Tget_space()

F5_API hid_t F5Tget_space ( F5Path f)

Get the data space of an field, given an F5 path.

Returns
An HDF5 dataspace, caller must call H5Sclose().

References F5LAget_dimensions(), F5Path::Field_hid, and F5Path::Topology_hid.