The HHDB Solution File Format

The HHDB Solution File Format was created by Richard Sanders for the Houston Hypersonic Database.

Example input and output routines can be found at the end of this document.

Words and Records

All words within a HHDB solution file must be one of the following:
  1. Integers must be in 4-byte big-endian format, where big-endian stands for "big-end-first", meaning that within each 4-byte integer, the byte ordering is most significant byte first to least significant byte last. All floating point numbers must be 4-byte IEEE floating point numbers. C-language subroutines are supplied to convert your local machine's integer and floating point numbers to these standards.
  2. Character arrays must be right padded with null characters (ascii 0) to 4-byte boundaries. For example, in Fortran:
            str1(1:20) = 'This is a string.'//char(0)//char(0)//char(0) 
            str2(1:8)  = 'This too'

A HHDB solution file is composed of multiple records. Within the HHSFD, a record is defined as a byte stream delimited by a 4-byte big-endian integer header and a 4-byte integer trailer both of which are the size, in bytes, of the delimited record. For example, an empty record is composed of 8 zero bytes. Every record size measured in bytes must be a multiple of 4.

General File Structure

A HHDB solution file has the following structured components:
MAGIC The first component of every solution file must be a magic number record containing a single big-endian integer. (This record as with all records must be delimited by the record size in bytes. Therefore, the MAGIC record is actually composed of twelve bytes.)
ITEM A single record typically containing data. Items may be context sensitive.
SECTION Multi-record components that are delimited by a Beginning-Of-Section (BOS) record and an End-Of-Section (EOS) record. Sections may contain other sections (i.e. subsections) as well as items.

The first word of every record is an integer tag. The following tags are currently defined:

Record Type Tag
MAGIC 1212432974 The magic number.
ITM_COMM 0 A comment.
BOS_HHDB 32 BOS for a HHDB solution.
EOS_HHDB 33 EOS for a HHDB solution.
BOS_UNSTR 64 BOS for an unstructured mesh/data block.
EOS_UNSTR 65 EOS for an unstructured mesh/data block.
BOS_STRUC 66 BOS for a structured mesh/data block.
EOS_STRUC 67 EOS for a structured mesh/data block.
ITM_VCINT 256 Vertex-centered interior data.
ITM_CCINT 257 Cell-centered interior data.
ITM_VCBOU 258 Vertex-centered boundary data.
ITM_CCBOU 259 Cell-centered boundary data.

"file structure anchor"
A valid HHDB solution file is structured as follows:

ITM_COMM (See 1 below.)
. . .
BOS_STRUC (See 2 below.)
ITM_VCINT|ITM_CCINT (See 3 below.)
ITM_VCBOU|ITM_CCBOU (See 4 below.)
. . .
ITM_VCINT|ITM_CCINT (See 3 below.)
ITM_VCBOU|ITM_CCBOU (See 4 below.)
. . .
BOS_HHDB (See 5 below.)
. . .
. . .

(1) Comments may appear anywhere within the file following MAGIC. We must stress that for word alignment reasons, the number of characters in a comment must be a multiple of four. Pad with null characters if not.
(2) Structured and/or unstructured blocks may be mixed within a HHDB solution section.
(3) Every block, both structured and unstructured, must contain exactly one item of type ITM_VCINT or ITM_CCINT. Note that the format of these items is context sensitive depending on whether the block is structured or unstructured.
(4) Blocks may have any number of boundary patches of type ITM_VCBOU and/or ITM_CCBOU. The format of these items is also context sensitive.
(5) Any number of HHDB solution sections are allowed within the file.


We'll use Fortran as a guide to outline the specifics of above. Suppose that we have opened a file for reading:

Example Input and Output Programs

It is fairly simple to create a solution file in the HHDB format. Example subroutines for doing this can be found by following this link. On the other hand, some care must be taken when reading one. We have left room in the format for considerable future expansion. For this reason, unknown records must be disregarded. You will find an example Fortran program for reading a HHDB solution file by following this link. This routine is intended only to demonstrate the reading of an HHDB file.

The HHDB solution file compression routine, hhdbzip.c, can be found by following this link.

A routine for checking the integrity of an HHDB solution file can be found by following this link.

Last modified: Fri Sep 11 14:15:50 MET DST 1998