Discussion ClosedThis 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 Java class file in batch mode
Posted 2016年3月1日 GMT+1 18:17Version 5.13 Replies
Please login with a confirmed email address before reporting spam
I'm writing a COMSOL model file using the Java COMSOL API, and I'm encountering a problem with running the files in batch mode. In particular, when I put in the code to import a CAD file:
...
model.geom("geom1").create("imp1", "Import");
model.geom("geom1").feature("imp1").set("filename", "C:\Path\to\File.sldprt");
model.geom("geom1").runPre("fin");
...
When I try to run the model in batch mode using
comsolbatch -inputfile -outputfile -batchlog
it doesn't run successfully. The resulting model file is empty and the log file contains the following text:
/******************/
/*****Error********/
/******************/
access denied ("java.io.FilePermission" "PATH\testpart.SLDPRT" "read")
Saving model: PATH\importmodel_Model.mph
Save time: 0 s.
Total time: 4 s.
(where I have replaced my actual path with a placeholder). I don't understand why I am getting this error. It's even stranger considering that I can import a file and create a COMSOL model with no problem in the GUI, but then even when I record a Java macro based on that successful model, the code will encounter the same error when I try to compile and run it in batch mode.
...
model.geom("geom1").create("imp1", "Import");
model.geom("geom1").feature("imp1").set("filename", "C:\Path\to\File.sldprt");
model.geom("geom1").runPre("fin");
...
When I try to run the model in batch mode using
comsolbatch -inputfile
it doesn't run successfully. The resulting model file is empty and the log file contains the following text:
/******************/
/*****Error********/
/******************/
access denied ("java.io.FilePermission" "PATH\testpart.SLDPRT" "read")
Saving model: PATH\importmodel_Model.mph
Save time: 0 s.
Total time: 4 s.
(where I have replaced my actual path with a placeholder). I don't understand why I am getting this error. It's even stranger considering that I can import a file and create a COMSOL model with no problem in the GUI, but then even when I record a Java macro based on that successful model, the code will encounter the same error when I try to compile and run it in batch mode.
3 Replies
Last Post 2016年8月3日 GMT+2 14:36
Hello Christopher Lioi
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.
