The model object utility methods are available with the ModelUtil object. These methods can be used, for example, to create or remove a new model object, but also to enable the progress bar or list the model object available in the COMSOL
server.
Use the method ModelUtil.create to create a new model object in the COMSOL
server:
This command creates a model object Model on the COMSOL
server and a MATLAB object
model that is linked to the model object
<ModelTag> in the COMSOL
server.
It is possible to have several model objects on the COMSOL server, each with a different name. To access each model object requires different MATLAB variables linked to them and each MATLAB variable must have a different name.
Create a MATLAB variable linked to an existing model object with the function ModelUtil.model. For example, to create a MATLAB variable
model that is linked to the existing model object
<ModelTag> on the COMSOL
server, enter the command
The mphload function is most commonly used with the filename of a COMSOL model as an argument. You can use the function
mphopen as well for the same purpose.
To remove a specific model object use the method ModelUtil.remove. For example, to remove the model object
<ModelTag> from the COMSOL
server enter the command
It is possible to use the mphrun function to run solvers and to create geometries, meshes and so on. The
mphrun command will by default show a progress bar while performing work to make it possible to monitor the progress of COMSOL while working on the model. For example, to start the solver execute
By default when calling a run() method no progress information is displayed while running COMSOL with MATLAB. To manually enable a progress bar and visualize the progress of operations (such as loading a model, creating a mesh, assembling matrices, or computing the solution), enter the command