Saving and Restoring a Trelis Session

There are currently two ways to save/restore a model in Trelis. A file can be saved with either the Exodus or Cubit File method. The method of choice is determined by a set command. The Cubit method is the default.

NOTE: Trelis users may use an additional file type named *.trelis. A 'trelis' file is similar to a 'cubit' file in that it contains the geometry, mesh, and associated mesh groups. In addition, a 'trelis' file may include the journal file that was used to construct the model being saved. A 'trelis' file is saved in HDF5 format, making it possible for users to include their own data without requiring access to low-level read/write functions in Trelis.

Set Save [exodus|cubit] [Backups <number>]

Cubit File Method

The Cubit file is a binary cross-platform compatible file for the storage of a model that is compact in size and efficient to access. It includes both the geometry and the associated mesh, groups, blocks, sidesets, and nodesets. Mesh and geometry are restored from the Cubit file in exactly the same state as when saved. For example, element faces and edges are persistent, as well as mesh and geometry ids. The Graphical User Interface version of Trelis also provides a toolbar with direct access to file operations using the Cubit File method described here.


Creates a new blank model with default name, closing the current model. The New command essentially acts like the reset command.

Open '<filename>'

Opens an existing *.cub or *.trelis file, closing the current model.

Open 'filename.cub'

Open 'filename.trelis'


A default file name is assigned when Trelis is started (in very much the same way the journal files are assigned on startup) in the form cubit01.cub, for example. The current model filename is displayed on the title bar of the Trelis window. Typing save at any time during your session will save the current model to the assigned *.cub file. The *.cub file includes the *.sat file and the mesh. Groups, blocks, sidesets and nodesets are also saved within the *.cub file. To change the name of the current model, or to save the model's current geometry to a different file, use the save as command. Note that 'save <file.cub>' is NOT a valid command.


Save As 'filename.cub' [Overwrite]

Save Trelis "filename.trelis' [Overwrite] [Journal]

The set file overwrite command can be toggled on and off to allow overwriting when using the save as command. The command is defaulted to not allow overwriting.

The "journal' keyword will cause the existing journal file to be embedded in the .trelis file. From the GUI, this option is on by default.

The default file type (.trelis (HDF5) versus .cub (legacy Cubit format) is controlled from the Geometry Defaults options panel. The default type is Trelis. The Save and Save As commands are sensitive to this setting and will write .trelis or .cub files based on the setting. The setting is persistent between sessions.

The command, 'save trelis . . .' will always write a .trelis file regardless of the option setting.

Set File Overwrite [On|OFF]

A backup file is created by default, allowing access to previous states of the model. The backup files are named *.cub.1, *.cub.2... The user can set the total number of backups created per model with the following command (the default number of backups is 99,999):

Set Save Backups <number>

As soon as the number of model backups reaches the maximum, the lowest numbered backup file will be removed upon subsequent backup creation.

To check on the status of a 'set' command, type in the command in question without any options. For example, to check which save method is currently toggled, type:

Set Save


Appends a *.cub file to an existing model.

Import Cubit 'filename.cub' [merge_globally]


In addition to saving an entire model, one can use the export command to save only a portion of a model. The geometry and associated mesh, groups, blocks, sidesets and nodesets are exported. Only bodies or free surfaces, curves or vertices can be exported to a Trelis file.

Export Cubit 'filename.cub' entity-list