Binary LS-DYNA Format
Binary Ansys LS-DYNA Format
PRIMER 15 introduces a new binary format which has the following attributes:
- It is a "mirror image" of the normal ascii text Ansys LS-DYNA input file, retaining both content and layout, but is encoded in binary.
- This gives a file size that is typically 30% of the equivalent ascii file.
- Because no ascii <==> binary conversion is required during i/o both reading and writing are faster.
The format is proprietary to PRIMER and cannot be read by Ansys LS-DYNA or any other commercial software, so it will be necessary to convert it back to conventional ascii format before use in external software. This can be done in two ways:
-
Read into
PRIMER
and write out in ascii format
-
Use the "decode_binary" command-line utility provided as part
of the Ansys LS-DYNA version 15 suite.
This utility is also available on the Oasys Ltd website for free download, no licence is required.
Reading of binary files is automatic since it is detected from the *START_BINARY keyword in the file itself. Writing of binary files is controlled under the "compess" tab in Model Write, see
Description of binary format filesEach line of a normal keyword file is made up of numbers and text, and these are stored in a way that is readable by humans using ascii text. For example consider the format of a *NODE card in Ansys LS-DYNA which is:
Therefore this card requires (8 + 16 + 16 + 16 + 8 + 8) = 72 ascii characters for output, yet only (4 + 4 + 4 + 4 + 1 + 1) = 18 bytes for internal storage, which is 25% of the space. Moreover when this file is written out in ascii format considerable cpu time has to be spent converting the internal binary format to the external ascii format, in fact for many models this conversion process is the most "expensive" part of the output process. So writing this card in its internal binary format is not only faster, but also results in substantially smaller files, and this is what PRIMER 's binary format does. The file also encodes the format of each card, so a binary file can be converted back to a normal ascii file without any loss of information. |
|||||||||||||||||||||
|
Format of the binary file. A binary file starts off in ascii just like a normal keyword output file, then swaps to binary when the keyword *START_BINARY is encountered. Thereafter the file is binary and not human readable. The details of the binary format are proprietary. This is not a standard Ansys LS-DYNA keyword, and Ansys LS-DYNA will be unable to read the file unless it is converted back to ascii.
|
|||||||||||||||||||||
|
File size reduction Because information about the format as well as the contents of the line have to be stored, the actual file size tends to be about 30% of the original (small format) ascii file. |
|||||||||||||||||||||
|
Speed of output of binary files Speed-up of file writing tends to be in the range 6.5x on a fast local disk, to better than 18x on a remote disk on a slow network. |
|||||||||||||||||||||
|
Reading of binary files by PRIMER PRIMER 15 will read binary files directly. No special action is required on the part of the user as the file is opened in the normal way and PRIMER then detects the *START_BINARY keyword and interprets the binary format directly. |
|||||||||||||||||||||
|
Speed of reading binary files From a fast local disk input tends to be about 1.5x faster, rising to 3.0x times faster on a slow remote disk. (Binary input means that the speed bottleneck moves from file read to internal database construction.) |
|||||||||||||||||||||
|
Versions of the binary format file The *START_BINARY keyword contains information that includes a Major.Minor version number. On reading the file this will be checked against the version numbers that this release of PRIMER understands and:
A typical example of point #2 is the Ansys LS-DYNA "i10" output format that is supported in PRIMER 17 onwards. Binary files written by PRIMER 17 will have a minor revision number greater than that written by earlier versions of PRIMER , but will still be readable by those earlier versions so long as "i10" format - which they won't understand - is not used. |
|||||||||||||||||||||
|
Compression of binary format filesCompression and binary format may be used together, ie a binary file can be further compressed to .gz or .zip format. Experience shows that at the standard level of compression a typical model which compresses to 20 - 25% of its original size in ascii format will compress to 15 - 20% in binary format, so there is some gain to be had. Compression at the default level of 1 increases the time taken to write and read binary format files by a small amount, usually less than 5%. On a very slow network there may be an improvement in speed if the benefit of transmitting the smaller file size outweighs the cost of compression. |