ABF allows data to be stored in Type, request, and component categories such that it can be read in other Altair products such as HyperGraph. Data can optionally be grouped as Subcases. The general sequence of writing the data is as follows:
• | Create the ABF file. |
• | Create Subcase (optional). |
• | Add data to Subcase. |
• | Repeat previous two steps as many times as needed. |
• | Close the file. |
When the file is opened, an ABF object is returned. All other operations are done via this object’s interface. The various built-in functions for exporting to ABF format are discussed below.
Creates the ABF file and returns an ABF object. Existing files are overwritten.
|
Creates a Subcase. This is optional.
|
Add data to be written. The data is grouped as part of last created Subcase, if any.
|
Writes the added data to the ABF file and closes it. Returns True on success. The ABF object must be reinitialized after this for further use. Using the previous information, the general sequence is as follows:
AbfObject = CreateAbfFile(filename) AbfObject::CreateSubcase(subcase_1) AbfObject::AddData(type, request, component, vector_1) ⋮ AbfObject::AddData(type, request, component, vector_n) ⋮ ⋮ AbfObject::CreateSubcase(subcase_M) AbfObject::AddData(type, request, component, vector_1) ⋮ AbfObject::AddData(type, request, component, vector_n) AbfObject::Close() Any data added prior to creating the first Subcase is grouped as part of the first Subcase. |
This example shows how to create an ABF file with two Subcases, each containing a pair of vectors. Xvec1 = [1:10]; Yvec1 = Xvec1 // 1st pair Xvec2 = [1:10]; Yvec2 = -Xvec2 // 2nd pair Abf = CreateAbfFile("C:/test.abf") Abf::CreateSubcase("Subcase 1") Abf::AddData("type", "req", "compX", "Xvec1") Abf::AddData("type", "req", "compY", "Yvec1") Abf::CreateSubcase("Subcase 2") Abf::AddData("type", "req", "compX", "Xvec2") Abf::AddData("type", "req", "compY", "Yvec2") Abf::Close() Abf = nil |