Link Search Menu Expand Document
Converted document
 Section 3.18: Output Section Up Section 3.18: Output Section Subsubsection Node_Data Class 

3.18.1 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:
  <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>
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 2.7↑ 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
rigid_body_data request rigid body data
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:
will store the variables , and 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 corresponds to the 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:
*Title = <problem title>
*Step = <time step>
*Time = <time value>
*Data = <data name>
<actual data goes here>
The problem title is as defined in the input file.
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:
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"
This data record is repeated for each converged time step. The following sections define the data variables that are available for each of the data classes.
 Section 3.18: Output Section Up Section 3.18: Output Section Subsubsection Node_Data Class 

Table of contents