Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Load a model .mph using Java

Please login with a confirmed email address before reporting spam

Hi,

I want to knnow how to load a model .mph using Java code,

My goal is to load a model named "mymodel.mph" build in Comsol 4.2, after that I use the Model object in order to resolve equations,

I did...

Model model = ModelUtil.load("Model", "mymodel.mph");

and I find

exception NullPointerException


Thanks in advance

2 Replies Last Post 28 avr. 2015, 05:11 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 22 août 2011, 14:12 UTC−4
I tested this code java

Model model = ModelUtil.create("Model");
model = ModelUtil.load("Model", pathProject + pathFile + nameModelComsolMph);

and I run very well

Thanks for your help,
I tested this code java Model model = ModelUtil.create("Model"); model = ModelUtil.load("Model", pathProject + pathFile + nameModelComsolMph); and I run very well Thanks for your help,

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 28 avr. 2015, 05:11 UTC−4
I used your code. Unfortunately, loading my case 59MB large takes more than 15 minutes. Has anybody else also experienced such long delays?
I used your code. Unfortunately, loading my case 59MB large takes more than 15 minutes. Has anybody else also experienced such long delays?

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.