Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
sets.c File Reference
#include <H5Tpublic.h>
#include <H5Dpublic.h>
#include <H5Gpublic.h>
#include <H5Spublic.h>
#include <H5Ppublic.h>
#include "mhdf.h"
#include "util.h"
#include "file-handle.h"
#include "status.h"
#include "names-and-paths.h"
+ Include dependency graph for sets.c:

Go to the source code of this file.

Enumerations

enum  SetMetaCol { CONTENT = 0 , CHILDREN = 1 , PARENTS = 2 , FLAGS = 3 }
 

Functions

int mhdf_haveSets (mhdf_FileHandle file, int *have_data, int *have_child, int *have_parent, mhdf_Status *status)
 Check if file contains any sets. More...
 
hid_t mhdf_createSetMeta (mhdf_FileHandle file, long num_sets, long *first_id_out, mhdf_Status *status)
 Create table holding list of meshsets and their properties. More...
 
hid_t mhdf_openSetMeta (mhdf_FileHandle file, long *num_sets, long *first_id_out, mhdf_Status *status)
 Open table holding list of meshsets and their properties. More...
 
hid_t mhdf_openSetMetaSimple (mhdf_FileHandle file, mhdf_Status *status)
 
static int mhdf_readwriteSetMeta (hid_t table_id, int read, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 
void mhdf_readSetMeta (hid_t table_id, long offset, long count, hid_t type, void *data, mhdf_Status *status)
 Read list of sets and meta-information about sets. More...
 
void mhdf_readSetMetaWithOpt (hid_t table_id, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 
void mhdf_writeSetMeta (hid_t table_id, long offset, long count, hid_t type, const void *data, mhdf_Status *status)
 Write list of sets and meta-information about sets. More...
 
void mhdf_writeSetMetaWithOpt (hid_t table_id, long offset, long count, hid_t type, const void *data, hid_t prop, mhdf_Status *status)
 
static int mhdf_readSetMetaColumn (hid_t table_id, enum SetMetaCol column, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 
void mhdf_readSetFlags (hid_t table_id, long offset, long count, hid_t type, void *data, mhdf_Status *status)
 Read only the flags portion of the set description table. More...
 
void mhdf_readSetFlagsWithOpt (hid_t table_id, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 
void mhdf_readSetContentEndIndices (hid_t table_id, long offset, long count, hid_t type, void *data, mhdf_Status *status)
 Read only the content end indices portion of the set description table. More...
 
void mhdf_readSetContentEndIndicesWithOpt (hid_t table_id, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 
void mhdf_readSetChildEndIndices (hid_t table_id, long offset, long count, hid_t type, void *data, mhdf_Status *status)
 Read only the child end indices portion of the set description table. More...
 
void mhdf_readSetChildEndIndicesWithOpt (hid_t table_id, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 
void mhdf_readSetParentEndIndices (hid_t table_id, long offset, long count, hid_t type, void *data, mhdf_Status *status)
 Read only the parent end indices portion of the set description table. More...
 
void mhdf_readSetParentEndIndicesWithOpt (hid_t table_id, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 
hid_t mhdf_createSetData (mhdf_FileHandle file_handle, long data_list_size, mhdf_Status *status)
 Create file object to hold list of meshset contents. More...
 
hid_t mhdf_openSetData (mhdf_FileHandle file_handle, long *data_list_size_out, mhdf_Status *status)
 Open the file object for the meshset contents. More...
 
void mhdf_writeSetData (hid_t table_id, long offset, long count, hid_t type, const void *data, mhdf_Status *status)
 Write set contents. More...
 
void mhdf_writeSetDataWithOpt (hid_t table_id, long offset, long count, hid_t type, const void *data, hid_t prop, mhdf_Status *status)
 
void mhdf_readSetData (hid_t table_id, long offset, long count, hid_t type, void *data, mhdf_Status *status)
 Read set contents. More...
 
void mhdf_readSetDataWithOpt (hid_t table_id, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 
hid_t mhdf_createSetChildren (mhdf_FileHandle file_handle, long child_list_size, mhdf_Status *status)
 Create file object for storing the set child list. More...
 
hid_t mhdf_openSetChildren (mhdf_FileHandle file_handle, long *child_list_size, mhdf_Status *status)
 Open the file object containing the set child list. More...
 
hid_t mhdf_createSetParents (mhdf_FileHandle file_handle, long parent_list_size, mhdf_Status *status)
 Create file object for storing the set parent list. More...
 
hid_t mhdf_openSetParents (mhdf_FileHandle file_handle, long *parent_list_size, mhdf_Status *status)
 Open the file object containing the set parent list. More...
 
void mhdf_writeSetParentsChildren (hid_t table_id, long offset, long count, hid_t type, const void *data, mhdf_Status *status)
 Write set parent/child list. More...
 
void mhdf_writeSetParentsChildrenWithOpt (hid_t table_id, long offset, long count, hid_t type, const void *data, hid_t prop, mhdf_Status *status)
 
void mhdf_readSetParentsChildren (hid_t table_id, long offset, long count, hid_t type, void *data, mhdf_Status *status)
 Read set parent/child list. More...
 
void mhdf_readSetParentsChildrenWithOpt (hid_t table_id, long offset, long count, hid_t type, void *data, hid_t prop, mhdf_Status *status)
 

Enumeration Type Documentation

◆ SetMetaCol

enum SetMetaCol
Enumerator
CONTENT 
CHILDREN 
PARENTS 
FLAGS 

Definition at line 405 of file sets.c.

406 {
407  CONTENT = 0,
408  CHILDREN = 1,
409  PARENTS = 2,
410  FLAGS = 3
411 };

Function Documentation

◆ mhdf_createSetChildren()

hid_t mhdf_createSetChildren ( mhdf_FileHandle  file_handle,
long  child_list_size,
mhdf_Status status 
)

Create file object for storing the set child list.

Create a data group for the list of set children.
The format of this data is the concatenation of the lists of global IDs of child sets for each set. The order of the sets and the number of children for each set is contained in the set meta table. (See mhdf_createSetMeta ).

Parameters
file_handleThe file
child_list_sizeThe total length of the data (the sum of the number of children for each set.)
statusPassed back status of API call.
Returns
A handle to the data object in the file.

Definition at line 718 of file sets.c.

719 {
720  FileHandle* file_ptr;
721  hid_t table_id;
722  hsize_t dim = (hsize_t)child_list_size;
723  API_BEGIN;
724 
725  file_ptr = (FileHandle*)( file_handle );
726  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
727 
728  if( child_list_size < 1 )
729  {
730  mhdf_setFail( status, "Invalid argument.\n" );
731  return -1;
732  }
733 
734  table_id = mhdf_create_table( file_ptr->hdf_handle, SET_CHILD_PATH, file_ptr->id_type, 1, &dim, status );
735 
736  API_END_H( 1 );
737  return table_id;
738 }

References API_BEGIN, API_END_H, dim, struct_FileHandle::hdf_handle, struct_FileHandle::id_type, mhdf_check_valid_file(), mhdf_create_table(), mhdf_setFail(), and SET_CHILD_PATH.

Referenced by moab::WriteHDF5::create_set_tables().

◆ mhdf_createSetData()

hid_t mhdf_createSetData ( mhdf_FileHandle  file_handle,
long  data_list_size,
mhdf_Status status 
)

Create file object to hold list of meshset contents.

Create set contents data object. The format of this data is a vector of integer values which is the concatenation of the contents list for all the meshsets. The length and format of the data for each set is stored in the set meta table. See mhdf_createSetMeta and mhdf_SET_RANGE_BIT for a description of that data.

Parameters
file_handleThe file.
data_list_sizeThe total length (number of integer values) to be written for all the sets.
statusPassed back status of API call.
Returns
A handle to the table.

Definition at line 635 of file sets.c.

636 {
637  FileHandle* file_ptr;
638  hid_t table_id;
639  hsize_t dim = (hsize_t)data_list_size;
640  API_BEGIN;
641 
642  file_ptr = (FileHandle*)( file_handle );
643  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
644 
645  if( data_list_size < 1 )
646  {
647  mhdf_setFail( status, "Invalid argument.\n" );
648  return -1;
649  }
650 
651  table_id = mhdf_create_table( file_ptr->hdf_handle, SET_DATA_PATH, file_ptr->id_type, 1, &dim, status );
652 
653  API_END_H( 1 );
654  return table_id;
655 }

References API_BEGIN, API_END_H, dim, struct_FileHandle::hdf_handle, struct_FileHandle::id_type, mhdf_check_valid_file(), mhdf_create_table(), mhdf_setFail(), and SET_DATA_PATH.

Referenced by moab::WriteHDF5::create_set_tables().

◆ mhdf_createSetMeta()

hid_t mhdf_createSetMeta ( mhdf_FileHandle  file_handle,
long  num_sets,
long *  first_set_id_out,
mhdf_Status status 
)

Create table holding list of meshsets and their properties.

The set table contains description of sets, but not contents or children. The table is a n x 4 matrix of values.
One row for each of n sets. Each row contains the end index for the set in the contents table, the end index for the set in the children table, the end index for the set in the parents table, and the set flags, respectively. The mhdf_SET_RANGE_BIT bit in the flags specifies the format of the contents list for each set. See a description of the mhdf_SET_RANGE_BIT flag for a description of the two possible data formats. The index values in the first two columns of the table are the index of the last value for the set in the corresponding contents and children lists. The first index is always one greater than the last index for the previous set in the table. The first index of the first set in the table is implicitly zero. A special value of -1 in the appropriate column should be used to indicate that the first set contains no contents or has no children. For any other set, if the last index for the set is the same as that of the previous set, it has no data in the corresponding list.

Parameters
file_handleThe file.
num_setsThe number of sets in the table.
first_set_id_outThe global ID that will be assigned to the first set in the table. All subsequent sets in the table will be assigned sequential global IDs.
statusPassed back status of API call.
Returns
The handle to the set meta-data table.

Definition at line 109 of file sets.c.

110 {
111  FileHandle* file_ptr = (FileHandle*)file;
112  hid_t table_id;
113  hsize_t dims[2];
114  long first_id;
115  API_BEGIN;
116 
117  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
118 
119  dims[0] = (hsize_t)num_sets;
120  dims[1] = (hsize_t)4;
121  table_id = mhdf_create_table( file_ptr->hdf_handle, SET_META_PATH, MHDF_INDEX_TYPE, 2, dims, status );
122  if( table_id < 0 ) return -1;
123 
124  first_id = file_ptr->max_id + 1;
125  if( !mhdf_create_scalar_attrib( table_id, START_ID_ATTRIB, H5T_NATIVE_LONG, &first_id, status ) )
126  {
127  H5Dclose( table_id );
128  return -1;
129  }
130 
131  *first_id_out = first_id;
132  file_ptr->max_id += num_sets;
133  if( !mhdf_write_max_id( file_ptr, status ) )
134  {
135  H5Dclose( table_id );
136  return -1;
137  }
138  file_ptr->open_handle_count++;
139  mhdf_setOkay( status );
140 
141  API_END_H( 1 );
142  return table_id;
143 }

References API_BEGIN, API_END_H, struct_FileHandle::hdf_handle, struct_FileHandle::max_id, mhdf_check_valid_file(), mhdf_create_scalar_attrib(), mhdf_create_table(), MHDF_INDEX_TYPE, mhdf_setOkay(), mhdf_write_max_id(), struct_FileHandle::open_handle_count, SET_META_PATH, and START_ID_ATTRIB.

Referenced by moab::WriteHDF5::create_set_meta().

◆ mhdf_createSetParents()

hid_t mhdf_createSetParents ( mhdf_FileHandle  file_handle,
long  parent_list_size,
mhdf_Status status 
)

Create file object for storing the set parent list.

Create a data group for the list of set parents.
The format of this data is the concatenation of the lists of global IDs of parent sets for each set. The order of the sets and the number of parents for each set is contained in the set meta table. (See mhdf_createSetMeta ).

Parameters
file_handleThe file
parent_list_sizeThe total length of the data (the sum of the number of parents for each set.)
statusPassed back status of API call.
Returns
A handle to the data object in the file.

Definition at line 763 of file sets.c.

764 {
765  FileHandle* file_ptr;
766  hid_t table_id;
767  hsize_t dim = (hsize_t)parent_list_size;
768  API_BEGIN;
769 
770  file_ptr = (FileHandle*)( file_handle );
771  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
772 
773  if( parent_list_size < 1 )
774  {
775  mhdf_setFail( status, "Invalid argument.\n" );
776  return -1;
777  }
778 
779  table_id = mhdf_create_table( file_ptr->hdf_handle, SET_PARENT_PATH, file_ptr->id_type, 1, &dim, status );
780 
781  API_END_H( 1 );
782  return table_id;
783 }

References API_BEGIN, API_END_H, dim, struct_FileHandle::hdf_handle, struct_FileHandle::id_type, mhdf_check_valid_file(), mhdf_create_table(), mhdf_setFail(), and SET_PARENT_PATH.

Referenced by moab::WriteHDF5::create_set_tables().

◆ mhdf_haveSets()

int mhdf_haveSets ( mhdf_FileHandle  file,
int *  have_data,
int *  have_child,
int *  have_parent,
mhdf_Status status 
)

Check if file contains any sets.

MOAB, a Mesh-Oriented datABase, is a software component for creating, storing and accessing finite element mesh data.

Copyright 2004 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

Definition at line 27 of file sets.c.

28 {
29  FileHandle* file_ptr = (FileHandle*)file;
30  hid_t root_id, set_id;
31  int result;
32  API_BEGIN;
33 
34  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
35 
36 #if defined( H5Gopen_vers ) && H5Gopen_vers > 1
37  root_id = H5Gopen2( file_ptr->hdf_handle, ROOT_GROUP, H5P_DEFAULT );
38 #else
39  root_id = H5Gopen( file_ptr->hdf_handle, ROOT_GROUP );
40 #endif
41  if( root_id < 0 )
42  {
43  mhdf_setFail( status, "H5Gopen( \"%s\" ) failed.", ROOT_GROUP );
44  return -1;
45  }
46 
47  result = mhdf_is_in_group( root_id, SET_GROUP_NAME, status );
48  if( result < 1 )
49  {
50  H5Gclose( root_id );
51  return result;
52  }
53 
54 #if defined( H5Gopen_vers ) && H5Gopen_vers > 1
55  set_id = H5Gopen2( root_id, SET_GROUP_NAME, H5P_DEFAULT );
56 #else
57  set_id = H5Gopen( root_id, SET_GROUP_NAME );
58 #endif
59  H5Gclose( root_id );
60  if( set_id < 0 )
61  {
62  mhdf_setFail( status, "H5Gopen( \"%s\" ) failed.", SET_GROUP );
63  return -1;
64  }
65 
66  result = mhdf_is_in_group( set_id, SET_META_NAME, status );
67  if( result < 0 )
68  {
69  H5Gclose( set_id );
70  return result;
71  }
72 
73  if( have_data )
74  {
75  *have_data = mhdf_is_in_group( set_id, SET_DATA_NAME, status );
76  if( *have_data < 0 )
77  {
78  H5Gclose( set_id );
79  return *have_data;
80  }
81  }
82 
83  if( have_child )
84  {
85  *have_child = mhdf_is_in_group( set_id, SET_CHILD_NAME, status );
86  if( *have_child < 0 )
87  {
88  H5Gclose( set_id );
89  return *have_child;
90  }
91  }
92 
93  if( have_parent )
94  {
95  *have_parent = mhdf_is_in_group( set_id, SET_PARENT_NAME, status );
96  if( *have_parent < 0 )
97  {
98  H5Gclose( set_id );
99  return *have_parent;
100  }
101  }
102 
103  mhdf_setOkay( status );
104  H5Gclose( set_id );
105  API_END;
106  return result;
107 }

References API_BEGIN, API_END, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_is_in_group(), mhdf_setFail(), mhdf_setOkay(), ROOT_GROUP, SET_CHILD_NAME, SET_DATA_NAME, SET_GROUP, SET_GROUP_NAME, SET_META_NAME, and SET_PARENT_NAME.

Referenced by mhdf_getFileSummary().

◆ mhdf_openSetChildren()

hid_t mhdf_openSetChildren ( mhdf_FileHandle  file_handle,
long *  child_list_size,
mhdf_Status status 
)

Open the file object containing the set child list.

Open the data group containing the list of set children.
See mhdf_createSetChildren and mhdf_createSetMeta for a description of this data.

Parameters
file_handleThe file
child_list_sizeThe total length of the data (the sum of the number of children for each set.)
statusPassed back status of API call.
Returns
A handle to the data object in the file.

Definition at line 740 of file sets.c.

741 {
742  FileHandle* file_ptr;
743  hid_t table_id;
744  hsize_t dim;
745  API_BEGIN;
746 
747  file_ptr = (FileHandle*)( file_handle );
748  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
749 
750  if( !child_list_size )
751  {
752  mhdf_setFail( status, "Invalid argument.\n" );
753  return -1;
754  }
755 
756  table_id = mhdf_open_table( file_ptr->hdf_handle, SET_CHILD_PATH, 1, &dim, status );
757 
758  *child_list_size = (long)dim;
759  API_END_H( 1 );
760  return table_id;
761 }

References API_BEGIN, API_END_H, dim, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_open_table(), mhdf_setFail(), and SET_CHILD_PATH.

Referenced by check_valid_sets(), moab::ReadHDF5::read_set_ids_recursive(), moab::ReadHDF5::read_sets(), and moab::WriteHDF5::write_sets().

◆ mhdf_openSetData()

hid_t mhdf_openSetData ( mhdf_FileHandle  file_handle,
long *  data_list_size_out,
mhdf_Status status 
)

Open the file object for the meshset contents.

Open set contents data object. The format of this data is a vector of integer values which is the concatenation of the contents list for all the meshsets. The length and format of the data for each set is stored in the set meta table. See mhdf_createSetMeta and mhdf_SET_RANGE_BIT for a description of that data.

Parameters
file_handleThe file.
data_list_size_outThe length of the table.
statusPassed back status of API call.
Returns
A handle to the table.

Definition at line 657 of file sets.c.

658 {
659  FileHandle* file_ptr;
660  hid_t table_id;
661  hsize_t dim;
662  API_BEGIN;
663 
664  file_ptr = (FileHandle*)( file_handle );
665  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
666 
667  if( !data_list_size_out )
668  {
669  mhdf_setFail( status, "Invalid argument.\n" );
670  return -1;
671  }
672 
673  table_id = mhdf_open_table( file_ptr->hdf_handle, SET_DATA_PATH, 1, &dim, status );
674 
675  *data_list_size_out = (long)dim;
676  API_END_H( 1 );
677  return table_id;
678 }

References API_BEGIN, API_END_H, dim, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_open_table(), mhdf_setFail(), and SET_DATA_PATH.

Referenced by check_valid_sets(), moab::ReadHDF5::find_sets_containing(), moab::ReadHDF5::get_set_contents(), moab::ReadHDF5::read_set_ids_recursive(), moab::ReadHDF5::read_sets(), and moab::WriteHDF5::write_sets().

◆ mhdf_openSetMeta()

hid_t mhdf_openSetMeta ( mhdf_FileHandle  file_handle,
long *  num_sets_out,
long *  first_set_id_out,
mhdf_Status status 
)

Open table holding list of meshsets and their properties.

Open set list.
See mhdf_createSetMeta or mhdf Meshset data for a description of this data.

Parameters
file_handleThe file.
num_sets_outThe number of sets in the table.
first_set_id_outThe global ID that will of the first set in the table. All subsequent sets in the table have sequential global IDs.
statusPassed back status of API call.
Returns
The handle to the set meta-data table.

Definition at line 145 of file sets.c.

146 {
147  FileHandle* file_ptr = (FileHandle*)file;
148  hid_t table_id;
149  hsize_t dims[2];
150  API_BEGIN;
151 
152  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
153 
154  table_id = mhdf_open_table2( file_ptr->hdf_handle, SET_META_PATH, 2, dims, first_id_out, status );
155  if( table_id < 0 ) return -1;
156 
157  /* If dims[1] == 3, then old format of table.
158  * Deal with it in mhdf_readSetMeta and mhdf_writeSetMeta
159  */
160  if( dims[1] != 4 && dims[1] != 3 )
161  {
162  mhdf_setFail( status, "Invalid format for meshset table.\n" );
163  H5Dclose( table_id );
164  return -1;
165  }
166 
167  *num_sets = dims[0];
168  file_ptr->open_handle_count++;
169  mhdf_setOkay( status );
170  API_END_H( 1 );
171  return table_id;
172 }

References API_BEGIN, API_END_H, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_open_table2(), mhdf_setFail(), mhdf_setOkay(), struct_FileHandle::open_handle_count, and SET_META_PATH.

Referenced by check_valid_sets(), mhdf_getFileSummary(), and moab::WriteHDF5::write_sets().

◆ mhdf_openSetMetaSimple()

hid_t mhdf_openSetMetaSimple ( mhdf_FileHandle  file,
mhdf_Status status 
)

Definition at line 174 of file sets.c.

175 {
176  FileHandle* file_ptr = (FileHandle*)file;
177  hid_t table_id;
178  API_BEGIN;
179 
180  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
181 
182  table_id = mhdf_open_table_simple( file_ptr->hdf_handle, SET_META_PATH, status );
183  if( table_id < 0 ) return -1;
184 
185  file_ptr->open_handle_count++;
186  mhdf_setOkay( status );
187  API_END_H( 1 );
188  return table_id;
189 }

References API_BEGIN, API_END_H, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_open_table_simple(), mhdf_setOkay(), struct_FileHandle::open_handle_count, and SET_META_PATH.

Referenced by moab::ReadHDF5::read_all_set_meta().

◆ mhdf_openSetParents()

hid_t mhdf_openSetParents ( mhdf_FileHandle  file_handle,
long *  parent_list_size,
mhdf_Status status 
)

Open the file object containing the set parent list.

Open the data group containing the list of set parents.
See mhdf_createSetParents and mhdf_createSetMeta for a description of this data.

Parameters
file_handleThe file
parent_list_sizeThe total length of the data (the sum of the number of parents for each set.)
statusPassed back status of API call.
Returns
A handle to the data object in the file.

Definition at line 785 of file sets.c.

786 {
787  FileHandle* file_ptr;
788  hid_t table_id;
789  hsize_t dim;
790  API_BEGIN;
791 
792  file_ptr = (FileHandle*)( file_handle );
793  if( !mhdf_check_valid_file( file_ptr, status ) ) return -1;
794 
795  if( !parent_list_size )
796  {
797  mhdf_setFail( status, "Invalid argument.\n" );
798  return -1;
799  }
800 
801  table_id = mhdf_open_table( file_ptr->hdf_handle, SET_PARENT_PATH, 1, &dim, status );
802 
803  *parent_list_size = (long)dim;
804  API_END_H( 1 );
805  return table_id;
806 }

References API_BEGIN, API_END_H, dim, struct_FileHandle::hdf_handle, mhdf_check_valid_file(), mhdf_open_table(), mhdf_setFail(), and SET_PARENT_PATH.

Referenced by check_valid_sets(), moab::ReadHDF5::read_sets(), and moab::WriteHDF5::write_sets().

◆ mhdf_readSetChildEndIndices()

void mhdf_readSetChildEndIndices ( hid_t  data_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  end_indices_out,
mhdf_Status status 
)

Read only the child end indices portion of the set description table.

For each set, read the last index of that set's data in the set children table.

NOTE: This is a signed value. Any sets w/out contents that occur first in the list will have an end index of -1.

Parameters
data_handleThe handle returned from mdhf_createSetMeta or mhdf_openSetMeta
offsetThe offset (set index) at which to begin reading.
countThe number of values (number of sets) to read.
hdf_integer_typeThe integer type of the input array 'set_flag_data'.
end_indices_outArray of indices.
statusLocation at which to store status of API call.

Definition at line 592 of file sets.c.

593 {
594  API_BEGIN;
595  mhdf_readSetMetaColumn( table_id, CHILDREN, offset, count, type, data, H5P_DEFAULT, status );
596  API_END;
597 }

References API_BEGIN, API_END, CHILDREN, and mhdf_readSetMetaColumn().

Referenced by check_valid_parents_children().

◆ mhdf_readSetChildEndIndicesWithOpt()

void mhdf_readSetChildEndIndicesWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 598 of file sets.c.

605 {
606  API_BEGIN;
607  mhdf_readSetMetaColumn( table_id, CHILDREN, offset, count, type, data, prop, status );
608  API_END;
609 }

References API_BEGIN, API_END, CHILDREN, and mhdf_readSetMetaColumn().

◆ mhdf_readSetContentEndIndices()

void mhdf_readSetContentEndIndices ( hid_t  data_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  end_indices_out,
mhdf_Status status 
)

Read only the content end indices portion of the set description table.

For each set, read the last index of that set's data in the set contents table.

NOTE: This is a signed value. Any sets w/out contents that occur first in the list will have an end index of -1.

Parameters
data_handleThe handle returned from mdhf_createSetMeta or mhdf_openSetMeta
offsetThe offset (set index) at which to begin reading.
countThe number of values (number of sets) to read.
hdf_integer_typeThe integer type of the input array 'set_flag_data'.
end_indices_outArray of indices.
statusLocation at which to store status of API call.

Definition at line 568 of file sets.c.

574 {
575  API_BEGIN;
576  mhdf_readSetMetaColumn( table_id, CONTENT, offset, count, type, data, H5P_DEFAULT, status );
577  API_END;
578 }

References API_BEGIN, API_END, CONTENT, and mhdf_readSetMetaColumn().

Referenced by check_valid_set_contents().

◆ mhdf_readSetContentEndIndicesWithOpt()

void mhdf_readSetContentEndIndicesWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 579 of file sets.c.

586 {
587  API_BEGIN;
588  mhdf_readSetMetaColumn( table_id, CONTENT, offset, count, type, data, prop, status );
589  API_END;
590 }

References API_BEGIN, API_END, CONTENT, and mhdf_readSetMetaColumn().

◆ mhdf_readSetData()

void mhdf_readSetData ( hid_t  set_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  set_data,
mhdf_Status status 
)

Read set contents.

Read data specifying entities contained in sets. The format of this data is a vector of integer values which is the concatenation of the contents list for all the meshsets. The length and format of the data for each set is stored in the set meta table. See mhdf_createSetMeta and mhdf_SET_RANGE_BIT for a description of that data.

Parameters
set_handleThe handle returned from mhdf_createSetData or mhdf_openSetData .
offsetThe position at which to read from the integer vector.
countThe number of values to read from the data vector.
hdf_integer_typeThe type of the integer data in set_data. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
set_dataA pointer to memory at which to store the read data.
statusPassed back status of API call.

Definition at line 699 of file sets.c.

700 {
701  API_BEGIN;
702  mhdf_read_data( table_id, offset, count, type, data, H5P_DEFAULT, status );
703  API_END;
704 }

References API_BEGIN, API_END, and mhdf_read_data().

Referenced by check_valid_set_contents(), and moab::ReadHDF5::find_sets_containing().

◆ mhdf_readSetDataWithOpt()

void mhdf_readSetDataWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 705 of file sets.c.

712 {
713  API_BEGIN;
714  mhdf_read_data( table_id, offset, count, type, data, prop, status );
715  API_END;
716 }

References API_BEGIN, API_END, and mhdf_read_data().

Referenced by moab::ReadHDF5::find_sets_containing().

◆ mhdf_readSetFlags()

void mhdf_readSetFlags ( hid_t  data_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  set_flag_data,
mhdf_Status status 
)

Read only the flags portion of the set description table.

Read flags for each set from the set description table. See mhdf_createSetMeta for a description of this data.

Parameters
data_handleThe handle returned from mdhf_createSetMeta or mhdf_openSetMeta
offsetThe offset (set index) at which to begin reading.
countThe number of values (number of sets) to read.
hdf_integer_typeThe integer type of the input array 'set_flag_data'.
set_flag_dataArray of integers.
statusLocation at which to store status of API call.

Definition at line 549 of file sets.c.

550 {
551  API_BEGIN;
552  mhdf_readSetMetaColumn( table_id, FLAGS, offset, count, type, data, H5P_DEFAULT, status );
553  API_END;
554 }

References API_BEGIN, API_END, FLAGS, and mhdf_readSetMetaColumn().

Referenced by check_valid_set_contents().

◆ mhdf_readSetFlagsWithOpt()

void mhdf_readSetFlagsWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 555 of file sets.c.

562 {
563  API_BEGIN;
564  mhdf_readSetMetaColumn( table_id, FLAGS, offset, count, type, data, prop, status );
565  API_END;
566 }

References API_BEGIN, API_END, FLAGS, and mhdf_readSetMetaColumn().

◆ mhdf_readSetMeta()

void mhdf_readSetMeta ( hid_t  data_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  set_desc_data,
mhdf_Status status 
)

Read list of sets and meta-information about sets.

Read set descriptions. See mhdf_createSetMeta or mhdf Meshset data for a description of this data.

Parameters
data_handleThe handle returned from mhdf_createSetMeta or mhdf_openSetMeta.
offsetThe offset (set index) to begin reading at.
countThe number of rows (sets, integer triples) to read.
hdf_integer_typeThe type of the integer data in set_desc_data. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
statusPassed back status of API call.
set_desc_dataThe memory location at which to write the data.

Definition at line 367 of file sets.c.

368 {
369  API_BEGIN;
370  mhdf_readwriteSetMeta( table_id, 1, offset, count, type, data, H5P_DEFAULT, status );
371  API_END;
372 }

References API_BEGIN, API_END, and mhdf_readwriteSetMeta().

◆ mhdf_readSetMetaColumn()

static int mhdf_readSetMetaColumn ( hid_t  table_id,
enum SetMetaCol  column,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)
static

Definition at line 413 of file sets.c.

421 {
422  hid_t slab_id, mem_id;
423  hsize_t offsets[2], counts[2], mcount = count;
424  herr_t rval = 0;
425  int dims;
426  const int fill_val = -1;
427 
428  if( offset < 0 || count < 0 )
429  {
430  mhdf_setFail( status,
431  "Invalid input for reading set description column: "
432  "offset = %ld, count = %ld\n",
433  offset, count );
434  return 0;
435  }
436 
437  /* Get dimensions of table, and check against requested count and offset */
438 
439  slab_id = H5Dget_space( table_id );
440  if( slab_id < 0 )
441  {
442  mhdf_setFail( status, "Internal error calling H5Dget_space." );
443  return 0;
444  }
445 
446  dims = H5Sget_simple_extent_ndims( slab_id );
447  if( dims != 2 )
448  {
449  H5Sclose( slab_id );
450  mhdf_setFail( status, "Internal error: unexpected dataset rank: %d.", dims );
451  return 0;
452  }
453 
454  dims = H5Sget_simple_extent_dims( slab_id, counts, NULL );
455  if( dims < 0 )
456  {
457  H5Sclose( slab_id );
458  mhdf_setFail( status, "Internal error calling H5Sget_simple_extend_dims." );
459  return 0;
460  }
461 
462  if( (unsigned long)( offset + count ) > counts[0] )
463  {
464  H5Sclose( slab_id );
465  mhdf_setFail( status, "Requested read of rows %ld to %ld of a %ld row table.\n", offset, offset + count - 1,
466  (long)counts[0] );
467  return 0;
468  }
469 
470  /* Create a slab definition for the block of memory we're reading into */
471 
472  mem_id = H5Screate_simple( 1, &mcount, NULL );
473  if( mem_id < 0 )
474  {
475  H5Sclose( slab_id );
476  mhdf_setFail( status, "Internal error calling H5Screate_simple." );
477  return 0;
478  }
479 
480  /* Old, 3-column table.
481  * New table is {contents, children, parents, flags}
482  * Old table is {contents, children, flags}
483  * If asking for parents, just return zeros.
484  * If asking for flags, fix column value.
485  */
486  offsets[1] = column;
487  if( counts[1] == 3 )
488  {
489  if( column == PARENTS )
490  {
491  rval = H5Dfill( &fill_val, H5T_NATIVE_INT, data, type, mem_id );
492  H5Sclose( mem_id );
493  H5Sclose( slab_id );
494  if( rval < 0 )
495  {
496  mhdf_setFail( status, "Internal error calling H5Dfill" );
497  return 0;
498  }
499  else
500  {
501  mhdf_setOkay( status );
502  return 1;
503  }
504  }
505  else if( column == FLAGS )
506  --offsets[1];
507  }
508  else if( counts[1] != 4 )
509  {
510  H5Sclose( mem_id );
511  H5Sclose( slab_id );
512  mhdf_setFail( status, "Invalid dimension for meshset metadata table." );
513  return 0;
514  }
515 
516  /* Create a slab defintion for the portion of the table we want to read. */
517 
518  /* offsets[1] was initialized in the above block of code. */
519  offsets[0] = (hsize_t)offset;
520  counts[0] = (hsize_t)count;
521  counts[1] = 1; /* one column */
522  if( count )
523  rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
524  else
525  rval = H5Sselect_none( slab_id );
526  if( rval < 0 )
527  {
528  H5Sclose( mem_id );
529  H5Sclose( slab_id );
530  mhdf_setFail( status, "Internal error calling H5Sselect_hyperslab." );
531  return 0;
532  }
533 
534  /* Read the data */
535 
536  rval = H5Dread( table_id, type, mem_id, slab_id, prop, data );
537  H5Sclose( mem_id );
538  H5Sclose( slab_id );
539  if( rval < 0 )
540  {
541  mhdf_setFail( status, "Internal error calling H5Dread." );
542  return 0;
543  }
544 
545  mhdf_setOkay( status );
546  return 1;
547 }

References FLAGS, mhdf_setFail(), mhdf_setOkay(), and PARENTS.

Referenced by mhdf_readSetChildEndIndices(), mhdf_readSetChildEndIndicesWithOpt(), mhdf_readSetContentEndIndices(), mhdf_readSetContentEndIndicesWithOpt(), mhdf_readSetFlags(), mhdf_readSetFlagsWithOpt(), mhdf_readSetParentEndIndices(), and mhdf_readSetParentEndIndicesWithOpt().

◆ mhdf_readSetMetaWithOpt()

void mhdf_readSetMetaWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 373 of file sets.c.

380 {
381  API_BEGIN;
382  mhdf_readwriteSetMeta( table_id, 1, offset, count, type, data, prop, status );
383  API_END;
384 }

References API_BEGIN, API_END, and mhdf_readwriteSetMeta().

Referenced by moab::ReadHDF5::read_all_set_meta().

◆ mhdf_readSetParentEndIndices()

void mhdf_readSetParentEndIndices ( hid_t  data_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  end_indices_out,
mhdf_Status status 
)

Read only the parent end indices portion of the set description table.

For each set, read the last index of that set's data in the set parents table.

NOTE: This is a signed value. Any sets w/out contents that occur first in the list will have an end index of -1.

Parameters
data_handleThe handle returned from mdhf_createSetMeta or mhdf_openSetMeta
offsetThe offset (set index) at which to begin reading.
countThe number of values (number of sets) to read.
hdf_integer_typeThe integer type of the input array 'set_flag_data'.
end_indices_outArray of indices.
statusLocation at which to store status of API call.

Definition at line 611 of file sets.c.

617 {
618  API_BEGIN;
619  mhdf_readSetMetaColumn( table_id, PARENTS, offset, count, type, data, H5P_DEFAULT, status );
620  API_END;
621 }

References API_BEGIN, API_END, mhdf_readSetMetaColumn(), and PARENTS.

Referenced by check_valid_parents_children().

◆ mhdf_readSetParentEndIndicesWithOpt()

void mhdf_readSetParentEndIndicesWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 622 of file sets.c.

629 {
630  API_BEGIN;
631  mhdf_readSetMetaColumn( table_id, PARENTS, offset, count, type, data, prop, status );
632  API_END;
633 }

References API_BEGIN, API_END, mhdf_readSetMetaColumn(), and PARENTS.

◆ mhdf_readSetParentsChildren()

void mhdf_readSetParentsChildren ( hid_t  data_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
void *  id_list,
mhdf_Status status 
)

Read set parent/child list.

Read from the list of parent or child IDs for sets. See mhdf_createSetChildren and mhdf_createSetMeta for a description of this data.

Parameters
data_handleThe value returned from mhdf_createSetChildren or mhdf_openSetChildren.
offsetThe offset into the list of global IDs.
countThe number of global IDs to read.
hdf_integer_typeThe type of the integer data in child_id_list. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
id_listPointer to memory in which to the read data.
statusPassed back status of API call.

Definition at line 832 of file sets.c.

833 {
834  API_BEGIN;
835  mhdf_read_data( table_id, offset, count, type, data, H5P_DEFAULT, status );
836  API_END;
837 }

References API_BEGIN, API_END, and mhdf_read_data().

Referenced by check_valid_parents_children().

◆ mhdf_readSetParentsChildrenWithOpt()

void mhdf_readSetParentsChildrenWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 838 of file sets.c.

845 {
846  API_BEGIN;
847  mhdf_read_data( table_id, offset, count, type, data, prop, status );
848  API_END;
849 }

References API_BEGIN, API_END, and mhdf_read_data().

◆ mhdf_readwriteSetMeta()

static int mhdf_readwriteSetMeta ( hid_t  table_id,
int  read,
long  offset,
long  count,
hid_t  type,
void *  data,
hid_t  prop,
mhdf_Status status 
)
static

Definition at line 191 of file sets.c.

199 {
200  hid_t slab_id, sslab_id, smem_id, mem_id;
201  hsize_t offsets[2], counts[2], mcounts[2], moffsets[2] = { 0, 0 };
202  herr_t rval = 0;
203  int dims, i;
204  const int fill_val = -1;
205  const hsize_t one = 1;
206 
207  mcounts[0] = count;
208  mcounts[1] = 4;
209  if( offset < 0 || count < 0 )
210  {
211  mhdf_setFail( status,
212  "Invalid input for %s: "
213  "offset = %ld, count = %ld\n",
214  read ? "read" : "write", offset, count );
215  return 0;
216  }
217 
218  slab_id = H5Dget_space( table_id );
219  if( slab_id < 0 )
220  {
221  mhdf_setFail( status, "Internal error calling H5Dget_space." );
222  return 0;
223  }
224 
225  dims = H5Sget_simple_extent_ndims( slab_id );
226  if( dims != 2 )
227  {
228  H5Sclose( slab_id );
229  mhdf_setFail( status, "Internal error: unexpected dataset rank: %d.", dims );
230  return 0;
231  }
232 
233  dims = H5Sget_simple_extent_dims( slab_id, counts, NULL );
234  if( dims < 0 )
235  {
236  H5Sclose( slab_id );
237  mhdf_setFail( status, "Internal error calling H5Sget_simple_extend_dims." );
238  return 0;
239  }
240 
241  if( (unsigned long)( offset + count ) > counts[0] )
242  {
243  H5Sclose( slab_id );
244  mhdf_setFail( status, "Requested %s of rows %ld to %ld of a %ld row table.\n", read ? "read" : "write", offset,
245  offset + count - 1, (long)counts[dims - 1] );
246  return 0;
247  }
248  counts[0] = (hsize_t)count;
249  offsets[0] = (hsize_t)offset;
250 
251  if( count )
252  mem_id = H5Screate_simple( dims, mcounts, NULL );
253  else
254  { /* special case for 'NULL' read during collective parallel IO */
255  mem_id = H5Screate_simple( 1, &one, NULL );
256  if( mem_id && 0 > H5Sselect_none( mem_id ) )
257  {
258  H5Sclose( mem_id );
259  mem_id = -1;
260  }
261  }
262  if( mem_id < 0 )
263  {
264  mhdf_setFail( status, "Internal error calling H5Screate_simple." );
265  return 0;
266  }
267 
268  /* Normal table: 4 columns */
269  if( counts[1] == 4 )
270  {
271  offsets[1] = 0;
272  if( count )
273  rval = H5Sselect_hyperslab( slab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
274  else /* special case for 'NULL' read during collective parallel IO */
275  rval = H5Sselect_none( slab_id );
276  if( rval < 0 )
277  {
278  H5Sclose( mem_id );
279  H5Sclose( slab_id );
280  mhdf_setFail( status, "Internal error calling H5Sselect_hyperslab." );
281  return 0;
282  }
283 
284  if( read )
285  rval = H5Dread( table_id, type, mem_id, slab_id, prop, data );
286  else
287  rval = H5Dwrite( table_id, type, mem_id, slab_id, prop, data );
288  }
289  /* Old table: 3 columns, no parent link counts */
290  else if( counts[1] == 3 )
291  {
292  rval = 0;
293  for( i = 0; i < 3 && rval >= 0; ++i )
294  {
295  smem_id = H5Scopy( mem_id );
296  sslab_id = H5Scopy( slab_id );
297  if( smem_id < 0 || sslab_id < 0 )
298  {
299  if( smem_id >= 0 ) H5Sclose( smem_id );
300  mhdf_setFail( status, "Internal error calling H5Scopy." );
301  return 0;
302  }
303 
304  counts[1] = 1;
305  offsets[1] = i;
306  if( count )
307  rval = H5Sselect_hyperslab( sslab_id, H5S_SELECT_SET, offsets, NULL, counts, NULL );
308  else
309  rval = H5Sselect_none( sslab_id );
310  if( rval < 0 )
311  {
312  H5Sclose( slab_id );
313  H5Sclose( mem_id );
314  mhdf_setFail( status, "Internal error calling H5Sselect_hyperslab." );
315  return 0;
316  }
317 
318  mcounts[1] = 1;
319  moffsets[1] = ( i == 2 ) ? 3 : i;
320  rval = H5Sselect_hyperslab( smem_id, H5S_SELECT_SET, moffsets, NULL, mcounts, NULL );
321  if( rval < 0 )
322  {
323  H5Sclose( sslab_id );
324  H5Sclose( slab_id );
325  H5Sclose( mem_id );
326  mhdf_setFail( status, "Internal error calling H5Sselect_hyperslab." );
327  return 0;
328  }
329 
330  if( read )
331  rval = H5Dread( table_id, type, smem_id, sslab_id, prop, data );
332  else
333  rval = H5Dwrite( table_id, type, smem_id, sslab_id, prop, data );
334 
335  H5Sclose( sslab_id );
336  H5Sclose( smem_id );
337  }
338 
339  if( read && rval >= 0 )
340  {
341  mcounts[1] = 1;
342  moffsets[1] = 2;
343  H5Sselect_hyperslab( mem_id, H5S_SELECT_SET, moffsets, NULL, mcounts, NULL );
344  rval = H5Dfill( &fill_val, H5T_NATIVE_INT, data, type, mem_id );
345  }
346  }
347  else
348  {
349  H5Sclose( mem_id );
350  H5Sclose( slab_id );
351  mhdf_setFail( status, "Invalid dimension for meshset metadata table." );
352  return 0;
353  }
354 
355  H5Sclose( slab_id );
356  H5Sclose( mem_id );
357  if( rval < 0 )
358  {
359  mhdf_setFail( status, "Internal error calling H5D%s.", read ? "read" : "write" );
360  return 0;
361  }
362 
363  mhdf_setOkay( status );
364  return 1;
365 }

References mhdf_setFail(), and mhdf_setOkay().

Referenced by mhdf_readSetMeta(), mhdf_readSetMetaWithOpt(), mhdf_writeSetMeta(), and mhdf_writeSetMetaWithOpt().

◆ mhdf_writeSetData()

void mhdf_writeSetData ( hid_t  set_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  set_data,
mhdf_Status status 
)

Write set contents.

Write data specifying entities contained in sets. The format of this data is a vector of integer values which is the concatenation of the contents list for all the meshsets. The length and format of the data for each set is stored in the set meta table. See mhdf_createSetMeta and mhdf_SET_RANGE_BIT for a description of that data.

Parameters
set_handleThe handle returned from mhdf_createSetData or mhdf_openSetData .
offsetThe position at which to write into the integer vector.
countThe number of values to write into the data vector.
hdf_integer_typeThe type of the integer data in set_data. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
set_dataThe data to write.
statusPassed back status of API call.

Definition at line 680 of file sets.c.

681 {
682  API_BEGIN;
683  mhdf_write_data( table_id, offset, count, type, data, H5P_DEFAULT, status );
684  API_END;
685 }

References API_BEGIN, API_END, and mhdf_write_data().

◆ mhdf_writeSetDataWithOpt()

void mhdf_writeSetDataWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
const void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 686 of file sets.c.

693 {
694  API_BEGIN;
695  mhdf_write_data( table_id, offset, count, type, data, prop, status );
696  API_END;
697 }

References API_BEGIN, API_END, and mhdf_write_data().

Referenced by moab::WriteHDF5::write_set_data().

◆ mhdf_writeSetMeta()

void mhdf_writeSetMeta ( hid_t  data_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  set_desc_data,
mhdf_Status status 
)

Write list of sets and meta-information about sets.

Write set descriptions. See mhdf_createSetMeta or mhdf Meshset data for a description of the data format.

Parameters
data_handleThe handle returned from mhdf_createSetMeta or mhdf_openSetMeta.
offsetThe offset (set index) to begin writing at.
countThe number of rows (sets, integer triples) to write.
hdf_integer_typeThe type of the integer data in set_desc_data. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
set_desc_dataThe data to write.
statusPassed back status of API call.

Definition at line 386 of file sets.c.

387 {
388  API_BEGIN;
389  mhdf_readwriteSetMeta( table_id, 0, offset, count, type, (void*)data, H5P_DEFAULT, status );
390  API_END;
391 }

References API_BEGIN, API_END, and mhdf_readwriteSetMeta().

◆ mhdf_writeSetMetaWithOpt()

void mhdf_writeSetMetaWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
const void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 392 of file sets.c.

399 {
400  API_BEGIN;
401  mhdf_readwriteSetMeta( table_id, 0, offset, count, type, (void*)data, prop, status );
402  API_END;
403 }

References API_BEGIN, API_END, and mhdf_readwriteSetMeta().

Referenced by moab::WriteHDF5::write_sets().

◆ mhdf_writeSetParentsChildren()

void mhdf_writeSetParentsChildren ( hid_t  data_handle,
long  offset,
long  count,
hid_t  hdf_integer_type,
const void *  id_list,
mhdf_Status status 
)

Write set parent/child list.

Write the list of parent or child IDs for sets. See mhdf_createSetChildren and mhdf_createSetMeta for a description of this data.

Parameters
data_handleThe value returned from mhdf_createSetChildren or mhdf_openSetChildren.
offsetThe offset into the list of global IDs.
countThe number of global IDs to write.
hdf_integer_typeThe type of the integer data in child_id_list. Typically H5T_NATIVE_INT or N5T_NATIVE_LONG as defined in H5Tpublic.h. The HDF class of this type object must be H5T_INTEGER
id_listThe data to write.
statusPassed back status of API call.

Definition at line 808 of file sets.c.

814 {
815  API_BEGIN;
816  mhdf_write_data( table_id, offset, count, type, data, H5P_DEFAULT, status );
817  API_END;
818 }

References API_BEGIN, API_END, and mhdf_write_data().

◆ mhdf_writeSetParentsChildrenWithOpt()

void mhdf_writeSetParentsChildrenWithOpt ( hid_t  table_id,
long  offset,
long  count,
hid_t  type,
const void *  data,
hid_t  prop,
mhdf_Status status 
)

Definition at line 819 of file sets.c.

826 {
827  API_BEGIN;
828  mhdf_write_data( table_id, offset, count, type, data, prop, status );
829  API_END;
830 }

References API_BEGIN, API_END, and mhdf_write_data().

Referenced by moab::WriteHDF5::write_set_data().