Skip to content

3.19 Output Section

FEBio usually splits the output in two files: the logfile, which contains the same information that was written to the screen during the analysis, and the plotfile, which contains the results. The contents of these output files can be customized in the Output section.

Logfile

The logfile records the same output that is printed to the screen. In addition, the user can request FEBio to output additional data to the logfile. This feature is called data logging. To use this feature, simply define the following element in the Output section of the input file:

<Output>
  <logfile [file="<log file>"]>
    <node_data [attributes]>item list</node_data>
    <element_data [attributes]>item list</element_data>
    <rigid_body_data [attributes]>item list</rigid_body_data>
  </logfile>
</Output>

The optional attribute file defines the name of the logfile. If omitted, a default name is used that is derived from the FEBio input file. See Section FEBio Output for details on default naming conventions for output files.

Additional data is stored to the logfile by adding one or more of the following elements:

node_data__ request nodal data

face_data request surface data

element_data__ request element data

domain_data request domain data (i.e. element data integrated over a domain)

surface_data request surface data (i.e. face data evaluated over a surface)

rigid_body_data request rigid body data

rigid_connector_data request data on a rigid connector

model_data request data on the model

Each of these data classes takes the following attributes:

data an expression defining the data that is to be stored

name a descriptive name for the data (optional; default = data expression)

file the name of the output file where the data is stored. (optional; default = logfile)

delim the delimiter used to separate data in multi-column format (optional; default = space)

format an optional format string (optional; default = not used)

The data attribute is the most important one and is mandatory. It contains a list of variable names, separated by a semi-colon. The available variable names depend on the data class and are defined below. For example, the data expression:

data="x;y;z"

will store the variables \(x\), \(y\) and \(z\) in separate columns. See below for more examples.

The optional name attribute is a descriptive name for the data. It is used in the logfile to refer to this data and can be used to quickly find the data record in the logfile. If omitted, the data expression is used as the name.

The file attribute defines the name of the output file where the data is to be stored. This attribute is optional and when not specified the data will be stored in the logfile.

The optional delim attribute defines the delimiter that is used in multi-column format. As described above, data can be stored in multiple columns and the delimiter is used to separate the columns. The default is a single space.

The optional format attribute defines a format string that will be used to format the output. If this attribute is present, the delim attribute will be ignored. The format string is composed of literal characters and special formatting characters. The special formatting characters are preceded by the percentage character (%). The following formatting characters are currently defined.

%i replace with the index of the corresponding item (i.e. node numbers for node data)

%g replace with a data value. Use a %g for each data item.

%t insert tab character in output.

%n insert newline character in output.

The following example,

<node_data data="x;y;z" format='<node id="%i">%g,%g,%g</node>'></node_data>

will print the following output (e.g. for node 1).

<node id="1">0.1,0.2,0.3</node>

