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 2015年4月28日 GMT-4 05:11

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2011年8月22日 GMT-4 14:12
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: 9 years ago 2015年4月28日 GMT-4 05:11
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.