Comsol w/Matlab: CLI vs GUI issues

In summary, the code fails to import a geom.mphbin file if it is run through the Comsol/Matlab GUI, but works if the code is run through a CLI. There is a typo in the code that only appears in my post, and there is no way to run the code without a GUI.
  • #1
grumpymrgruff
17
2
Hi all - I've been working on some code in Comsol w/ Matlab that works fine on any machine I run it on - so long as I run it through the Comsol w/ Matlab GUI.

No matter which machine I run it on, the program fails if I run Comsol w/ Matlab through a CLI. Specifically, the geominport() function fails to import my geom.mphbin file with the following error (gap is the name of my model m-file):

Code:
>> gap
? Java exception occurred:
java.lang.NullPointerException
        at com.femlab.server.MlProgressDlg.runAndWait(Unknown Source)
        at com.femlab.server.FlRunnable.a(Unknown Source)
        at com.femlab.server.FlRunnable.smartRunner(Unknown Source)

Error in ==> geomimport at 208
glr.jptr.smartRunner(report, 500);

Error in ==> gap at 23
garr = geomimport('./geom.mphbin');

I am planning to submit this code as a job on a computer cluster where any kind of GUI interface will be out of the question. Has anyone using Comsol/Matlab encountered this problem before, and do you know any workarounds that will let me get my code running without a GUI?

Thanks much!
 
Physics news on Phys.org
  • #2
Hi,

Can it be that you try to use the function geomimport() but misspelled it to geominport() ?

Good luck
/ T

grumpymrgruff said:
Hi all - I've been working on some code in Comsol w/ Matlab that works fine on any machine I run it on - so long as I run it through the Comsol w/ Matlab GUI.

No matter which machine I run it on, the program fails if I run Comsol w/ Matlab through a CLI. Specifically, the geominport() function fails to import my geom.mphbin file with the following error (gap is the name of my model m-file):

Code:
>> gap
? Java exception occurred:
java.lang.NullPointerException
        at com.femlab.server.MlProgressDlg.runAndWait(Unknown Source)
        at com.femlab.server.FlRunnable.a(Unknown Source)
        at com.femlab.server.FlRunnable.smartRunner(Unknown Source)

Error in ==> geomimport at 208
glr.jptr.smartRunner(report, 500);

Error in ==> gap at 23
garr = geomimport('./geom.mphbin');

I am planning to submit this code as a job on a computer cluster where any kind of GUI interface will be out of the question. Has anyone using Comsol/Matlab encountered this problem before, and do you know any workarounds that will let me get my code running without a GUI?

Thanks much!
 
  • #3
dontommazo said:
Hi,

Can it be that you try to use the function geomimport() but misspelled it to geominport() ?

Good luck
/ T

Good eye. I didn't notice that. Unfortunately, the typo is only in my post, not in the code. Right now I'm running the job on a cluster with X11 forwarding for the GUI and hoping that I don't lose my connection to the cluster for about a week's worth of computation. ;-)
 

1. What is the difference between CLI and GUI in Comsol with Matlab?

CLI (Command Line Interface) and GUI (Graphical User Interface) are two different ways of interacting with Comsol when using Matlab. CLI involves entering commands and parameters through a command line, while GUI uses a visual interface with menus and buttons.

2. Which is better for performing simulations, CLI or GUI?

The choice between CLI and GUI depends on the user's preference and the complexity of the simulation. CLI allows for more precise control and is better for automating tasks, while GUI is more user-friendly and easier to use for beginners.

3. Can I switch between CLI and GUI while using Comsol with Matlab?

Yes, it is possible to switch between CLI and GUI in Comsol with Matlab. Some tasks may require using both interfaces, such as setting up the simulation through GUI and then running it through CLI.

4. Are there any limitations when using CLI instead of GUI in Comsol with Matlab?

CLI has some limitations compared to GUI in Comsol with Matlab. For example, not all features and options may be available in CLI, and some tasks may require more complex commands to be performed through CLI.

5. How can I learn more about using CLI in Comsol with Matlab?

There are various resources available for learning how to use CLI in Comsol with Matlab, including tutorials, documentation, and online forums. Comsol also offers training courses and webinars specifically focused on using CLI for simulations.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
10K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
7K
  • Special and General Relativity
Replies
1
Views
2K
Back
Top