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.
Running COMSOL with Java externally
Posted 2011年8月2日 GMT+8 02:32 API, Simulation Apps Version 4.0, Version 4.0a, Version 4.1, Version 4.2 7 Replies
Please login with a confirmed email address before reporting spam
How do you run (if you can) run COMSOL 4.1 externally with Eclipse/Java? I have tried following doing the feeder_clamp instructions with importing all the plug ins but it does not work. any help would be appreciated even the most simple example.
Please login with a confirmed email address before reporting spam
I use the java code de COMSOL 4.2 in Eclipse/Java,
Only, I import two packages
import com.comsol.model.*;
import com.comsol.model.util.*;
And, I add the *.jars (C:\Program Files\COMSOL42\plugins) in the library buiding-project of Eclipse,
Aron
Please login with a confirmed email address before reporting spam
I have installed Comsol 4.2, generated the Java source file for the feeder_clamp model, and created the Eclipse project as described in the documentation.
When I open the compiled .class file (it can be found in the bin directory of the project) from the Comsol Desktop, the model is loaded and a graphic of a mechanical part is generated. I don't know if you have tried this, but it's an easy way of running the Java model.
However, if I follow the instructions to execute the Java model from Eclipse, and using the Comsol server, when I run the Java application a message is displayed in the server window indicating that a client is connecting, and after a while another message indicates that the client is disconnecting, but nothing more happens... I have followed all the instructions given in the documentation to configure the Eclipse project, i.e. adding the libraries to the project, and adding the two lines in the main method for connecting to the Comsol server, but it doesn't say the expected behaviour when you proceed so...
Do you have any more idea?
Best regards.
P.D.: I'm the Ana's colleague at the CSIC in Spain.
Please login with a confirmed email address before reporting spam
this is normal behaviour. You do not see anything if you run your java file in Eclipse. If you want to see something you have to use the Graphical User Interface which is described in "COMSOL Multiphyiscs/COMSOL Multiphisics Programming Reference Manual/Graphical User Interfaces" in the documentation.
I know that this post is old but I'm answering for descendants.
Best regards
Michael
Please login with a confirmed email address before reporting spam
Can you tell me where to find the COMSOL API user guide? I would great appreciate if you could help me.
Best regards
rene
Please login with a confirmed email address before reporting spam
Jeff
Please login with a confirmed email address before reporting spam
I'm trying to add the java file generated by COMSOL to my NetBeans project. It calls for these two imports:
import com.comsol.model.Model;
import com.comsol.model.util.*;
It is not clear, however, which jar files need to be added to my project to provide the information required. Can you point me to the correct jar files?
Thanks,
Herb Smith
Please login with a confirmed email address before reporting spam
In the Programming Reference Manual in the chapter "Graphical User Interfaces" it says:
"Go to the Libraries tab and click Add External JARs. Add all the JAR files placed in the plugins directory under the COMSOL Multiphysics installation directory (typically
C:\Program Files\COMSOL\COMSOL52a\Multiphysics\plugins)."
I'm sure that there is a similar procedure for NetBeans.
--
Lars Gregersen
Comsol Denmark
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.
