PHT File Format

From ScorecWiki

It is necessary to create a meta file to use ParaView with Phasta, as Phasta uses several files per timestep to store its data, but ParaView allows the user to select only a single file. This meta file then describes to ParaView where to find the various parts (geometry, fields) and how many files to use (number of processors, number of timesteps). This meta file also describes which fields to load in (note: for this capability users needs to use a version of ParaView with updated Phasta readers that would be available in /usr/local/paraview/ on SCOREC systems), see the sample file <fields.pht>.

The metafile is in XML format. Here is a sample file:

<?xml version="1.0" ?>
<PhastaMetaFile number_of_pieces="1">
  <GeometryFileNamePattern pattern="geombc.dat.%d" 
                           has_piece_entry="1"
                           has_time_entry="0"/>
  <FieldFileNamePattern pattern="restart.%d.%d"
                        has_piece_entry="1"
                        has_time_entry="1"/>
  <TimeSteps number_of_steps="1" auto_generate_indices="0">
    <TimeStep index="0" geometry_index="" field_index="0" value="0.1"/>
    </TimeSteps>
</PhastaMetaFile>

Here is a sample meta file (fields.pht) to view multiple fields:

<?xml version="1.0" ?>
<PhastaMetaFile number_of_pieces="2">
  <GeometryFileNamePattern pattern="geombc.dat.%d"
                           has_piece_entry="1"
                           has_time_entry="0"/>
  <FieldFileNamePattern pattern="restart.%d.%d"
                        has_piece_entry="1"
                        has_time_entry="1"/>
  <TimeSteps number_of_steps="2"
             auto_generate_indices="1"
             start_index="0"
             increment_index_by="20"
             start_value="0."
             increment_value_by="20.">
  </TimeSteps>
  <Fields number_of_fields="2">
    <Field paraview_field_tag="velocity"
           phasta_field_tag="solution"
           start_index_in_phasta_array="1"
           number_of_components="3"
           data_dependency="0"
           data_type="double"/>
    <Field paraview_field_tag="average speed"
           phasta_field_tag="ybar"
           start_index_in_phasta_array="4"
           number_of_components="1"/>
  </Fields>
</PhastaMetaFile>

The Fields element contain <number_of_fields> Field sub-element. Each Field sub-element specifies tag attribute to be used in paraview, tag under which the field is stored in phasta files, start index of the array in phasta files, number of components of the field, data dependency, i.e., either 0 for nodal or 1 for elemental and data type, i.e., "double" (as of now supports only 1, 3 & 9 for number of components, i.e., scalars, vectors & tensors, and "double" for type of data). In the example above, there are two fields to be visualized one is velocity field stored under tag "solution" from index 1 to 3 in phasta files which is a vector field defined on nodes with double values, and the other field is average speed scalar field of double values stored under tag "ybar" at index 4 in phasta files. If any Field sub-element is specified then default attribute values are : (phasta_field_tag is mandatory)

paraview_field_tag = Field <number>

start_index_in_phasta_array = 0

number_of_components = 1

data_dependency = 0

data_type = double

If no Field(s) is/are specfied then the default is following 3 fields :

pressure (index 0 under "solution"),

velocity (index 1-3 under "solution")

temperature (index 4 under "soltuion")

Here is a short movie discussing modifying this file Link