To connect to a COMSOL Multiphysics server from the COMSOL Desktop, select File>COMSOL Multiphysics Server>Connect to Server (
). For Windows users, you can also customize the Quick Access Toolbar and then click the
Connect to Server button.
Then in the Connect to Server dialog box, specify the hostname of the server in the
Server field. The
Port list setting specifies the TCP/IP port number of the server. Select
Default to use the default port number, or select
Manual to specify the port number in the field below. Then enter your user credentials under
User.
When you connect to a server, you may be asked if you want to save your current model. We recommend that you respond yes to get the most current version of your model transferred to the server. If you answer
no, the latest saved copy of your model is transferred to the server.
To close the connection to the server or MATLAB, select File>COMSOL Multiphysics Server>Disconnect from Server (
). For Windows users, you can also customize the Quick Access Toolbar and then click the
Disconnect from Server button.
Disconnecting from the server transfers the current model from the server to the COMSOL Desktop, which no longer runs as a client. By default, the option -multi is set to
auto, which provides an option to choose if you want the server to keep running (if you use another client than the COMSOL Desktop, the server exits by default). It can also be set to
-multi off to always exit. Start the server with the option
-multi on to keep it running after the disconnect. When you have used the option
-multi on, or if you use the default option and choose to keep the server running, your model is kept in memory in the server, and you can attach to the model from another client later on. If you close the COMSOL Desktop when connected to a server, the client-server session is automatically disconnected, and the server continues to run with the model in memory if you have specified
-multi on.
In the Preferences dialog box, the following settings are available on the
Client Server page to control how the software handles the COMSOL Multiphysics Server when exiting a COMSOL Multiphysics client and when disconnecting from a server:
From MATLAB, you can use the commands Modelutil.connect and
Modelutil.disconnect to connect and disconnect from a COMSOL Multiphysics server, respectively. The connection to the server is necessary to access and manipulate a model.
If several applications are present on the server, to get access to a particular application, select File>COMSOL Multiphysics Server>Import Application from Server (
). For Windows users, you can also customize the Quick Access Toolbar and then click the
Import Application from Server button.
To delete applications (remove them from the server) that you have created using ModelUtil, select
File>COMSOL Multiphysics Server>Remove Applications from Server (
). For Windows users, you can also customize the Quick Access Toolbar and then click the
Remove Applications from Server button.