17.13 Post Session Files¶
The post model, i.e. the results and all the plots and other items added, can be saved to a Post Session File (PSF). The PSF is an xml-formatted file that contains the contents of the post model, and all the information necessary for FEBio Studio to reconstruct the model. The default extension for a PSF is fsps.
To create a PSF, first load a model into the Post side of FEBio Studio (e.g. by loading an xplt file). Then, go to File → Save as..., select the “FEBio Studio Post Session” file filter, choose a name, and enter Save. Similarly, to open a PSF, go to the menu File → Open Model, select the “FEBio Studio Post Session” filter, choose the file, and click Open.
The rest of this section describes the content of the PSF file in some detail.
PSF File Structure¶
The Post Session File (PSF) is an xml-formatted file. The root tag is febiostudio_post_session and it takes a required version tag, which has to be set to “1.0”.
<febiostudio_post_session version="1.0">
...
</febiostudio_post_session>
The remainder of the file will contain tags that change default attributes or add other model components (e.g. plots). The following table shows a list of the supported tags. The subsequent sections will discuss each tag in more detail.
| tag | Description |
|---|---|
| model | Open a model file |
| material | Set material properties |
| datafield | Set datafield parameters |
| plot | Add a plot |
Table 1. Supported PSF File tags
model¶
The first XML element in the file will usually be the model tag, which is used to read a file, e.g. an FEBio xplt file. The file attribute specifies the filename.
<model file="/path/to/some/file"/>
At this point, FEBio Studio will try to read the file. If reading the file fails, FEBio Studio will not process the rest of the session file.
The model tag can also contain a type attribute instead of a file attribute. This is used for creating models using a specialized tool. This can be used for instance for creating models via the Kinemat tool. See the examples below for how this works.
material¶
The material tag allows users to set default material properties for the materials that were automatically created when reading the model file. The following table shows a list of available material parameters.
| property | Description |
|---|---|
| diffuse | Set the diffuse color for the material |
| ambient | Set the ambient color for the material |
| specular | Set the specular color for the material |
| emission | Set the emission color for the material |
| mesh_color | Set the color for rendering mesh lines |
| shininess | Set the shininess parameters (between 0 and 1) |
| transparency | Set the material transparency (between 0 and 1) |
Table 2. Material properties
datafield¶
The datafield element is used to set parameters for data fields that are loaded from the model data file. This element requires a name attribute that identifies the specific data field.
Example:
<datafield name="Lagrange strain">
<ref_state>2</ref_state>
</datafield>
plot¶
The plot tag will add a specific type of plot to the model. The plot type is specified by the type attribute. The following plots can be added.
| type | Description |
|---|---|
| iso-surface | Add an iso-surface plot |
| lines | Add a line plot (1) |
| points | Add a point cloud plot |
| mirror | Add a mirror plot |
| planecut | Add a planecut plot |
| probe | Add a probe plot |
| ruler | Add a ruler plot |
| slices | Add a slices plot |
| streamlines | Add a streamline plot |
| tensor | Add a tensor plot |
| vector | Add a vector plot |
| volume-flow | Add a volume flow plot |
Table 3. Plot types
Comments:
- The line plot requires a source property that defines the file from which the line data will be read.
PSF Examples¶
A minimum PSF file that reads in an xplt file will look like this.
<febiostudio_post_session version="2.0">
<model file="/path/to/some/file.xplt"/>
</febiostudio_post_session>
Assume an xplt file contains two materials. The following example reads the xplt file and sets the default color properties for the materials.
<febiostudio_post_session version="2.0">
<model file="/path/to/some/file.xplt"/>
<material id="1">
<diffuse>240,164,96</diffuse>
<ambient>240,164,96</ambient>
</material>
<material id="2">
<diffuse>128,128,0</diffuse>
<ambient>128,128,0</ambient>
</material>
</febiostudio_post_session>
The next example shows how to load an xplt file and add a line plot that reads data from a separate file.
<febiostudio_post_session version="2.0">
<model file="/path/to/some/file.xplt"/>
<plot type="lines">
<source file="/path/to/lines/file.ang"/>
</plot>
</febiostudio_post_session>
This example illustrates the use of the kinemat tag to read and construct a post model.
<febiostudio_post_session version="2.0">
<model type="kinemat">
<model_file>geometry.k</model_file>
<kine_file>kine_data.txt</kine_file>
<range>1,999,1</range>
</model>
</febiostudio_post_session>