Saving and Restoring a Cubit Session
There are currently two ways to save or restore a model in CUBIT. 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.
CUBIT File Method
The CUBIT file is a binary cross-platform-compatible file for the storage of a Cubit 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 CUBIT also provides a toolbar with direct access to file operations using the CUBIT File method described here.
By default, the CUBIT file is written in an HDF5-based format that uses either the .cub or the .cub5 extension. The older binary format is supported for read-only backward compatibility. CUBIT detects the format automatically when a file is opened or imported, so both HDF5 and legacy binary .cub files can be read without setting any additional options.
New
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 Cubit file (*.cub5 or legacy *.cub), closing the current model.
Save
A default file name is assigned when CUBIT is started (in very much the same way the journal files are assigned on startup) in the form cubit01.cub with incrementing digits on subsequent sessions. The current model filename is displayed on the title bar of the CUBIT window. Typing save at any time during your session will save the current model to the assigned Cubit file. The Cubit file includes the geometry and the mesh. Groups, blocks, sidesets and nodesets are also saved within it. 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 cub5 <filename>' is a valid command that is retained for backward compatibility.
save as 'filename' [Journal] [Overwrite]
The optional Journal keyword stores the session's current journal stream inside the saved file.
The set file overwrite command can be toggled on and off to allow overwriting when using the save as command. The command defaults to prohibiting overwrites.
set file overwrite [On|OFF]
Issuing the save command with no arguments as follows:
Save
will create a backup file of the current session using the name of the last saved file. The backup files are appended with .1, .2, etc. 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 [CUBIT][exodus] <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
Import
Imports and appends a Cubit file (*.cub5 or legacy *.cub) to an existing model.
import cubit 'filename.cub' [merge_globally]
Export
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, free curves, or free vertices can be exported to a Cubit file.
export cubit 'filename.cub' entity-list