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.

Automatic data export with parametric sweep

Please login with a confirmed email address before reporting spam

Hello,
I'm looking for a way to export in an automatic way some results in a text file, in the same way that the 3.5a version does. Back then all you'd have to do was to specify the variables you wanted to export and the output file. I can't find that (very simple) option in the versions 4 (in my cas 4.2a). In the Job configuration menu there is Export to file, but I can't manage to make it work. I couldn't find any (valuable) hint in the doc.
Has anyone succeeded in making that little feature work yet ?
Thanks in advance
--
Y.

3 Replies Last Post Dec 21, 2016, 4:49 p.m. EST
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 16, 2012, 11:56 a.m. EDT
Hi

try the following:
Data Set edge or surface or cut line, plane ...
Right Click export
Define the variable(s), the interpolation, the format, file name ...
Export F5


--
Good luck
Ivar
Hi try the following: Data Set edge or surface or cut line, plane ... Right Click export Define the variable(s), the interpolation, the format, file name ... Export F5 -- Good luck Ivar


Please login with a confirmed email address before reporting spam

Posted: 8 years ago Dec 20, 2016, 4:51 p.m. EST
Hi Ivar,
I ran your file (changed the export data destination) but it did not export the data after simulation was done automatically. I had to press 'Export' manually to export the data file. How can I have the file after simulations exported?
Thanks,
Hamid
Hi Ivar, I ran your file (changed the export data destination) but it did not export the data after simulation was done automatically. I had to press 'Export' manually to export the data file. How can I have the file after simulations exported? Thanks, Hamid

Josh Thomas Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 8 years ago Dec 21, 2016, 4:49 p.m. EST
Hamid,

I have done this using the App Builder capability in the newer releases.

Write a method or have a button event that performs the Export command automatically.

For example, use "Record a New Method" to record the method text for Exporting tabular data or whatever data you'd like to export.

Your method code may end up looking something like this:

model.result().export().create("tbl1", "Table");
with(model.result().export("tbl1"));
set("filename", "C:PATH\FILENAME.txt");
endwith();
model.result().export("tbl1").run();

Once you learn how the methods work it really is quite straightforward to be able to automatically do a lot of repeated, script-type steps that you'd otherwise have to do manually.

Best regards,
Josh Thomas
AltaSim Technologies
Hamid, I have done this using the App Builder capability in the newer releases. Write a method or have a button event that performs the Export command automatically. For example, use "Record a New Method" to record the method text for Exporting tabular data or whatever data you'd like to export. Your method code may end up looking something like this: model.result().export().create("tbl1", "Table"); with(model.result().export("tbl1")); set("filename", "C:PATH\FILENAME.txt"); endwith(); model.result().export("tbl1").run(); Once you learn how the methods work it really is quite straightforward to be able to automatically do a lot of repeated, script-type steps that you'd otherwise have to do manually. Best regards, Josh Thomas AltaSim Technologies

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.