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.
Extracting Plot Data from a Parametric Sweep Using the Java API
Posted 20.06.2015, 12:52 GMT-4 API 0 Replies
Please login with a confirmed email address before reporting spam
I have successfully extracted plot data for a simple simulation as follows:
ResultFeature plot = model.result("pg3").feature("ptgr6");
int traceCount = plot.getGroups(0);
for (int index = 0; index < traceCount; ++index) {
float[] samples = plot.getData(0, traceIndex, "Height");
...
}
When I add a parametric sweep, though, I only seem to get the first solution's data. Exporting the data to a CSV file works fine, but I can't figure out how to access the other solutions within the program. I tried adding the following lines to no avail:
int solutionIndex = 2;
plot.set("outerinput", "manual");
plot.set("outersolnum", new int{solutionIndex}));
I get an error if the solutionIndex is anything but the default value for outersolnum (i.e. 1).
If anybody could enlighten me as to what I am not understanding I would be eternally grateful.
Hello Peter Lane
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.