Connecting, Disconnecting, and Reconnecting to and from the Desktop
Connecting to a COMSOL Multiphysics Server
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.
The port number is displayed by the server as you start it. The port number can change, for example, if you have several COMSOL Multiphysics servers running at the same time on the same computer. Each server is assigned a separate port number. The username and password are the ones you used when you started the server the first time.
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.
When you connect to a server, your model is transferred to the server by default. If there is already a model in the server, you may be asked if you want to work with your current model in the desktop or the model on the server.
Disconnecting from a COMSOL Multiphysics 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.
Reconnecting to a COMSOL Multiphysics Server
If you lose the connection between the COMSOL Desktop and a COMSOL Multiphysics server, the COMSOL Multiphysics software makes five attempts to reconnect to the COMSOL Multiphysics server. The following window appears:
After five failed attempts, you get a possibility to manually attempt to reconnect to the server. If the connection remains lost, check the network and cables and the computer where the COMSOL Multiphysics servers is installed.
Preferences for Exiting and Disconnecting
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 the When exiting the COMSOL Multiphysics client list, choose Ask (the default) to get a question if you want to shut down the COMSOL Multiphysics Server when you exit the COMSOL Multiphysics client, choose Leave server running to exit the client but keep the COMSOL Multiphysics Server running, or choose Shut down server to shut down the COMSOL Multiphysics Server.
From the When disconnecting from a server list, choose Ask (the default) to get a question if you want to shut down the COMSOL Multiphysics Server when you disconnect from it, choose Leave server running to disconnect but keep the COMSOL Multiphysics Server running, or choose Shut down server to shut down the COMSOL Multiphysics Server when disconnecting.
Working with MATLAB, Excel, or the COMSOL API
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.
From MATLAB (and the COMSOL API), you can create multiple models using the ModelUtil.create and ModelUtil.model commands.
Import Application from Server
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.
Remove Applications from Server
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.