The output of the simulation run is saved as new versions for the same model item and branch that the model version specified by the -outputfile argument belongs to. The argument may refer to a model item that does not yet exist in the database, in which case the model item will be automatically created by the batch run.
During a batch run, various data such as status and log files are continuously written by the batch process. This batch data can also be stored in a database using the command-line arguments
-outputdir and
-batchlog with file version locations as values. A location may refer to a file item that does not yet exist in the database, in which case the file item will be automatically created by the batch run.
You can freely combine database and file system locations for the -inputfile,
-outputfile,
-outputdir, and
-batchlog arguments. For example, a batch run could use a model version in a database as input, an MPH file on the file system as output, and the remaining batch data stored as file versions.
where <input-argument> is the model version location to be used as input argument for the batch run. The result is a location URI string for a model item to be created on the same branch as the input model version. For the batch log file, for example, run:
When -outputdir refers to a file version location, the corresponding location URI string must represent a directory. You can obtain such a string by copying the file location of the target file version — see
Copying Model and File Locations — pasting it in a text editor, and then removing the filename as a path argument from the URI. You can also generate such a location URI using the
Model Manager API. Run, for example, via the
Java Shell window:
where <input-argument> is the model version location to be used as input argument for the batch run. The absence of any file path arguments passed to
withFileResourcePath results in a “base directory” for the file version’s file resources.
You can stop a batch run involving a model version by launching a new batch process using the same arguments as the first process but with an additional -stop argument. The batch run can be restarted using an additional
-continue argument. For the case when the output is saved to a database, however, it becomes important to use the model version that was saved when the previous batch run was stopped as a new argument value for
-inputfile. Otherwise, you will end up recomputing all solutions already obtained by the previous batch run. You would typically find the saved model version as the latest version of the model by browsing the corresponding branch in the Model Manager workspace, or via the Model Manager API using the
-outputfile argument of the previous run as an “anchor” — see
Navigating a Model Manager Database.
The COMSOL Multiphysics batch mode, when launched from a batch feature under a Study node in the COMSOL Desktop, can be configured to store output in a Model Manager database. You may find this useful, for example, when the model used as input for the batch run is already stored in the same database.
In the Settings window for a batch feature, select either
Database or
Same as current model in the
Model storage and
Data storage lists. A requirement for both options is that the current model is already saved in a database. You can also use a hybrid storage mode by selecting
File system in one of the lists.
With batch settings configured, including the ones for Model storage and
Data storage, click
Compute on the
Study node to start the batch job. You can track the progress in the
The External Process Window — see also
Batch for more details. Click the
Detach job button in the
External Process window to detach the job from the COMSOL Desktop. You can, for example, save a new version of the model opened in the desktop and continue working on something else. To return to the batch job, open the saved model from the database and click
Attach job in the
External Process window.
Once the batch run has completed, the Filename field in the
Settings windows for the
Batch Data (Subnode) and
External Process (Subnode) features contain model version locations referring to saved model items. The
Output directory fields refer to saved file items. Select
Show Location in the menu next to these fields to access the corresponding item versions from
The Versions Window in the Model Manager workspace.
After a batch run has completed, the generated items can be deleted on their branch by clicking the Clear All Data button in the
Settings window for the
Batch Data node, or from the
External Process window. You can also delete them directly via the Model Manager workspace — see
Deleting Models and Files. To permanently delete the items in the database, see
Permanently Deleting Versions as a Maintenance Operation.