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.

How can I access explicit selections after solving?

Please login with a confirmed email address before reporting spam

The below post is related to an archived discussion


[start here]

The above question was perfectly asked, and I'm disappointed that it hasn't been answered. It'd be really nice to use previously defined explicit selections when processing data, for example to show a contour only in a set of domains defined in the geometry node with an explicit selection.

I imagine a workaround may be to define a dummy material on an explicit selection and then reference the material somehow with a boolean expression?

Thanks!


3 Replies Last Post 25.02.2019, 02:07 GMT-5
Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 22.02.2019, 02:09 GMT-5

You can use a plot selection subnode to achieve the effect that you want: Create e.g. a contour plot, add a selection subnode to the plot, choose the explicit selection in the selection subnode, plot. The selection attribute wasn't available when the original question was asked, so at that time the best solution would be to add a selection subnode to the solution data set that the plot refers to.

You can use a plot selection subnode to achieve the effect that you want: Create e.g. a contour plot, add a selection subnode to the plot, choose the explicit selection in the selection subnode, plot. The selection attribute wasn't available when the original question was asked, so at that time the best solution would be to add a selection subnode to the solution data set that the plot refers to.

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 22.02.2019, 16:05 GMT-5
Updated: 6 years ago 22.02.2019, 16:06 GMT-5

Hmm perhaps this is only on Windows? I usually use Linux, and if I remember correctly I definitely checked the context menu for subnodes on the plot and it offered filter subnodes but not selection. If it is available for Linux and I have missed it I would be interested to know.

In any case, I really need a programmatic selection technique and not just a plot subnode so that I can selectively manipulate data outside certain regions of interest when exporting data on a grid. So for example it would be nice to export es.normE * (selec==3) instead of es.normE * (dom==1 && dom==3 ...) For the time being I have successfully implemented a workaround of defining different materials to represent the selection, so that i can export es.normE * (material.domain==1) for example.

Hmm perhaps this is only on Windows? I usually use Linux, and if I remember correctly I definitely checked the context menu for subnodes on the plot and it offered filter subnodes but not selection. If it is available for Linux and I have missed it I would be interested to know. In any case, I really need a programmatic selection technique and not just a plot subnode so that I can selectively manipulate data outside certain regions of interest when exporting data on a grid. So for example it would be nice to export es.normE * (selec==3) instead of es.normE * (dom==1 && dom==3 ...) For the time being I have successfully implemented a workaround of defining different materials to represent the selection, so that i can export es.normE * (material.domain==1) for example.

Gunnar Andersson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 25.02.2019, 02:07 GMT-5

The plot selection subnode is available also on Linux. It was introduced in 5.3.

There isn't any corresponding subnode for data export nodes, but I think that you should consider using data set selections instead of the expression manipulation that you are using now. E.g., create a solution data set, add a selection to the data set, create a data export node, point it to the data set with the selection.

The plot selection subnode is available also on Linux. It was introduced in 5.3. There isn't any corresponding subnode for data export nodes, but I think that you should consider using data set selections instead of the expression manipulation that you are using now. E.g., create a solution data set, add a selection to the data set, create a data export node, point it to the data set with the selection.

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.