Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
31 juil. 2012, 03:20 UTC−4
Hi Rachele
In order to view any results, you need eclipse to export the results with a command like
model.result().export("data1").run();
This command will work for .txt files, but not image files (i'm still trying to figure out the latter). This command is similar to clicking the export button in COMSOL.
A good way to learn use COMSOL with java is to go the end of the APi guide and do the steady state example for a beam they have. I've been able to take that and write my own code. I know you can visualize images from post processing with this tutorial but I am still learning to have it export image files. I can post that later if you need it.
Just having eclipse connect/disconnect will not generate results unless they are exported.
An alternative is to have eclipse run the java file and then you recompile it as a .class file that you reimport into COMSOL.
I hope this helps. I'm working with 4.2a but it shouldn't be too different.
Hi Rachele
In order to view any results, you need eclipse to export the results with a command like
model.result().export("data1").run();
This command will work for .txt files, but not image files (i'm still trying to figure out the latter). This command is similar to clicking the export button in COMSOL.
A good way to learn use COMSOL with java is to go the end of the APi guide and do the steady state example for a beam they have. I've been able to take that and write my own code. I know you can visualize images from post processing with this tutorial but I am still learning to have it export image files. I can post that later if you need it.
Just having eclipse connect/disconnect will not generate results unless they are exported.
An alternative is to have eclipse run the java file and then you recompile it as a .class file that you reimport into COMSOL.
I hope this helps. I'm working with 4.2a but it shouldn't be too different.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
3 août 2012, 07:15 UTC−4
If you want an external image, there is two ways I've figured out thus far. You can use the java method "Robot" to take a screenshot of a GUI generated by COMSOL or have COMSOL export the data in table form and have another program generate the image
If you want an external image, there is two ways I've figured out thus far. You can use the java method "Robot" to take a screenshot of a GUI generated by COMSOL or have COMSOL export the data in table form and have another program generate the image
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
29 juin 2017, 08:34 UTC−4
Hi Rachelle,
we are just looking to get a text value for the eig freq, so we can link to external software.
the model computes the freq, we have set up a table and link the computed result to the table.
in GUI mode the txt output file is written with content, in batch mode the message 'cannot open file for writing' appears..
cheers
Hi Rachelle,
we are just looking to get a text value for the eig freq, so we can link to external software.
the model computes the freq, we have set up a table and link the computed result to the table.
in GUI mode the txt output file is written with content, in batch mode the message 'cannot open file for writing' appears..
cheers
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
8 juil. 2017, 15:49 UTC−4
Updated:
7 years ago
8 juil. 2017, 15:49 UTC−4
#Chris - It sounds like a permission problem. If you open COMSOL (the GUI) and go to "Preferences", you can control the permission from the security tab. These permissions apply to batch execution also. I guess you need to set "File system access" to "All files", but other permissions might also be relevant.
#Alexander/Rachele - Since all COMSOL graphics are generated "on GUI" there is no native support for off screen rendering. However, it's possible to run COMSOL with GUI in batch mode; simply add the "-graphics" flag when you execute your compiled .class file. A GUI will then pop-up when you need it for graphics exports. I use this option in combination with xvfb (a virtual frame buffer) to generate graphics from COMSOL on our cluster which does not have a display.
#Chris - It sounds like a permission problem. If you open COMSOL (the GUI) and go to "Preferences", you can control the permission from the security tab. These permissions apply to batch execution also. I guess you need to set "File system access" to "All files", but other permissions might also be relevant.
#Alexander/Rachele - Since all COMSOL graphics are generated "on GUI" there is no native support for off screen rendering. However, it's possible to run COMSOL with GUI in batch mode; simply add the "-graphics" flag when you execute your compiled .class file. A GUI will then pop-up when you need it for graphics exports. I use this option in combination with xvfb (a virtual frame buffer) to generate graphics from COMSOL on our cluster which does not have a display.