PHASTA/File Formats

From PHASTA Wiki
Revision as of 10:59, 18 January 2021 by Jrwrigh (talk | contribs) (Add info for sovler.inp and generic array files)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PHASTA has several different custom file formats that it takes in as input. This wiki page will review the basics of how they work


solver.inp

This file format is fairly ad-hoc, but follows a standard key-value syntax, where the key and value are separated by a colon, :.

Strings, integers, real numbers, and "arrays" can all be put into it (assuming that the key is expecting it). For commenting out code, the # is used. Here's an example:

       Spanwise File Binary Write : 1
  
   #MATERIAL PROPERTIES
   #{
       Viscosity: 1.50e-5      # fills datmat (2 values REQUIRED if iLset=1)
       Density: 1.0           # ditto
       Body Force Option: None # ibody=0 => matflag(5,n)

Generic Array Entries

Most generic array files in ASCII format (ie. not binary), such as STGInflow.dat or STGRand.dat, take a similar format.

The first line describes the size of the array to be read by PHASTA, then the rest of the file is the array in a space delimited format:

            517           3
    0.113416095562452E+00  -0.232694658451470E+00  -0.965914067189997E+00
    0.587836800593012E+00  -0.805356262211647E+00  -0.764799763667374E-01
   -0.320179182204988E+00   0.945214971754362E+00   0.636706247334280E-01

The first line here defines how many rows and columns are in the array (517 and 3 in this case). Then the rest is the array. Sometimes, the number of columns of an array is assumed, so only the number of rows is given. In that case, the there is only one integer in the first line.

Restart and Geombc files

Hint: When trying to read through binary files with ASCII headers, use the strings command in Linux to strip out the binary portions of the file and leave only ASCII.

POSIX Format

SyncIO Format