Files
You can import any type of file into a Model Manager database. A file that is not recognized as a COMSOL Multiphysics file (that is, with the file extension mph) or a Physics Builder file (that is, with the file extension mphphb) is referred to as a data file, or just file, in a Model Manager database.
Files are version controlled in exactly the same way as Models. For example, when you import from the file system, a new file is created in the database with an associated first version. You can update an existing file in the database by selecting a file on the file system and saving it as a new version from the File Settings window. You can also, for example, update a file in the database by using it as an output target for auxiliary data used by a model.
You may wonder why COMSOL Multiphysics simulation models and data files are two different concepts in a Model Manager database, when they are all “just files” when stored on a file system. The main reason for the distinction is their respective storage characteristics and supported search functionality. The known internal structure of a model enables efficient data reuse between versions, as well as searching deep within a model’s content using The Model Manager Search Syntax. A data file is stored in the database as a chunk of binary or text data whose contents is opaque to Model Manager.
Item Version Types
Versions of files come in two different item version types:
File (), which is the standard type obtained when the version consist of just a single file when stored on the file system. Examples include a text file containing interpolation function data or a movie file for a results animation.
Fileset (), which is a version consisting of multiple binary or text files when stored on the file system. Examples include CAD data consisting of a main CAD assembly file and one or more external component files that the assembly reference, or an HTML report consisting of a main HTML document and one or more image files referenced by the document.
You may notice that a file can, for example, start out as the first type for its first couple of versions, but then transition into the second type if you save a version that contains multiple files.
An individual binary or text file that belongs to a file version is referred to as a file resource in order to distinguish it from the version-controlled file itself, with the latter having additional metadata such as a title, a description text, and possible tag assignments — see File Settings. A fileset is thus a file version containing multiple file resources.
File Settings
The Settings window for a file shows settings for a specific version of the file. Update any of the settings and click the Save button () to save a new version of the file. You can write an optional save comment. Click OK to save.
The Version Section
This section displays the following fields:
Location. The commit location in the database in which the file version is saved. See Locations.
Saved. The time when the file version was saved.
Saved by. The display name of the user that saved the file version.
Title. The title of the file in the saved version.
File size. The size of the file version when stored on the file system. For a fileset, this is the sum of the individual file sizes.
Description. The description of the file in the saved version.
The title is automatically set to the filename when importing a file from the file system into a Model Manager database. You are free to change the title to something else, however — the unique identity of the file itself in the database will not be affected.
The Contents Section
This section shows a table with all file resources associated with the file version. The table has a File and Size column for the filename and file size respectively of each file resource. A file version with zero or multiple file resources is a fileset; a file version with a single file resource is a plain file.
File resources in a file version may be organized into a hierarchy of directories. A directory is shown with a triangle symbol next to its name in the File column. Click the triangle to list the file resources and, possibly, subdirectories found inside that directory. File resources found on the top level in the table are thought of as belonging to an implicit root directory.
Click the Add button () to add a file from the file system as a new file resource to the table. If either no file resource or a file resource on the top level is currently selected in the table, the new file resource will also be added to the top level. To add a file resource under an existing directory, either select that directory or a file resource found inside the directory. A confirmation dialog box for replacing is shown if an existing file resource with the same filename already exists.
You can also add an entire folder from the file system to the table. Click the expand button and select Add Folder () in the menu. The folder itself, as well as all files and subfolders inside the folder, are added to the table at the position determined by the current selection in the same way as a single file is added.
Click the Remove button () to remove selected file resources and directories from the table. Click the Replace button () to replace a selected file or a directory in the table with a file or directory from the file system. Only the contents will be updated — the replaced file resource or directory will keep its current name.
Select a file resource and click Preview File () to open the file resource with the default application for its file type. The preview will include any locally modified file resource in the table.
The Tags Section
This section displays the Tags assigned to the file as a collection of tag pills.