November 19, 2002 Resources: ---------- A couple of sample files can be found in ./ex_files directory A testfile maker can be found in ./ex_testfile_maker A sample model making application can be found in ./ex_model_maker This file documents how to use the reader/writer API for structured and unstructured data contained within HDF5 files. Below is a description of the basic process to use for writing data: WRITER ------ 1. If a transient model, you need to write out one file per time step, and have a "casefile" which lists the name for each file. So, first call: HDF_start_writing_casefile 2. Then for each time step, do the following steps A through F: A) These must be called first: --------------------------- HDF_set_model_metadata - sets several required model attributes nParts nVariables nDomains hasNodeIDs hasElementIDs modelDescription1 modelDescription2 timeStep timeValue geomChangingFlag writingConn lastGeomFile for each part HDF_set_part_metadata - sets several required part attributes partName partDescription structuredFlag If STRUCTURED structuredType iblankingVarName ghostVarName structuredIJKs for each variable HDF_set_variables_metadata - sets several required variable attributes varName varDescription varType If not a constant mappingType B) Then create the file: --------------------- HDF_create (filename) - creates an hdf file and builds tree structure of groups and associated attributes: /model | nParts (n) | nVariables (k) | nDomains (m) | hasNodeIDs | hasElementIDs | modelDescription1 | modelDescription2 | timeStep | timeValue | geomChangingFlag | writingConn | lasGeomFile | ------------------------------------------------------- | (if not STATIC & | | writingConn = FALSE) | | | Geometry Variables | | ----------------------------- ------------------------------ | | | | | | geom_part_1 geom_part_2 ...geom_part_n variable_1 variable_2 ...variable_k | partName | varName | partDescription | varDescription | structuredFlag | varType | If STRUCTURED | If not model or part constant | structuredType | mappingType | iblankingVarName | | ghostVarName | (if not a model constant) | structuredIJKs --------------------------- | | | | -------------------------------- var_part_1 var_part_2 ...var_part_n | | | | geom_domain_1 geom_domain_2 ...geom_domain_m | (if not a part constant) ------------------------------- | | | var_domain_1 var_domain_2 ...var_domain_m C) Populate Geometry, with the coordinates, ----------------- [coordinate ids], element connectivities, [element ids], and [extent min/max values]: for each geom_part { for each geom_domain { HDF_set_part_coords_simple - create coordinate dataset & write coords or HDF_set_part_coords (also store number of nodes in the dataset and the file layout) [HDF_set_part_coords_ids] - if doing node ids, create coordinateid dataset and write the ids. [HDF_set_extents(DOMAIN)] - set the min/max extents for the domain if writing_conn { for any element types that exist { HDF_set_part_elements_simple - create dataset and write element or HDF_set_part_elements connectivities (also store the number of elements in the dataset and the file layout) [HDF_set_part_element_ids] - create dataset and write element ids } } } [HDF_set_extents(PART)] - set the min/max extents for the part } [HDF_set_extents(MODEL)] - sets the min/max extents for the model So coordinate, element connectivity, and associated id datasets (as well as optional extents) can be added to the geometry side of the tree: /model | -------------------------------- | Geometry | [extent mins/maxs] ------------- ... | geom_part_1 | [extent mins/maxs] | ------------ ... | geom_domain_1 | [extent mins/maxs] | ------------------------------------------------------------------- | | | | | | | coordinates [node_ids] [point] [point_ids] [bar2] [bar2_ids] [...] layout layout layout nNodes nElems nElems D) Populate Variables: ------------------ for each variable { if(varType is model constant) { HDF_set_constant - stores the value } else { for each var_part { if(varType is part contant) { HDF_set_constant - stores the value } else { for each var_domain { HDF_set_part_variable_simple - if per_node mapping { or HDF_set_part_variable - create coordinates dataset and write the values at each node according to the var_type and layout specified. Also store the file layout. } else if per_element mapping { for each element type { - create dataset for that type and write the values for each element according to the var_type and layout specified. Also store the file layout. } } [HDF_set_ranges(DOMAIN)] - set the domain min/max range values } [HDF_set_ranges(PART)] - set the part min/max range values } [HDF_set_ranges(VAR)] - set the variable min/max range values } } } So coordinates (for nodal vars), element type (for elemental vars), and (as well as optional variable ranges) can be added to the variable side of the tree: /model | ------------------------------- | | | Variables | ------------------ ... | variable_1 | If not model or part constant | [range mins/maxs] | else | constValue | | | (if not a model constant) ------------- ... | var_part_1 | If not a part constant | [range mins/maxs] | else | constValue | | (if not a part constant) ------------ ... | var_domain_1 | [range mins/maxs] | ------------------------ ... | coordinates point bar2 ... layout layout layout E) Optional computations after the fact: ------------------------------------- (If you don't have the info as you go to use HDF_set_extents and/or HDF_set_ranges, you can use the following routines to have them determined for you.) HDF_set_computed_extents - computes and sets the proper bounding box extents for total model, all geom_parts and geom_domains. HDF_set_computed_ranges - computes and sets the proper variable ranges for all variables, var_parts, and var_domains. F) Close the file: --------------- HDF_close 3. If you have transient data, close the "casefile": HDF_stop_writing_casefile Note: the format of the casefile is: SPECIAL HDF5 CASEFILE (1st line, starting in 1st column) n (n = number of files) filename_1 (filename 1, etc. filename_2 Note: filenames must have full path!!) . . . filename_n Thus, the routines for writing are ---------------------------------- File ---- HDF_start_writing_casefile HDF_create HDF_close HDF_stop_writing_casefile Model ----- HDF_set_model_metadata Parts ----- HDF_set_part_metadata HDF_set_part_coords_simple HDF_set_part_coords HDF_set_part_coords_ids HDF_set_part_elements_simple HDF_set_part_elements HDF_set_part_elements_ids HDF_set_extents Variables --------- HDF_set_variable_metadata HDF_set_part_variable_simple HDF_set_part_variable HDF_set_ranges HDF_set_constant Other ----- HDF_set_computed_extents HDF_set_computed_ranges ===================================================================== READER ------ We do not specifically include the process for reading, but it is implied by the routines and the framework description. The following routines (most of which mirror ones for writing) are available to read the data: /* File related *--------------*/ HDF_read_transient_casefile HDF_open HDF_get_n_time_steps HDF_get_solution_times HDF_get_filenames HDF_close /* Model related */ HDF_get_model_metadata /* Part related */ HDF_get_part_metadata HDF_get_n_nodes HDF_get_part_coords_simple HDF_get_part_coords HDF_get_part_coords_layout HDF_get_part_coords_ids HDF_get_n_elements HDF_get_part_elements_simple HDF_get_part_elements HDF_get_part_elements_layout HDF_get_part_element_ids HDF_get_extents /* Variable related */ HDF_get_variable_metadata HDF_get_part_variable_simple HDF_get_part_variable HDF_get_part_variable_layout HDF_get_ranges HDF_get_constant =============================================================== =============================================================== What follows is the detail for each of the routines in the api. They are presented in alphabetical order: /*------------------------------------------------------------ * HDF_close *------------------------------------------------------------ * Closes the current hdf file. * * (IN) fileid = the fileid create in HDF_open * * Returns: nothing * * Notes: *------------------------------------------------------------*/ void HDF_close(hid_t fileId) /*------------------------------------------------------------ * HDF_create *------------------------------------------------------------ * creates the hdf file, including setting up: * all geom_part and geom_domain groups, and * all variable, var_part, and var_domain groups * * Expects the following routines to be called prior to this: * * HDF_set_model_metadata * HDF_set_part_metadata * HDF_set_variable_metadata * * (IN) fileName = The desired filename * * Returns: file_id = the id for the file, if successful * = Negative number, if unsuccessful * * Notes: *------------------------------------------------------------*/ hid_t HDF_create(char *fileName) /*------------------------------------------------------------ * HDF_get_constant *------------------------------------------------------------ * Gets the constant value for a model or part constant * * (IN) variableIndex = The constant variable to use (1, 2, 3, ...) * * (IN) partIndex = The var_part to use (1, 2, 3, ...), if * constant is PART_CONSTANT_HDFRW * * (OUT) constValue = The constant value * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_constant(int variableIndex, int partIndex, float *constValue) /*------------------------------------------------------------ * HDF_get_extents *------------------------------------------------------------ * Gets the model extents at various locations in the geometry tree. * * (IN) location = GEOM_MODEL_HDFRW, to get extents at the model * geometry level * * GEOM_PART_HDFRW, to get extents at the geom_part * level * * GEOM_DOMAIN_HDFRW, to get extents at the geom_domain * level * * (IN) partIndex = The part to use (1, 2, 3, ...), if location * is GEO_PART or GEOM_DOMAIN_HDFRW * * (IN) domainIndex = The part domain to use (1, 2, 3, ...), if location * is GEOM_DOMAIN_HDFRW * * (OUT) mins[3] = The min extent in the x, y, and z directions * * (OUT) maxs[3] = The max extent in the x, y, and z directions * * Returns: A_OK, if successful * A_ERR, if unsuccessful, or no extents stored. * * Notes: *------------------------------------------------------------*/ int HDF_get_extents(ExtentEnum location, int partIndex, int domainIndex, float mins[3], float maxs[3]) /*------------------------------------------------------------ * HDF_get_filenames *------------------------------------------------------------ * Gets the filenames in the transient casefile * * (OUT) filenames = array of filenames in the casefile, * augmented to have the current path * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_filenames(STR256 *filenames) /*------------------------------------------------------------ * HDF_get_model_metadata *------------------------------------------------------------ * Gets several metadata values that apply to the entire model. * * (OUT) nParts = Number of parts present in * the model. * * (OUT) nVariables = Number of variables present in * the model. * * (OUT) nDomains = Number of domains present in * the file for geometric parts * and for variables. * * (OUT) hasNodeIDs = TRUE, if node ids are provided. * FALSE, id no node ids * * (OUT) hasElementIDs = TRUE, if element ids are provided. * FALSE, id no element ids * * (OUT) modelDescription1 = First model description string * * (OUT) modelDescription2 = Second model description string * * (OUT) timeStep = the time step stamp in the file * * (OUT) timeValue = the solution time in the file * * (OUT) geomChangingFlag = STATIC_HDFRW, if geometry does not * change over time. * * COORDS_ONLY_HDFRW, if only the coordinates * of the model change * over time. * * CONN_HDFRW, if connectivity can change * over time. * * (OUT) writingConn = TRUE, if geometric connectivity * is contained in this file. * * FALSE, otherwise. (Could still have coords * in the file) * * (OUT) lastGeomFile = filename of the previous file * which contains geometric connectivity * (filename only - no path) * * first char will be NULL, if geometric * connectivity is in this file. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_model_metadata(int *nParts, int *nVariables, int *nDomains, int *hasNodeIds, int *hasElementIds, STR80 *modelDescription1, STR80 *modelDescription2, int *timeStep, float *timeValue, GeomVaryingEnum *geomChangingFlag, int *writingConn, STR256 *lastGeomFile) /*------------------------------------------------------------ * HDF_get_n_elements *------------------------------------------------------------ * Gets the number of elements of each type in part at a * particular location in the geometry tree * * (IN) location = GEOM_MODEL_HDFRW, to get number of elements at * the model geometry level * * GEOM_PART_HDFRW, to get the number of elements at * the geom_part level * * GEOM_DOMAIN_HDFRW, to get the number of elements at * the geom_domain level * * (IN) partIndex = The part to use (1, 2, 3, ...), if location * is GEOM_PART_HDFRW or GEOM_DOMAIN_HDFRW * * (IN) domainIndex = The part domain to use (1, 2, 3, ...), if location * is GEOM_DOMAIN_HDFRW * * (OUT) numElems[DEFINED_TYPES_HDFRW] = array of number of elements * of each type. * * Currently the types are: * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_n_elements(ExtentEnum location, int partIndex, int domainIndex, int numElems[DEFINED_TYPES]) /*------------------------------------------------------------ * HDF_get_n_nodes *------------------------------------------------------------ * Gets the number of nodes below a particular location * in the geometry tree * * (IN) location = GEOM_MODEL_HDFRW, to get number of nodes at the model * geometry level * * GEOM_PART_HDFRW, to get the number of nodes at the * geom_part level * * GEOM_DOMAIN_HDFRW, to get the number of nodes at the * geom_domain level * * (IN) partIndex = The part to use (1, 2, 3, ...), if location * is GEOM_PART_HDFRW or GEOM_DOMAIN_HDFRW * * (IN) domainIndex = The part domain to use (1, 2, 3, ...), if * location is DOMAIN * * Returns: number_of_nodes = the number of nodes below the specified * geometry tree location * Notes: *------------------------------------------------------------*/ int HDF_get_n_nodes(ExtentEnum location, int partIndex, int domainIndex) /*------------------------------------------------------------ * HDF_get_n_time_steps *------------------------------------------------------------ * Gets the number of time steps in the model. * * Returns: nsteps = The number of time steps in the model * * Notes: *------------------------------------------------------------*/ int HDF_get_n_time_steps(void) /*------------------------------------------------------------ * HDF_get_part_coords *------------------------------------------------------------ * Gets the node coordinate array for unstructured or structured * CURIVILINER data. * * This is done on a part_domain basis. * * IMPORTANT! This routine cannot be used for UNIFORM_HDFRW or * RECTILINEAR_HDFRW structured data. * Use HDF_get_part_coords_simple for these. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) component = XC_HDFRW if setting x component * YC_HDFRW if setting y component * ZC_HDFRW if setting z component * ALL_HDFRW if setting all three components * * coords array related: * --------------------- * (IN) num_comps = number of components present in coords array * * (IN) num_dims = 1 if 1D array * 2 if 2D array * etc. * * (IN) *dims = size of the dimensions of coords array * * if num_dims = 1, dims[0] must contain the length * of the 1D array * * = 2, dims[0] must contain the length * of the 1st dimension of * the 2D array * dims[1] must contain the length * of the 2nd dimension of * the 2D array * etc. * * (IN) start[][2] = offsets of start for each component and in each * dimension of coords array * * start[num_comps][num_dims] * * (IN) stride[][2] = stride for each component in each * dimension of coords array * * stride[num_comps][num_dims] * * (IN) count[][2] = number of blocks for each component in each * dimension of coords array * * count[num_comps][num_dims] * * (IN) block[][2] = size of block (chunk being written) for each * component in each dimension of coords array * * block[num_comps][num_dims] * * (OUT) *coords = The array to receive the coordinate values, * previously allocated according to the other * arguments of this routine. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * To get the size needed for this array, use HDF_get_n_nodes * with location of DOMAIN. * * Several examples: * * 1. (Destination in memory is: [xxxxxyyyyyzzzzz]) * filLayout = COMPONENT_ORDER_1D * nNodes = 5 * component = ALL_HDFRW * * num_comps = 3 * num_dims = 1 * dims[0] = 15 * num_comps = 3 * * start[0][0] = 0 * stride[0][0] = 1 * count[0][0] = 1 * block[0][0] = 5 * * start[1][0] = 5 * stride[1][0] = 1 * count[1][0] = 1 * block[1][0] = 5 * * start[2][0] = 10 * stride[2][0] = 1 * count[2][0] = 1 * block[2][0] = 5 * * Reads 15 values from [xxxxxyyyyyzzzzz] to [xxxxxyyyyyzzzzz] * * 2. (Destination in memory is: [yyyyy]) * filLayout = COMPONENT_ORDER_1D * nNodes = 5 * component = YC_HDFRW * * num_comps = 1 * num_dims = 1 * dims[0] = 5 * * start[0][0] = 0 * stride[0][0] = 1 * count[0][0] = 1 * block[0][0] = 5 * * Reads 5 values from [ yyyyy ] to [yyyyy] * * 3. (Destination in memory is: [xxxxxyyyyyzzzzz]) * filLayout = INTERLACE_ORDER_1D * nNodes = 5 * component = ALL_HDFRW * * num_comps = 3 * num_dims = 1 * dims[0] = 15 * * start[0][0] = 0 * stride[0][0] = 1 * count[0][0] = 1 * block[0][0] = 5 * * start[1][0] = 5 * stride[1][0] = 1 * count[1][0] = 1 * block[1][0] = 5 * * start[2][0] = 10 * stride[2][0] = 1 * count[2][0] = 1 * block[2][0] = 5 * * Reads 15 values from [xyzxyzxyzxyzxyz] to [xxxxxyyyyyzzzzz] * * 4. (Destination in memory is: ----- * | xyz | * | xyz | * | xyz | * | xyz | * | xyz | * ----- ) * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ZC_HDFRW * * num_comps = 3 * num_dims = 2 * dims[0] = 5 dims[1] = 3 * * start[0][0] = 0 start[0][1] = 0 | * stride[0][0] = 1 stride[0][1] = 1 | * count[0][0] = 5 count[0][1] = 1 | * block[0][0] = 1 block[0][1] = 1 | These not actullay used in this * | case since only Z component is * start[1][0] = 0 start[1][1] = 1 | being read. * stride[1][0] = 1 stride[1][1] = 1 | * count[1][0] = 5 count[1][1] = 1 | * block[1][0] = 1 block[1][1] = 1 | * * start[2][0] = 0 start[2][1] = 2 * stride[2][0] = 1 stride[2][1] = 1 * count[2][0] = 5 count[2][1] = 1 * block[2][0] = 1 block[2][1] = 1 * * Reads 5 values from ------- to ----- * | | | z | * | | | z | * | zzzzz | | z | * ------- | z | * | z | * ----- * 5. (Destination in memory is: ------- * | qqqqq | * | xxxxx | * | yyyyy | * | zzzzz | * | sssss | * | vvvvv | * ------- ) * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ALL_HDFRW * * num_comps = 3 * num_dims = 2 * dims[0] = 6 dims[1] = 5 * * x: * start[0][0] = 1 start[0][1] = 0 * stride[0][0] = 1 stride[0][1] = 1 * count[0][0] = 1 count[0][1] = 1 * block[0][0] = 1 block[0][1] = 5 * * y: * start[1][0] = 2 start[1][1] = 0 * stride[1][0] = 1 stride[1][1] = 1 * count[1][0] = 1 count[1][1] = 1 * block[1][0] = 1 block[1][1] = 5 * * z: * start[2][0] = 3 start[2][1] = 0 * stride[2][0] = 1 stride[2][1] = 1 * count[2][0] = 1 count[2][1] = 1 * block[2][0] = 1 block[2][1] = 5 * * Reads 15 values from ------- to ------- * | xxxxx | | | * ==> | yyyyy | | xxxxx | * ==> | zzzzz | | yyyyy | * ==> ------- | zzzzz | * | | * | | * ------- * etc. *------------------------------------------------------------*/ int HDF_get_part_coords(int partIndex, int domainIndex, CompEnum component, int num_comps, int num_dims, int *dims, int start[][2], int stride[][2], int count[][2], int block[][2], float *coords) /*------------------------------------------------------------ * HDF_get_part_coords_ids *------------------------------------------------------------ * Gets the node id array. * This is done on a part_domain basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (OUT) coordIDs = The node ids of the part domain * (0-based 1D array, number of nodes in the * part long). * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * To get the size needed for this array, use HDF_get_n_nodes * with location of DOMAIN. *------------------------------------------------------------*/ int HDF_get_part_coords_ids(int partIndex, int domainIndex, int *coordIDs) /*------------------------------------------------------------ * HDF_get_part_coords_layout *------------------------------------------------------------ * Gets the layout of the part coordinate array. * This is done on a part_domain basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (OUT) storedLayout = The layout of the stored coordinates * * layout = COMPONENT_ORDER_1D if: [xxxx...yyyy...zzzz] * * INTERLACE_ORDER_1D if: [xyzxyzxyz... ] * * N_BY_COMP_2D if: ------- * | x y z | * | x y z | * | x y z | * | . . . | * | . . . | * | . . . | * ------- * * COMP_BY_N_2D if: --------------------- * | xxx... | * | yyy... | * | zzz... | * --------------------- * * (OUT) nNodes = The number of nodes in the coordinate dataset * * (OUT) nent = What is stored in nNodes attribute * If unstructured: will be nNodes * If structured, CURVILINEAR_HDFRW: will be nNodes * If structured, RECTLINEAR: will be i+j+k * If structured, UNIFORM_HDFRW, will be 6 * * Only set or useful for structured data * -------------------------------------- * (OUT) nElems = Number of elements, namely (i-1)*(j-1)*(j-1); * * (OUT) elemType = HEX08_HDFRW, * QUA04_HDFRW, or * BAR02_HDFRW as appropriate * * (OUT) IJKranges = [0] = mini * [1] = maxi * [2] = minj * [3] = maxj * [4] = mink * [5] = maxk * * Each of these are 1-based. * * example 1: * * ------------------- mini = 1 * | | | | | maxi = 5 * | | | | | minj = 1 * |----|----|----|----| maxj = 3 * | | | | | mink = 1 * | | | | | maxk = 1 * ------------------- * * * example 2 (portion of whole): * * ......----........... mini = 2 * . | | . . maxi = 3 * . | | . . minj = 1 * .....|----|.......... maxj = 3 * . | | . . mink = 1 * . | | . . maxk = 1 * ......----........... * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * To get the size needed for this array, use HDF_get_n_nodes * with location of DOMAIN. *------------------------------------------------------------*/ int HDF_get_part_coords_layout(int partIndex, int domainIndex, LayoutEnum *storedLayout, int *nNodes, int *nent, int *nElems, int *elemType, int ijkranges[6]) /*------------------------------------------------------------ * HDF_get_part_coords_simple *------------------------------------------------------------ * Gets the node coordinate array for structured or unstructured data. * This is done on a part_domain basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) component = XC_HDFRW if setting x component * YC_HDFRW if setting y component * ZC_HDFRW if setting z component * ALL_HDFRW if setting all three components * * (IN) memLayout = The layout of the memory that is * being written into. * * For structuredUNIFORM_HDFRW: * The data must be a six number array * * [ x y z dx dy dz ] * * where: x, y, z are the coordinates of the ijk origin * * dx, dy, dz are the delta values in each of the * ijk directions. * * So, the memLayout argument will be ignored, and will * be set to a 1D layout, arbitrarily COMPONENT_ORDER_1D * * For structured RECTILINEAR_HDFRW: * The data must be an array i+j+k numbers long * * [ x1 x2 ... xi y1 y2 ... yj z1 z2 ... zk ] * * where: there will be i number of x values, followed by * j number of y values, followed by * k number of z values. * * So, the memLayout argument will be ignored, and will be * set to a 1D layout, arbitrarily COMPONENT_ORDER_1D * * For structured CURVILINEAR_HDFRW or unstructured: * The data can be any of the normal layouts * So, the memLayout argument will be used! * * layout = COMPONENT_ORDER_1D if: [xxxx...yyyy...zzzz] * * INTERLACE_ORDER_1D if: [xyzxyzxyz... ] * * N_BY_COMP_2D if: ------- * | x y z | * | x y z | * | x y z | * | . . . | * | . . . | * | . . . | * ------- * * COMP_BY_N_2D if: --------------------- * | xxx... | * | yyy... | * | zzz... | * --------------------- * * SINGLE_COMPONENT_1D if: [xxx...] or [yyy...] or [zzz...] * * * (OUT) coords = The xyz coordinates of the part domain, previously * allocated as described in memLayout * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * To get the size needed for this array, use HDF_get_n_nodes * with location of DOMAIN. * * For obvious efficiency reasons, whenever you can keep the destination and * source layouts the same - you should do so. * * Several examples: * * 1. (Destination in memory is: [xxxxxyyyyyzzzzz]) * filLayout = COMPONENT_ORDER_1D * nNodes = 5 * component = ALL_HDFRW * memLayout = COMPONENT_ORDER_1D * * Reads 15 values from [xxxxxyyyyyzzzzz] to [xxxxxyyyyyzzzzz] * * 2. (Destination in memory is: [xxxxxyyyyyzzzzz]) * filLayout = INTERLACE_ORDER_1D * nNodes = 5 * component = ALL_HDFRW * memLayout = COMPONENT_ORDER_1D * * Reads 15 values from [xyzxyzxyzxyzxyz] to [xxxxxyyyyyzzzzz] * * 3. (Destination in memory is: [xxxxxyyyyyzzzzz]) * filLayout = INTERLACE_ORDER_1D * nNodes = 5 * component = YC_HDFRW * memLayout = COMPONENT_ORDER_1D * * Reads 5 values from [ y y y y y ] to [ yyyyy ] * * 4. (Destination in memory is: [xxxxx]) * filLayout = INTERLACE_ORDER_1D * nNodes = 5 * component = XC_HDFRW * memLayout = SINGLE_COMPONENT_1D * * Reads 5 values from [x x x x x ] to [xxxxx] * * 5. (Destination in memory is: [xxxxxyyyyyzzzzz]) * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ALL_HDFRW * memLayout = COMPONENT_ORDER_1D * * Reads 15 values from ------- to [xxxxxyyyyyzzzzz] * | xxxxx | * | yyyyy | * | zzzzz | * ------- * 6. (Destination in memory is: ----- * | xyz | * | xyz | * | xyz | * | xyz | * | xyz | * ----- ) * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ZC_HDFRW * memLayout = N_BY_COMP_2D * * Reads 5 values from ------- to ----- * | | | z | * | | | z | * | zzzzz | | z | * ------- ----- * etc. *------------------------------------------------------------*/ int HDF_get_part_coords_simple(int partIndex, int domainIndex, CompEnum component, LayoutEnum memLayout, float *coords) /*------------------------------------------------------------ * HDF_get_part_elements *------------------------------------------------------------ * Gets the element connectivities array. * This is done on a part_domain - element_type basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) elementType = The element type: * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * connectivity array related: * --------------------------- * (IN) num_dims = 1 if 1D array * 2 if 2D array * etc. * * Note: num_comps for this routine will be the number of nodes * per element type. * * (IN) *dims = size of the dimensions of connectivity array * * if num_dims = 1, dims[0] must contain the length * of the 1D array * * = 2, dims[0] must contain the length * of the 1st dimension of * the 2D array * dims[1] must contain the length * of the 2nd dimension of * 2D array * etc. * * (IN) start[][2] = offsets of start for each component and in each * dimension of connectivity array * * start[num_comps][num_dims] * * (IN) stride[][2] = stride for each component in each * dimension of connectivity array * * stride[num_comps][num_dims] * * (IN) count[][2] = number of blocks for each component in each * dimension of connectivity array * * count[num_comps][num_dims] * * (IN) block[][2] = size of block (chunk being written) for each * component in each dimension of connectivity array * * block[num_comps][num_dims] * * (OUT) connectivity = The connectivity array for the domain and type, * previously allocated according to the other * arguments of this function * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: The number of elements of the type comes from the * HDF_get_n_elements routine at a DOMAIN location. * In general, the length of the array is number of elements * of the type times the number of nodes per element of the type. * (nsided, nfaced will vary from this) *------------------------------------------------------------*/ int HDF_get_part_elements(int partIndex, int domainIndex, int elementType, int num_dims, int *dims, int start[][2], int stride[][2], int count[][2], int block[][2], int *connectivity) /*------------------------------------------------------------ * HDF_get_part_element_ids *------------------------------------------------------------ * Gets the element id array. * This is done on a part_domain - element_type basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) elementType = The element type: * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (OUT) elementIds = The element id array for the domain and type * (0-based 1D array, with length equal to the * number of elements of that type in the part) * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: The number of elements of the type comes from the * HDF_get_n_elements routine at a DOMAIN location. *------------------------------------------------------------*/ int HDF_get_part_element_ids(int partIndex, int domainIndex, int elementType, int *elementIds) /*------------------------------------------------------------ * HDF_get_part_element_layout *------------------------------------------------------------ * Gets the layout of the part connectivity array. * This is done on a part_domain basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) elementType = The element type * * (OUT) storedLayout = The layout of the stored connectivity * * (For simplicity, indications are for 3-noded triangles. For other * elements the number of nodes per element will vary) * * layout = COMPONENT_ORDER_1D if: [n1 n1 n1... n2 n2 n2 ... n3 n3 n3 ...] * * INTERLACE_ORDER_1D if: [n1 n2 n3 n1 n2 n3 . . . ] * * * #nodes/elem * N_BY_COMP_2D if: ---------- * | n1 n2 n3 | (Tri1) * | n1 n2 n3 | (Tri2) * num elems | n1 n2 n3 | (Tri3) * | . . . | . * | . . . | . * | . . . | . * ---------- * * num elems * COMP_BY_N_2D if: --------------------- * | n1 n1 n1 . . . | * #nodes/elem | n2 n2 n2 . . . | * | n3 n3 n3 . . . | * --------------------- * T T T * r r r * i i i . . . * 1 2 3 * * (OUT) numOfType = The number of elements in the dataset * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * To get the size needed for this array, use HDF_get_n_nodes * with location of DOMAIN. *------------------------------------------------------------*/ int HDF_get_part_element_layout(int partIndex, int domainIndex, int elementType, LayoutEnum *storedLayout, int *numOfType) /*------------------------------------------------------------ * HDF_get_part_elements_simple *------------------------------------------------------------ * Gets the element connectivities array. * This is done on a part_domain - element_type basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) elementType = The element type: * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (IN) memLayout = The layout of the memory space being written to. * * (For simplicity, indications are for 3-noded triangles. For other * elements the number of nodes per element will vary) * * layout = COMPONENT_ORDER_1D if: [n1 n1 n1... n2 n2 n2 ... n3 n3 n3 ...] * * INTERLACE_ORDER_1D if: [n1 n2 n3 n1 n2 n3 . . . ] * * * #nodes/elem * N_BY_COMP_2D if: ---------- * | n1 n2 n3 | (Tri1) * | n1 n2 n3 | (Tri2) * num elems | n1 n2 n3 | (Tri3) * | . . . | . * | . . . | . * | . . . | . * ---------- * * num elems * COMP_BY_N_2D if: --------------------- * | n1 n1 n1 . . . | * #nodes/elem | n2 n2 n2 . . . | * | n3 n3 n3 . . . | * --------------------- * T T T * r r r * i i i . . . * 1 2 3 * * Note: Not allowing SINGLE_COMPONENT_1D layout for this routine. * It is required to write in an ALL_HDFRW nodes per element fashion. * * (OUT) connectivity = The connectivity array for the domain and type, * previously allocated according to memLayout * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: The number of elements of the type comes from the * HDF_get_n_elements routine at a DOMAIN location. * In general, the length of the array is number of elements * of the type times the number of nodes per element of the type. * (nsided, nfaced will vary from this) *------------------------------------------------------------*/ int HDF_get_part_elements_simple(int partIndex, int domainIndex, int elementType, LayoutEnum memLayout, int *connectivity) /*------------------------------------------------------------ * HDF_get_part_metadata *------------------------------------------------------------ * Gets the label (or name), and the description for the part * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (OUT) partName = The part's name or label * * (OUT) partDescription = The part's description * * (OUT) structuredFlag = UNSTRUCTURED_HDFRW for unstructured parts * STRUCTURED_HDFRW for structured parts * * The following are used only if the part is STRUCTURED_HDFRW * * (OUT) structuredType = UNIFORM_HDFRW = origin and deltas only * (6 floats) * * RECTILINEAR_HDFRW = 3 vectors * * CURIVILINEAR = all points provided * in I then J then K order * by components * * (OUT) iblankingVarName = name of the PER_NODE_HDFRW variable which * contains iblanking values. * First char is NULL if no iblanking in part * * (OUT) ghostVarName = name of the PER_ELEM_HDFRW variable which * contains ghost cell flags. * First char is NULL if no ghost cells in part * * (OUT) structuredIJKs = The IJK dimensions of the structured * block (1-based) * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_part_metadata(int partIndex, STR80 *partName, STR80 *partDescription, StructEnum *structuredFlag, StructTypeEnum *structuredType, STR80 *iblankingVarName, STR80 *ghostVarName, int structuredIJKs[3]) /*------------------------------------------------------------ * HDF_get_part_variable *------------------------------------------------------------ * Gets variable values from the file on a var_domain basis. * It can further be according to component - based on variable * order. * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (IN) partIndex = The part to use (1, 2, 3, ...), which * will be the var_part also - since * the geom_parts and var_parts relate. * * (IN) domainIndex = The variable domain to use (1, 2, 3, ...) * * (IN) elementType = The element type. It is not used * if PER_NODE_HDFRW variable. * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (IN) component = component being read. * * For Scalars: [v] * Ignores input, and sets to ALL_HDFRW * * For vectors: [x, y, z] * XC_HDFRW if x component * YC_HDFRW if y component * ZC_HDFRW if z component * ALL_HDFRW if all components * * For tensors: ------------- * | a11 a12 a13 | * | a21 a22 a23 | * | a31 a32 a33 | * ------------- * T11_HDFRW if a11 component * T12_HDFRW if a12 component * T13_HDFRW if a13 component * T21_HDFRW if a21 component * T22_HDFRW if a22 component * T23_HDFRW if a23 component * T31_HDFRW if a31 component * T32_HDFRW if a32 component * T33_HDFRW if a33 component * ALL_HDFRW if all components * * values array related: * --------------------- * (IN) num_comps = number of components present in values array * * (IN) num_dims = 1 if 1D array * 2 if 2D array * etc. * * (IN) *dims = size of the dimensions of values array * * if num_dims = 1, dims[0] must contain the length * of the 1D array * * = 2, dims[0] must contain the length * of the 1st dimension of * the 2D array * dims[1] must contain the length * of the 2nd dimension of * the 2D array * etc. * * (IN) start[][2] = offsets of start for each component and in each * dimension of values array * * start[num_comps][num_dims] * * (IN) stride[][2] = stride for each component in each * dimension of values array * * stride[num_comps][num_dims] * * (IN) count[][2] = number of blocks for each component in each * dimension of values array * * count[num_comps][num_dims] * * (IN) block[][2] = size of block (chunk being written) for each * component in each dimension of values array * * block[num_comps][num_dims] * * (OUT) values = The variable values, previously allocated * according to the other arguments of this * function. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_part_variable(int variableIndex, int partIndex, int domainIndex, int elementType, CompEnum component, int num_comps, int num_dims, int *dims, int start[][2], int stride[][2], int count[][2], int block[][2], void *values) /*------------------------------------------------------------ * HDF_get_part_variable_layout *------------------------------------------------------------ * Gets the layout of the variable values array. * This is done on a var_domain basis. * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (IN) partIndex = The var_part to use (1, 2, 3, ...) * * (IN) domainIndex = The var_domain to use (1, 2, 3, ...) * * (IN) elementType = The element type. It is not used * if PER_NODE_HDFRW variable. * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (OUT) storedLayout = The layout of the stored values * * layout = COMPONENT_ORDER_1D if: [xxxx...yyyy...zzzz] * * INTERLACE_ORDER_1D if: [xyzxyzxyz... ] * * N_BY_COMP_2D if: ------- * | x y z | * | x y z | * | x y z | * | . . . | * | . . . | * | . . . | * ------- * * COMP_BY_N_2D if: --------------------- * | xxx... | * | yyy... | * | zzz... | * --------------------- * * (OUT) nEntities = The number of nodes or elements in the * variable dataset * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_part_variable_layout(int variableIndex, int partIndex, int domainIndex, int elementType, LayoutEnum *storedLayout, hid_t *dataType, int *nEntities) /*------------------------------------------------------------ * HDF_get_part_variable_simple *------------------------------------------------------------ * Gets variable values from the file on a var_domain basis. * It can further be according to component - based on variable * order. * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (IN) partIndex = The part to use (1, 2, 3, ...), which * will be the var_part also - since * the geom_parts and var_parts relate. * * (IN) domainIndex = The variable domain to use (1, 2, 3, ...) * * (IN) elementType = The element type. It is not used * if PER_NODE_HDFRW variable. * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (IN) component = component being written. * * For Scalars: [v] * Ignores input, and sets to ALL_HDFRW * * For vectors: [x, y, z] * XC_HDFRW if x component * YC_HDFRW if y component * ZC_HDFRW if z component * ALL_HDFRW if all components * * For tensors: ------------- * | a11 a12 a13 | * | a21 a22 a23 | * | a31 a32 a33 | * ------------- * T11_HDFRW if a11 component * T12_HDFRW if a12 component * T13_HDFRW if a13 component * T21_HDFRW if a21 component * T22_HDFRW if a22 component * T23_HDFRW if a23 component * T31_HDFRW if a31 component * T32_HDFRW if a32 component * T33_HDFRW if a33 component * ALL_HDFRW if all components * * (IN) memLayout = The layout of the memory space being written from. * (see description of layout values below) * * (For simplicity, indications are for vector. * * layout = COMPONENT_ORDER_1D if: [vx vx vx... vy vy vy... vz vz vz...] * * INTERLACE_ORDER_1D if: [vx vy vz vx vy vz . . . ] * * * # components * N_BY_COMP_2D if: ---------- * | vx vy vz | * | vx vy vz | * num entities | vx vy vz | * | . . . | * | . . . | * | . . . | * ---------- * * num entities * COMP_BY_N_2D if: --------------------- * | vx vx vx . . . | * # components | vy vy vy . . . | * | vz vz vz . . . | * --------------------- * * (only available for memLayout) * SINGLE_COMPONENT_1D if: [vx vx vx ...] or * [vy vy vy ...] etc. * * (OUT) values = The variable values, previously allocated * according to memLayout * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_part_variable_simple(int variableIndex, int partIndex, int domainIndex, int elementType, CompEnum component, LayoutEnum memLayout, void *values) /*------------------------------------------------------------ * HDF_get_ranges *------------------------------------------------------------ * Gets the variable ranges for non-constant variables, if provided. * This can be at various locations in the variable tree. * * (IN) location = VARIABLE_HDFRW, to get ranges at the * variable level * * VARIABLE_PART_HDFRW, to get ranges at the * var_part level * * VARIABLE_DOMAIN_HDFRW, to get ranges at the * var_domain level * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (IN) partIndex = The var_part to use (1, 2, 3, ...), if * location is VARIABLE_PART_HDFRW * or VARIABLE_DOMAIN_HDFRW * * (IN) domainIndex = The var_domain to use (1, 2, 3, ...), if location * is VARIABLE_DOMAIN_HDFRW * * (OUT) mins[9] = The range mins for the appropriate variable * components. * (OUT) maxs[9] = The range maxs for the appropriate variable * components * * The components are: * 0 (for scalar variables) * * 0 (for vector variables) * 1 * 2 * * 0 (for 6 component tensor variables) * 1 * 2 * 3 * 4 * 5 * * 0 (for 9 component tensor variables) * 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * * Returns: A_OK, if successful * A_ERR, if unsuccessful, or no ranges stored. * * Notes: *------------------------------------------------------------*/ int HDF_get_ranges(RangeEnum location, int variableIndex, int partIndex, int domainIndex, float mins[9], float maxs[9]) /*------------------------------------------------------------ * HDF_get_solution_times *------------------------------------------------------------ * Gets the solution times for the number of time steps in the * model. * * Currently these will be found by file examination of the * files indicated in the casefile - because each hdf file * contains only one time step. * * (OUT) times = array of time values. * (array is 0-based 1D array, NumTimeSteps long) * * time values should be zero or positive and increasing * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_solution_times(float *times) /*------------------------------------------------------------ * HDF_get_variable_metadata *------------------------------------------------------------ * Gets attributes of variables * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (OUT) varName = The name of the variable * * (OUT) varDescription = Description line for the variable * * (OUT) mappingType = PER_NODE_HDFRW, if the variable is mapped * to the nodes * * PER_ELEM_HDFRW, if the variable is mapped * to the elements * * (OUT) varType = MODEL_CONSTANT_HDFRW * PART_CONSTANT_HDFRW * SCALAR_HDFRW * VECTOR_HDFRW * TENSOR6_HDFRW * TENSOR9_HDFRW * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_get_variable_metadata(int variableIndex, STR80 *varName, STR80 *varDescription, MappingEnum *mappingType, VarTypeEnum *varType) /*------------------------------------------------------------ * HDF_open *------------------------------------------------------------ * Opens an hdf file for reading * * (IN) fileName = The desired filename (with full path) * * Returns: file_id = the id for the file, if successful * = Negative number, if unsuccessful * * Notes: *------------------------------------------------------------*/ hid_t HDF_open(char *fileName) /*------------------------------------------------------------ * HDF_read_transient_casefile *------------------------------------------------------------ * Opens and reads the transient info from the casefile * * (IN) caseFileName = the full path filename of the casefile * to read. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_read_transient_casefile(char *caseFileName) /*------------------------------------------------------------ * HDF_set_computed_extents *------------------------------------------------------------ * Can be called after a file has been populated with * geometry to determine the extents at all interesting locations. * Namely, at the Geometry, geom_part, and geom_domain levels. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_set_computed_extents(void) /*------------------------------------------------------------ * HDF_set_computed_ranges *------------------------------------------------------------ * Can be called after a file has been populated with * variables to determine the ranges at all interesting locations. * Namely, at the Variable, var_part, and var_domain levels. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * 1. It obviously does not set ranges for either MODEL_CONSTANT_HDFRW * or PART_CONSTANT_HDFRW variables. *------------------------------------------------------------*/ int HDF_set_computed_ranges(void) /*------------------------------------------------------------ * HDF_set_constant *------------------------------------------------------------ * Sets the constant value for a model or part constant * * (IN) variableIndex = The constant variable to use (1, 2, 3, ...) * * (IN) partIndex = The var_part to use (1, 2, 3, ...), if * constant is PART_CONSTANT_HDFRW * * (IN) constValue = The constant value * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * The HDF_set_variable_metadata and the HDF_create routines * must have been called previous to this routine. *------------------------------------------------------------*/ int HDF_set_constant(int variableIndex, int partIndex, float constValue) /*------------------------------------------------------------ * HDF_set_extents *------------------------------------------------------------ * If known, the model extents can be provided. This can be * at various locations in the geometry tree. * * (IN) location = GEOM_MODEL_HDFRW, to set extents at the model geometry * level * * GEOM_PART_HDFRW, to set extents at the geom_part level * * GEOM_DOMAIN_HDFRW, to set extents at the geom_domain * level * * (IN) partIndex = The part to use (1, 2, 3, ...), if location * is GEOM_PART_HDFRW or GEOM_DOMAIN_HDFRW * * (IN) domainIndex = The part domain to use (1, 2, 3, ...), if location * is GEOM_DOMAIN_HDFRW * * (IN) mins[3] = The min extent in the x, y, and z directions * * (IN) maxs[3] = The max extent in the x, y, and z directions * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * If the extents are not known, the following routine can * be called after the file has been populated - and the * extents will be determined: * HDF_set_computed_extents *------------------------------------------------------------*/ int HDF_set_extents(ExtentEnum location, int partIndex, int domainIndex, float mins[3], float maxs[3]) /*------------------------------------------------------------ * HDF_set_model_metadata *------------------------------------------------------------ * Sets several metadata values that apply to the entire model. * (These will be needed when HDF_create is called.) * * (IN) nParts = The number of parts in the model * * (IN) nVariables = The number of variables in the model * * (IN) nDomains = Number of domains present in * the file for geometric parts * and for variables. * * (IN) hasNodeIDs = TRUE, if node ids will be provided in file * FALSE, id no node ids * * (IN) hasElementIDs = TRUE, if element ids will be provided in file * FALSE, id no element ids * * (IN) modelDescription1 = First model description string * * (IN) modelDescription2 = Second model description string * * (IN) timeStep = the time step stamp for the file * * (IN) timeValue = the solution time for the file * * (IN) geomChangingFlag = STATIC_HDFRW, if geometry does not * change over time. * * COORDS_ONLY_HDFRW, if only the coordinates * of the model change * over time. * * CONN_HDFRW, if connectivity can change * over time. * * (IN) writingConn = TRUE, if geometric connectivity * will be written in this file. * * FALSE, otherwise. (Could still have coordinate * data in the file) * * (IN) lastGeomFile = filename of the previous file * which contains geometric connectivity. * (filename only - no path. The path will come * will come from the path used when the file(s) * are read. This provides for mobility.) * * first character should be set to NULL, if * geometric connectivity is in this file. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * * 1. Needs to be called before HDF_create * * The following are valid combination of arguments for changing geom: * * geomChangingFlag writingConn lastGeomFile where is conn where is coord * ---------------- ----------- ------------ ------------- -------------- * STATIC_HDFRW TRUE NULL in this file in this file * STATIC_HDFRW FALSE "filename" in "filename" in "filename" * COORDS_ONLY_HDFRW TRUE NULL in this file in this file * COORDS_ONLY_HDFRW FALSE "filename" in "filename" in this file * CONN_HDFRW TRUE NULL in this file in this file *------------------------------------------------------------*/ int HDF_set_model_metadata(int nParts, int nVariables, int nDomains, int hasNodeIDs, int hasElementIDs, STR80 modelDescription1, STR80 modelDescription2, int timeStep, float timeValue, GeomVaryingEnum geomChangingFlag, int writingConn, STR256 lastGeomFile) /*------------------------------------------------------------ * HDF_set_part_coords *------------------------------------------------------------ * Creates coordinate dataset and writes coordinates. * This is done on a part_domain basis. * * This routine gives more control over the writing from the * source layout to the destination layout for unstructured * parts or CURVILINEAR_HDFRW structured parts. Use whenever the * HDF_set_part_coords_simple routine is not sufficient. * * For structured parts, the "coordinates" will consist of: * the origin and deltas (6 numbers) if UNIFORM_HDFRW, * the 3 ijk vectors (i+j+k numbers) if RECTILINEAR_HDFRW, or * all the coordinates(3 * i*j*k numbers) if CURVILINEAR_HDFRW. * * IMPORTANT! This cannot be used for structured UNIFORM_HDFRW or * RECTILINEAR_HDFRW paarts. For these use * HDF_set_part_coords_simple. * * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) filLayout = The layout of the file space being written to. * (see description of layout values below) * * layout = COMPONENT_ORDER_1D if: [xxxx...yyyy...zzzz] * * INTERLACE_ORDER_1D if: [xyzxyzxyz... ] * * N_BY_COMP_2D if: ------- * | x y z | * | x y z | * | x y z | * | . . . | * | . . . | * | . . . | * ------- * * COMP_BY_N_2D if: --------------------- * | xxx... | * | yyy... | * | zzz... | * --------------------- * * (IN) nNodes = Number of nodes (for unstructured parts) * * (IN) ijkranges = [0] = mini (for structured parts) * [1] = maxi * [2] = minj * [3] = maxj * [4] = mink * [5] = maxk * * Each of these are 1-based. * * example 1: * * ------------------- mini = 1 * | | | | | maxi = 5 * | | | | | minj = 1 * |----|----|----|----| maxj = 3 * | | | | | mink = 1 * | | | | | maxk = 1 * ------------------- * * * example 2 (portion of whole): * * ......----........... mini = 2 * . | | . . maxi = 3 * . | | . . minj = 1 * .....|----|.......... maxj = 3 * . | | . . mink = 1 * . | | . . maxk = 1 * ......----........... * * * * (IN) component = XC_HDFRW if setting x component * YC_HDFRW if setting y component * ZC_HDFRW if setting z component * ALL_HDFRW if setting all three components * * coords array related: * --------------------- * (IN) num_comps = number of components present in coords array * (This determines the first dimension of the * start, stride, etc. arrays. * * NOTE, Currently must be either 1, or all of the * the components!!) * * (IN) num_dims = 1 if 1D array * 2 if 2D array * etc. * * (IN) *dims = size of the dimensions of coords array * * if num_dims = 1, dims[0] must contain the length of * the 1D array * * = 2, dims[0] must contain the length of * the 1st dimension of * the 2D array * dims[1] must contain the length of * the 2nd dimension of * the 2D array * etc. * * * (IN) start[][2] = offsets of start for each component and in each * dimension of coords array * * start[num_comps][num_dims] * * (IN) stride[][2] = stride for each component in each * dimension of coords array * * stride[num_comps][num_dims] * * (IN) count[][2] = number of blocks for each component in each * dimension of coords array * * count[num_comps][num_dims] * * (IN) block[][2] = size of block (chunk being written) for each * component in each dimension of coords array * * block[num_comps][num_dims] * * (IN) *coords = The array containing coordinates or coordinate * components of the part domain, as described by the * other arguments of this routine. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * * Several examples: * * 1. (Source is: [xxxxxyyyyyzzzzz]) * filLayout = COMPONENT_ORDER_1D * nNodes = 5 * component = ALL_HDFRW * * num_comps = 3 * num_dims = 1 * dims[0] = 15 * num_comps = 3 * * start[0][0] = 0 * stride[0][0] = 1 * count[0][0] = 1 * block[0][0] = 5 * * start[1][0] = 5 * stride[1][0] = 1 * count[1][0] = 1 * block[1][0] = 5 * * start[2][0] = 10 * stride[2][0] = 1 * count[2][0] = 1 * block[2][0] = 5 * * Writes 15 values from [xxxxxyyyyyzzzzz] to [xxxxxyyyyyzzzzz] * * 2. (Source is: [yyyyy]) * filLayout = COMPONENT_ORDER_1D * nNodes = 5 * component = YC_HDFRW * * num_comps = 1 * num_dims = 1 * dims[0] = 5 * * start[0][0] = 0 * stride[0][0] = 1 * count[0][0] = 1 * block[0][0] = 5 * * Writes 5 values from [yyyyy] to [ yyyyy ] * * 3. (Source is: [xxxxxyyyyyzzzzz]) * filLayout = INTERLACE_ORDER_1D * nNodes = 5 * component = ALL_HDFRW * * num_comps = 3 * num_dims = 1 * dims[0] = 15 * * start[0][0] = 0 * stride[0][0] = 1 * count[0][0] = 1 * block[0][0] = 5 * * start[1][0] = 5 * stride[1][0] = 1 * count[1][0] = 1 * block[1][0] = 5 * * start[2][0] = 10 * stride[2][0] = 1 * count[2][0] = 1 * block[2][0] = 5 * * Writes 15 values from [xxxxxyyyyyzzzzz] to [xyzxyzxyzxyzxyz] * * 4. (source is: ----- * | xyz | * | xyz | * | xyz | * | xyz | * | xyz | * ----- ) * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ZC_HDFRW * * num_comps = 3 * num_dims = 2 * dims[0] = 5 dims[1] = 3 * * start[0][0] = 0 start[0][1] = 0 | * stride[0][0] = 1 stride[0][1] = 1 | * count[0][0] = 5 count[0][1] = 1 | * block[0][0] = 1 block[0][1] = 1 | These not actually used in this * | case since only ZC_HDFRW * start[1][0] = 0 start[1][1] = 1 | component is being written. * stride[1][0] = 1 stride[1][1] = 1 | * count[1][0] = 5 count[1][1] = 1 | * block[1][0] = 1 block[1][1] = 1 | * * start[2][0] = 0 start[2][1] = 2 * stride[2][0] = 1 stride[2][1] = 1 * count[2][0] = 5 count[2][1] = 1 * block[2][0] = 1 block[2][1] = 1 * * Writes 5 values from ----- to ------- * | z | | | * | z | | | * | z | | zzzzz | * | z | ------- * | z | * ----- * * Could actually also have specified it as: * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ZC_HDFRW * * num_comps = 1 (claiming only that 1 component is in the data) * num_dims = 2 * dims[0] = 5 dims[1] = 3 * * start[0][0] = 0 start[0][1] = 2 * stride[0][0] = 1 stride[0][1] = 1 * count[0][0] = 5 count[0][1] = 1 * block[0][0] = 1 block[0][1] = 1 * * * 5. (source is: ------- * | qqqqq | * | xxxxx | * | yyyyy | * | zzzzz | * | sssss | * | vvvvv | * ------- ) * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ALL_HDFRW * * num_comps = 3 * num_dims = 2 * dims[0] = 6 dims[1] = 5 * * x: * start[0][0] = 1 start[0][1] = 0 * stride[0][0] = 1 stride[0][1] = 1 * count[0][0] = 1 count[0][1] = 1 * block[0][0] = 1 block[0][1] = 5 * * y: * start[1][0] = 2 start[1][1] = 0 * stride[1][0] = 1 stride[1][1] = 1 * count[1][0] = 1 count[1][1] = 1 * block[1][0] = 1 block[1][1] = 5 * * z: * start[2][0] = 3 start[2][1] = 0 * stride[2][0] = 1 stride[2][1] = 1 * count[2][0] = 1 count[2][1] = 1 * block[2][0] = 1 block[2][1] = 5 * * Writes 15 values from ------- to ------- * | qqqqq | | xxxxx | * ==> | xxxxx | | yyyyy | * ==> | yyyyy | | zzzzz | * ==> | zzzzz | ------- * | sssss | * | vvvvv | * ------- * etc. *------------------------------------------------------------*/ int HDF_set_part_coords(int partIndex, int domainIndex, LayoutEnum filLayout, int nNodes, int ijkranges[6], CompEnum component, int num_comps, int num_dims, int *dims, int start[][2], int stride[][2], int count[][2], int block[][2], float *coords) /*------------------------------------------------------------ * HDF_set_part_coords_ids *------------------------------------------------------------ * Creates coordinate id dataset and writes coordinate ids. * This is done on a part_domain basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) nNodes = Number of nodes * * (IN) coordIDs = The node ids of the part domain * (0-based 1D array, nNodes long) * * The ids themselves should be positive integers * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_set_part_coords_ids(int partIndex, int domainIndex, int nNodes, int *coordIDs) /*------------------------------------------------------------ * HDF_set_part_coords_simple *------------------------------------------------------------ * Creates coordinate dataset and writes coordinates. * This is done on a part_domain basis. * * This routine should be able to be used for the majority * of situations. If you need more control over writing from the * source memory layout to the destination layout for unstructured * parts or CURVILINEAR_HDFRW structured parts, please see * HDF_set_part_coords routine. * * For structured parts, the "coordinates" will consist of: * the origin and deltas (6 numbers) if UNIFORM_HDFRW, * the 3 ijk vectors (i+j+k numbers) if RECTILINEAR_HDFRW, or * all the coordinates(3 * i*j*k numbers) if CURVILINEAR_HDFRW. * * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) filLayout = The layout of the file space being written to. * (see description of layout values below) * * (IN) nNodes = Number of nodes (for unstructured parts) * * (IN) ijkranges = [0] = mini (for structured parts) * [1] = maxi * [2] = minj * [3] = maxj * [4] = mink * [5] = maxk * * Each of these are 1-based. * * example 1: * * ------------------- mini = 1 * | | | | | maxi = 5 * | | | | | minj = 1 * |----|----|----|----| maxj = 3 * | | | | | mink = 1 * | | | | | maxk = 1 * ------------------- * * * example 2 (portion of whole): * * ......----........... mini = 2 * . | | . . maxi = 3 * . | | . . minj = 1 * .....|----|.......... maxj = 3 * . | | . . mink = 1 * . | | . . maxk = 1 * ......----........... * * (IN) component = XC_HDFRW if setting x component * YC_HDFRW if setting y component * ZC_HDFRW if setting z component * ALL_HDFRW if setting all three components * * (IN) memLayout = The layout of the memory space being written from. * * For structured UNIFORM_HDFRW: * The data must be a six number array * * [ x y z dx dy dz ] * * where: x, y, z are the coordinates of the * ijk origin * * dx, dy, dz are the delta values in each * of the ijk directions. * * So, the memLayout and filLayout arguments * will be ignored, and will be set to a 1D layout, * arbitrarily COMPONENT_ORDER_1D * * For structured RECTILINEAR_HDFRW: * The data must be an array i+j+k numbers long * * [ x1 x2 ... xi y1 y2 ... yj z1 z2 ... zk ] * * where: * there will be i number of x values, followed by * j number of y values, followed by * k number of z values. * * So, the memLayout and filLayout arguments * will be ignored, and will be set to a 1D layout, * arbitrarily COMPONENT_ORDER_1D * * For structured CURVILINEAR_HDFRW or unstructured: * The data can be any of the normal layouts * So, the memLayout and fileLayout arguments * will be used! * * layout = COMPONENT_ORDER_1D if: [xxxx...yyyy...zzzz] * * INTERLACE_ORDER_1D if: [xyzxyzxyz... ] * * N_BY_COMP_2D if: ------- * | x y z | * | x y z | * | x y z | * | . . . | * | . . . | * | . . . | * ------- * * COMP_BY_N_2D if: --------------------- * | xxx... | * | yyy... | * | zzz... | * --------------------- * * (only available for memLayout) * SINGLE_COMPONENT_1D if: [xxx...] or * [yyy...] or * [zzz...] * * (IN) coords = The coordinates or coordinate components of * the part domain, as described by memLayout * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * * For obvious efficiency reasons, whenever you can keep the destination and * source layouts the same - you should do so. * * Several examples: * * 1. (Source in memory is: [xxxxxyyyyyzzzzz]) * filLayout = COMPONENT_ORDER_1D * nNodes = 5 * component = ALL_HDFRW * memLayout = COMPONENT_ORDER_1D * * Writes 15 values from [xxxxxyyyyyzzzzz] to [xxxxxyyyyyzzzzz] * * 2. (Source in memory is: [xxxxxyyyyyzzzzz]) * filLayout = INTERLACE_ORDER_1D * nNodes = 5 * component = ALL_HDFRW * memLayout = COMPONENT_ORDER_1D * * Writes 15 values from [xxxxxyyyyyzzzzz] to [xyzxyzxyzxyzxyz] * * 3. (Source in memory is: [xxxxxyyyyyzzzzz]) * filLayout = INTERLACE_ORDER_1D * nNodes = 5 * component = YC_HDFRW * memLayout = COMPONENT_ORDER_1D * * Writes 5 values from [ yyyyy ] to [ y y y y y ] * * 4. (Source in memory is: [xxxxx]) * filLayout = INTERLACE_ORDER_1D * nNodes = 5 * component = XC_HDFRW * memLayout = SINGLE_COMPONENT_1D * * Writes 5 values from [xxxxx] to [x x x x x ] * * 5. (Source in memory is: [xxxxxyyyyyzzzzz]) * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ALL_HDFRW * memLayout = COMPONENT_ORDER_1D * * Writes 15 values from [xxxxxyyyyyzzzzz] to ------- * | xxxxx | * | yyyyy | * | zzzzz | * ------- * 6. (Source in memory is: ----- * | xyz | * | xyz | * | xyz | * | xyz | * | xyz | * ----- ) * filLayout = COMP_BY_N_2D * nNodes = 5 * component = ZC_HDFRW * memLayout = N_BY_COMP_2D * * Writes 5 values from ----- to ------- * | z | | | * | z | | | * | z | | zzzzz | * | z | ------- * | z | * ----- * etc. *------------------------------------------------------------*/ int HDF_set_part_coords_simple(int partIndex, int domainIndex, LayoutEnum filLayout, int nNodes, int ijkranges[6], CompEnum component, LayoutEnum memLayout, float *coords) /*------------------------------------------------------------ * HDF_set_part_elements *------------------------------------------------------------ * Creates element type dataset and writes element connectivity. * This is done on a part_domain - element_type basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) filLayout = The layout of the file space being written to. * (see description of layout values below) * * (For simplicity, indications are for 3-noded triangles. For other * elements the number of nodes per element will vary) * * layout = COMPONENT_ORDER_1D if: [n1 n1 n1... n2 n2 n2 ... n3 n3 n3 ...] * * INTERLACE_ORDER_1D if: [n1 n2 n3 n1 n2 n3 . . . ] * * * #nodes/elem * N_BY_COMP_2D if: ---------- * | n1 n2 n3 | (Tri1) * | n1 n2 n3 | (Tri2) * num elems | n1 n2 n3 | (Tri3) * | . . . | . * | . . . | . * | . . . | . * ---------- * * num elems * COMP_BY_N_2D if: --------------------- * | n1 n1 n1 . . . | * #nodes/elem | n2 n2 n2 . . . | * | n3 n3 n3 . . . | * --------------------- * T T T * r r r * i i i . . . * 1 2 3 * * Note: Not allowing SINGLE_COMPONENT_1D layout for either source or * destination for this routine. It is required to write in an * ALL_HDFRW nodes per element fashion. * * (IN) elementType = The element type: * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (IN) numOfType = The number of elements of the given type * * connectivity array related: * --------------------------- * (IN) num_dims = 1 if 1D array * 2 if 2D array * etc. * * Note: num_comps for this routine will be the number of nodes * per element type. * * (IN) *dims = size of the dimensions of connectivity array * * if num_dims = 1, dims[0] must contain the length * of the 1D array * * = 2, dims[0] must contain the length * of the 1st dimension of * the 2D array * dims[1] must contain the length * of the 2nd dimension of * the 2D array * etc. * * (IN) start[][2] = offsets of start for each component and in each * dimension of connectivity array * * start[num_comps][num_dims] * * (IN) stride[][2] = stride for each component in each * dimension of connectivity array * * stride[num_comps][num_dims] * * (IN) count[][2] = number of blocks for each component in each * dimension of connectivity array * * count[num_comps][num_dims] * * (IN) block[][2] = size of block (chunk being written) for each * component in each dimension of connectivity array * * block[num_comps][num_dims] * * (IN) connectivity = The connectivity array for the domain and type, * as described by the other arguments of this * routine. * * Returns: nothing * * Notes: *------------------------------------------------------------*/ int HDF_set_part_elements(int partIndex, int domainIndex, LayoutEnum filLayout, int elementType, int numOfType, int num_dims, int *dims, int start[][2], int stride[][2], int count[][2], int block[][2], int *connectivity) /*------------------------------------------------------------ * HDF_set_part_element_ids *------------------------------------------------------------ * Creates element id type dataset and writes element ids. * This is done on a part_domain - element_type basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) elementType = The element type: * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (IN) numOfType = The number of elements of the specified elementType * * (IN) elementIds = The element id array * (0-based 1D array, numOfType long) * * The ids themselves should be positive integers * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_set_part_element_ids(int partIndex, int domainIndex, int elementType, int numOfType, int *elementIds) /*------------------------------------------------------------ * HDF_set_part_elements_simple *------------------------------------------------------------ * Creates element type dataset and writes element connectivity. * This is done on a part_domain - element_type basis. * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) domainIndex = The part domain to use (1, 2, 3, ...) * * (IN) filLayout = The layout of the file space being written to. * (see description of layout values below) * * (IN) elementType = The element type: * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (IN) numOfType = The number of elements of the given type * * (IN) memLayout = The layout of the memory space being written from. * (see description of layout values below) * * (For simplicity, indications are for 3-noded triangles. For other * elements the number of nodes per element will vary) * * layout = COMPONENT_ORDER_1D if: [n1 n1 n1... n2 n2 n2 ... n3 n3 n3 ...] * * INTERLACE_ORDER_1D if: [n1 n2 n3 n1 n2 n3 . . . ] * * * #nodes/elem * N_BY_COMP_2D if: ---------- * | n1 n2 n3 | (Tri1) * | n1 n2 n3 | (Tri2) * num elems | n1 n2 n3 | (Tri3) * | . . . | . * | . . . | . * | . . . | . * ---------- * * num elems * COMP_BY_N_2D if: --------------------- * | n1 n1 n1 . . . | * #nodes/elem | n2 n2 n2 . . . | * | n3 n3 n3 . . . | * --------------------- * T T T * r r r * i i i . . . * 1 2 3 * * Note: Not allowing SINGLE_COMPONENT_1D layout for either source or * destination for this routine. It is required to write in an * ALL_HDFRW nodes per element fashion. * * (IN) connectivity = The connectivity array, as described by memLayout * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_set_part_elements_simple(int partIndex, int domainIndex, LayoutEnum filLayout, int elementType, int numOfType, LayoutEnum memLayout, int *connectivity) /*------------------------------------------------------------ * HDF_set_part_metadata *------------------------------------------------------------ * Sets the label (or name), the description, the structured flag, * and possibly other things for each part * (These will be needed when HDF_create is called.) * * (IN) partIndex = The part to use (1, 2, 3, ...) * * (IN) partName = The part's name or label * * (IN) partDescription = The part's description * * (IN) structuredFlag = UNSTRUCTURED_HDFRW for unstructured parts * STRUCTURED_HDFRW for structured parts * * The following are used only if the part is STRUCTURED_HDFRW * (IN) structuredType = UNIFORM_HDFRW = origin and deltas only * (6 floats) * RECTILINEAR_HDFRW = 3 vectors * * CURIVILINEAR_HDFRW = all points provided * in I then J then K order * by components * * (IN) iblankingVarName = name of the PER_NODE_HDFRW variable which * contains iblanking values. * (set 1st char to NULL if no iblanking in part) * * (IN) ghostVarName = name of the PER_ELEM_HDFRW variable which * contains ghost cell flags. * (set 1st char to NULL if no ghost cells in part) * * (IN) structuredIJKs = The IJK dimensions of the structured * block. (1-based) * * Returns: nothing * * Notes: * * 1. Needs to be called before HDF_create *------------------------------------------------------------*/ void HDF_set_part_metadata(int partIndex, STR80 partName, STR80 partDescription, StructEnum structuredFlag, StructTypeEnum structuredType, STR80 iblankingVarName, STR80 ghostVarName, int structuredIJKs[3]) /*------------------------------------------------------------ * HDF_set_part_variable *------------------------------------------------------------ * Loads variable values into the file on a var_domain basis. * It can further be according to component - based on variable * order. * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (IN) partIndex = The part to use (1, 2, 3, ...), which * will be the var_part also - since * the geom_parts and var_parts relate. * * (IN) domainIndex = The variable domain to use (1, 2, 3, ...) * * (IN) filLayout = The layout of the file space being written to. * * layout = COMPONENT_ORDER_1D if: [vx vx vx... vy vy vy... vz vz vz...] * * INTERLACE_ORDER_1D if: [vx vy vz vx vy vz . . . ] * * * # components * N_BY_COMP_2D if: ---------- * | vx vy vz | * | vx vy vz | * num entities | vx vy vz | * | . . . | * | . . . | * | . . . | * ---------- * * num entities * COMP_BY_N_2D if: --------------------- * | vx vx vx . . . | * # components | vy vy vy . . . | * | vz vz vz . . . | * --------------------- * * (not available for filLayout) * SINGLE_COMPONENT_1D if: [vx vx vx ...] or * [vy vy vy ...] etc. * * * (IN) elemType = The element type. It is not used * if PER_NODE_HDFRW variable. * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (IN) component = component being written. * * For Scalars: [v] * Ignores input, and sets to ALL_HDFRW * * For vectors: [x, y, z] * XC_HDFRW if x component * YC_HDFRW if y component * ZC_HDFRW if z component * ALL_HDFRW if all components * * For tensors: ------------- * | a11 a12 a13 | * | a21 a22 a23 | * | a31 a32 a33 | * ------------- * T11_HDFRW if a11 component * T12_HDFRW if a12 component * T13_HDFRW if a13 component * T21_HDFRW if a21 component * T22_HDFRW if a22 component * T23_HDFRW if a23 component * T31_HDFRW if a31 component * T32_HDFRW if a32 component * T33_HDFRW if a33 component * ALL_HDFRW if all components * * values array related: * --------------------- * (IN) num_comps = number of components present in values array * (This determines the first dimension of the * start, stride, etc. arrays. * * NOTE, Currently must be either 1, or all of the * the components!!) * * (IN) num_dims = 1 if 1D array * 2 if 2D array * etc. * * (IN) *dims = size of the dimensions of values array * * if num_dims = 1, dims[0] must contain the length * of the 1D array * * = 2, dims[0] must contain the length * of the 1st dimension of * the 2D array * dims[1] must contain the length * of the 2nd dimension of * the 2D array * etc. * * (IN) start[][2] = offsets of start for each component and in each * dimension of values array * * start[num_comps][num_dims] * * (IN) stride[][2] = stride for each component in each * dimension of values array * * stride[num_comps][num_dims] * * (IN) count[][2] = number of blocks for each component in each * dimension of values array * * count[num_comps][num_dims] * * (IN) block[][2] = size of block (chunk being written) for each * component in each dimension of values array * * block[num_comps][num_dims] * * (IN) dataType = H5T_NATIVE_FLOAT, (for most variables) * H5T_NATIVE_INT, (for iblanking or ghost vars) * etc. * * (IN) values = The array conaining variable values, or * components of them, to be written, as described * by the other arguments of this routine. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_set_part_variable(int variableIndex, int partIndex, int domainIndex, LayoutEnum filLayout, int elementType, CompEnum component, int num_comps, int num_dims, int *dims, int start[][2], int stride[][2], int count[][2], int block[][2], hid_t dataType, void *values) /*------------------------------------------------------------ * HDF_set_part_variable_simple *------------------------------------------------------------ * Loads variable values into the file on a var_domain basis. * It can further be according to component - based on variable * order. * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (IN) partIndex = The part to use (1, 2, 3, ...), which * will be the var_part also - since * the geom_parts and var_parts relate. * * (IN) domainIndex = The variable domain to use (1, 2, 3, ...) * * (IN) elementType = The element type. It is not used * if PER_NODE_HDFRW variable. * * POINT_HDFRW, 00: 1 node point * G_POINT_HDFRW, 01: 1 node point ghost * BAR02_HDFRW, 02: 2 node bar * G_BAR02_HDFRW, 03: 2 node bar ghost * BAR03_HDFRW, 04: 3 node bar * G_BAR03_HDFRW, 05: 3 node bar ghost * TRI03_HDFRW, 06: 3 node tri * G_TRI03_HDFRW, 07: 3 node tri ghost * TRI06_HDFRW, 08: 6 node tri * G_TRI06_HDFRW, 09: 6 node tri ghost * QUA04_HDFRW, 10: 4 node quad * G_QUA04_HDFRW, 11: 4 node quad ghost * QUA08_HDFRW, 12: 8 node quad * G_QUA08_HDFRW, 13: 8 node quad ghost * TET04_HDFRW, 14: 4 node tetra * G_TET04_HDFRW, 15: 4 node tetra ghost * TET10_HDFRW, 16: 10 node tetra * G_TET10_HDFRW, 17: 10 node tetra ghost * PYR05_HDFRW, 18: 5 node pyramid * G_PYR05_HDFRW, 19: 5 node pyramid ghost * PYR13_HDFRW, 20: 13 node pyramid * G_PYR13_HDFRW, 21: 13 node pyramid ghost * PEN06_HDFRW, 22: 6 node penta * G_PEN06_HDFRW, 23: 6 node penta ghost * PEN15_HDFRW, 24: 15 node penta * G_PEN15_HDFRW, 25: 15 node penta ghost * HEX08_HDFRW, 26: 8 node hexa * G_HEX08_HDFRW, 27: 8 node hexa ghost * HEX20_HDFRW, 28: 20 node hexa * G_HEX20_HDFRW, 29: 20 node hexa ghost * NSIDED_HDFRW, 30: nsided * G_NSIDED_HDFRW, 31: nsided ghost * NFACED_HDFRW, 32: nfaced * G_NFACED_HDFRW, 33: nfaced ghost * * (IN) filLayout = The layout of the file space being written to. * (see description of layout values below) * * (IN) component = component being written. * * For Scalars: [v] * Ignores input, and sets to ALL_HDFRW * * For vectors: [x, y, z] * XC_HDFRW if x component * YC_HDFRW if y component * ZC_HDFRW if z component * ALL_HDFRW if all components * * For tensors: ------------- * | a11 a12 a13 | * | a21 a22 a23 | * | a31 a32 a33 | * ------------- * T11_HDFRW if a11 component * T12_HDFRW if a12 component * T13_HDFRW if a13 component * T21_HDFRW if a21 component * T22_HDFRW if a22 component * T23_HDFRW if a23 component * T31_HDFRW if a31 component * T32_HDFRW if a32 component * T33_HDFRW if a33 component * ALL_HDFRW if all components * * (IN) memLayout = The layout of the memory space being written from. * (see description of layout values below) * * (For simplicity, indications are for vector. * * layout = COMPONENT_ORDER_1D if: [vx vx vx... vy vy vy... vz vz vz...] * * INTERLACE_ORDER_1D if: [vx vy vz vx vy vz . . . ] * * * # components * N_BY_COMP_2D if: ---------- * | vx vy vz | * | vx vy vz | * num entities | vx vy vz | * | . . . | * | . . . | * | . . . | * ---------- * * num entities * COMP_BY_N_2D if: --------------------- * | vx vx vx . . . | * # components | vy vy vy . . . | * | vz vz vz . . . | * --------------------- * * (only available for memLayout) * SINGLE_COMPONENT_1D if: [vx vx vx ...] or * [vy vy vy ...] etc. * * (IN) dataType = H5T_NATIVE_FLOAT, (for most variables) * H5T_NATIVE_INT, (for iblanking or ghost vars) * etc. * * (IN) values = The variable values to be written, as * described by memLayout * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_set_part_variable_simple(int variableIndex, int partIndex, int domainIndex, LayoutEnum filLayout, int elementType, CompEnum component, LayoutEnum memLayout, hid_t dataType, void *values) /*------------------------------------------------------------ * HDF_set_ranges *------------------------------------------------------------ * If known, the variable ranges can be provided. This can be * at various locations in the variable tree. * * (IN) location = VARIABLE_HDFRW, to set ranges at the * variable level * * VARIABLE_PART_HDFRW, to set ranges at the * var_part level * * VARIABLE_DOMAIN_HDFRW, to set ranges at the * var_domain level * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (IN) partIndex = The var_part to use (1, 2, 3, ...), if location * is VARIABLE_PART_HDFRW or VARIABLE_DOMAIN_HDFRW * * (IN) domainIndex = The var_domain to use (1, 2, 3, ...), if location * is VARIABLE_DOMAIN_HDFRW * * (IN) mins[9] = The range mins for the appropriate variable * components * (IN) maxs[9] = The range maxs for the appropriate variable * components * * The components are: * 0 (for scalar variables) * * 0 (for vector variables) * 1 * 2 * * 0 (for 6 component tensor variables) * 1 * 2 * 3 * 4 * 5 * * 0 (for 9 component tensor variables) * 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * If the ranges are not known, the following routine can * be called after the file has been populated - and the * ranges will be determined: * HDF_set_computed_ranges *------------------------------------------------------------*/ int HDF_set_ranges(RangeEnum location, int variableIndex, int partIndex, int domainIndex, float mins[9], float maxs[9]) /*------------------------------------------------------------ * HDF_set_variable_metadata *------------------------------------------------------------ * Sets attributes of variables * (This will be needed when HDF_create is called.) * * (IN) variableIndex = The variable to use (1, 2, 3, ...) * * (IN) varName = The name of the variable * * (IN) varDescription = Description line for the variable * * (IN) mappingType = PER_NODE_HDFRW, if the variable is mapped * to the nodes * * PER_ELEM_HDFRW, if the variable is mapped * to the elements * * (IN) varType = MODEL_CONSTANT_HDFRW (applys to all parts) * PART_CONSTANT_HDFRW (applys to a part) * SCALAR_HDFRW * VECTOR_HDFRW * TENSOR6_HDFRW * TENSOR9_HDFRW * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: * * 1. Needs to be called before HDF_create * * (mappingType is ignored if varType is MODEL_CONSTANT_HDFRW or * PART_CONSTANT_HDFRW) *------------------------------------------------------------*/ int HDF_set_variable_metadata(int variableIndex, STR80 varName, STR80 varDescription, MappingEnum mappingType, VarTypeEnum varType) /*------------------------------------------------------------ * HDF_start_writing_casefile *------------------------------------------------------------ * Opens the special casefile for writing to in the process * of writing HDF files. * * (IN) caseFileName = the full path filename of the casefile * to create. * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_start_writing_casefile(char *caseFileName) /*------------------------------------------------------------ * HDF_stop_writing_casefile *------------------------------------------------------------ * Closes the special casefile * * Returns: A_OK, if successful * A_ERR, if unsuccessful * * Notes: *------------------------------------------------------------*/ int HDF_stop_writing_casefile() =========================================== Note: typedef struct { char str[80]; }STR80; typedef struct { char str[256]; }STR256;