Notice the use of the apostrophe (') in the format string. This is necessary in order to include the quotation marks as part of the format string. Also note that each data string will automatically be printed on a new line, so there is no need to end the format string with a newline character.

The value of the data elements is a list of items for which the data is to be stored. For example, for the node_data element the value is a list of nodes, for the element_data element it is a list of FE elements and for the rigid_body element it is a list of rigid bodies. The value may be omitted in which case the data for all items will be stored. For instance, omitting the value for the node_data element will store the data for all nodes.

As stated above, the data is either stored in the logfile or in a separate file. In any case, a record is made in the logfile. When storing the data in the logfile, the following entry will be found in the logfile at the end of each converged timestep for each data element:

Data Record #<n>
Step = <time step>
Time = <time value>
Data = <data name>
<actual data goes here>

The record number \(n\) corresponds to the \(n\)th data element in the input file. The Step value is the current time step. The Time value is the current solution time. The Data value is the name of the data element as provided by the name attribute (or the data attribute if name is omitted). The actual data immediately follows this record. If multiple column output is used, the columns are separated by the delim attribute of the data element.

When storing the data in a separate file, the format is slightly different:

Data Record #<n>
Step = <time step>
Time = <time value>
Data = <data name>
File = <file name>

The File value is the name of the physical file. Note that this is the name to which the time step number is appended. In addition, the physical file that stores the data contains the following header:

*Step = <time step>
*Time = <time value>
*Data = <data name>
<actual data goes here>

In either case, the actual data is a multi-column list, separated by the delimiter specified with the delim attribute (or a space when omitted). The first column always contains the item number. For example, the following data element:

<node_data
data="x;y;z" name="nodal coordinates" delim=",">1:4:1</node_data>

will result in the following record in the logfile:

Data Record #1
Step = 1
Time = 0.1
Data = "nodal coordinates"
1,0.000,0.000,0.000
2,1.000,0.000,0.000
3,1.000,1.000,0.000
4,0.000,1.000,0.000

This data record is repeated for each converged time step. Please see Logfile Variables for a list of available log variables.

Plotfile

By default, all the results are stored in a binary database, referred to as the plotfile. The preferred storage format is the FEBio binary database format (referred to as the xplt format)1. This section describes how to customize the data that is stored to the plotfile.

To define the contents of the plotfile the plotfile element needs to be added in the Output section of the FEBio input file.

<plotfile [type="febio"] [file="name.xplt"]/>

The type attribute defines the output format. As of version 4.4, the user can choose between “febio” and “vtk”. When choosing “febio”, which is the default, the results will be stored in the standard binary xplt format. When choosing “vtk”, the output is stored as individual VTK (legacy format) files, one for each completed time step. Note that due to limitations of the vtk format, not all plot variables can be exported to VTK file.

The file attribute is also optional and allows the user to define the file name of the plotfile. If this attribute is omitted, FEBio will use a default file name for the plotfile.

By default, FEBio will store the most common data variables to the plot file. However, it is advised to always specify the specific contents of the plotfile. This can be done by adding var elements in the plotfile section as described below.

Plotfile variables are defined using the var keyword. This tag takes one attribute, namely the type of the variable. The type defines the specific output variable that will be stored to the plot file.

<var type="name"/>

where name is the name of the output variable. (For a complete list of supported output variables, please see Plotfile Variables)

As of FEBio 2.4, additional information can be added in the type attribute of the variable definition. The general format is as follows.

<var type="name[filter]=alias"/>

The filter is defined by appending the name of the plot variable with the filter inside square brackets. The filter can be either an integer, or a string. If the filter is a string, it must be surrounded by single quotes.

<var type="name['filter string']=alias"/>

The optional alias can be used to rename the variable. The alias will be used as the name of the plot variable in the plot file, and this is the name that will show up in post-processing software such as FEBio Studio.

Some plot variables use filters to resolve possible ambiguities. For example,

<var type="solute concentration['solute1']"/>

This example will store the solute concentration of a solute named 'solute1' to the plot file.

In addition, an alias can be used to define a more descriptive name of the plot variable.

<var type="solute concentration['Na']=Na concentration"/>

This variable will store the solute concentration of a solute named 'Na' to the plot file using the name 'Na concentration'.

The following example shows how to export a particular fiber vector from a solid mixture. Since solid mixtures can have several fiber distributions associated, it is necessary to specify which component of the mixture the plot variable refers to.

<var type="fiber vector['solid[0]']=v1"/>
<var type="fiber vector['solid[1]']=v2"/>

Some plot variables require the specification of a named surface (* in table below). For example,

<var type="fluid surface force" surface="airfoil"/>

The named surface should be described in a Surface element (Section Surface Section) within Mesh (Section Mesh Section).

The following example shows a complete definition of the plotfile section and stores nodal displacements and element stresses.

Example:

<plotfile type="febio">
  <var type="displacement"/>
  <var type="stress"/>
</plotfile>

  1. As of FEBio version 2.0, the LSDYNA database is no longer supported. The FEBio database format is the only format that will be supported from now on. ↩