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 Apr 28, 2015, 5:11 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 22, 2011, 2:12 p.m. EDT
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 Apr 28, 2015, 5:11 a.m. EDT
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.