Support Knowledge Base

Solution Number: 980
Title: Can I run COMSOL Multiphysics in batch mode?
Platform: All Platforms
Applies to: All Products
Versions: 3.3, 3.4
Created: January 30, 2006
Last Modified: March 7, 2008
Categories: Product Information
Keywords:

Problem Description

I would like to run my COMSOL Multiphysics computations in batch mode. If I have neither COMSOL Script nor MATLAB.

Solution

If you have COMSOL Script, you can run COMSOL Script files in batch mode without using the command window. Invoke your script from the Linux/Sun operating system command prompt with the comsol command.

comsol batch myscript

will run the script myscript.m in batch mode. (In Windows, use comsolbatch.exe or comsolbatch64.exe instead of the command comsol batch).

Commands requiring a response from the user, for example through dialog boxes, cannot be included in the scripts for batch commands. Plots will not remain on the screen after you have run the batch, and you will lose all data that the script has not saved to file.

If you do not own a copy of COMSOL Script, you can still run an m-file batch mode, provided that you delete all plot commands from the m-file before you run it. File IO functions such as save, load, fread, fwrite, fscanf, and fprintf will not be available, but saving and loading COMSOL mph-files using flsave and flload is possible.

If you run COMSOL Multiphysics with MATLAB, you can run your file in a session without the desktop and the splash screen:

comsol matlab -ml -nosplash -mlr myscript

Related Files

myscript.m 1 KB
  Put the file myscript.m in your working directory and give the command comsol batch myscript. First a simple COMSOL Multiphysics problem is solved and then a simple linear algebra operation is performed. The results are saved to file.


Feedback

Poor | Excellent
Document quality?




« Back to Support Knowledge Base

Disclaimer

COMSOL makes every reasonable effort to verify the information you view on this page. Resources and documents are provided for your information only, and COMSOL makes no explicit or implied claims to their validity. COMSOL does not assume any legal liability for the accuracy of the data disclosed. Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark details.

© 1997-2008 COMSOL AB.
COMSOL, COMSOL Multiphysics, COMSOL Reaction Engineering Lab, COMSOL Script and
FEMLAB are registered trademarks of COMSOL AB. Other product or brand names are
trademarks or registered trademarks of their respective holders. All Rights Reserved.