Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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 do I select all objects in an array?

Please login with a confirmed email address before reporting spam

So I'm trying to build an array of squares on a workplane, where the array is of m by n dimensions (I say m and n because I want to vary them in say a parameter sweep or something). I want to subtract these array of squares from an even bigger square (see attached). Problem is that if I start out with a 3x3 array, and then I union the 3x3 array, and do (bigger square - the union of the array), I am fine for the 3x3 case. But since my union selection is going to be arr(1,1)...arr(3,3), if I change the m by n to say 5 and 4, only the arr(1,1)...arr(3,3) is selected (i.e. arr(bigger than 3, bigger than 3)) will not be selected.

So is there some way to select all the objects in an array in an automatic manner so that it is robust in parameter sweeps, regardless of size?


5 Replies Last Post Apr 19, 2017, 3:32 p.m. EDT
COMSOL Moderator

Hello Angelo Wong

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.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 3, 2012, 2:37 p.m. EST
I had the same issue in defining a coil domain and using a parametrized rectangular array to vary the number of turns and layers. Here's one way to select all members of the array:

Use the Definitions > Selection > Box

Define the box to be just around the maximum extent of your array.

Then choose: Include entity if: Entity inside box

Try it out by changing the parameters manually. You can use intersection/union selection commands to remove other entities that might interfere.

Once you have a named selection, you can use it throughout the model for materials definitions, coil domains, and so on.
I had the same issue in defining a coil domain and using a parametrized rectangular array to vary the number of turns and layers. Here's one way to select all members of the array: Use the Definitions > Selection > Box Define the box to be just around the maximum extent of your array. Then choose: Include entity if: Entity inside box Try it out by changing the parameters manually. You can use intersection/union selection commands to remove other entities that might interfere. Once you have a named selection, you can use it throughout the model for materials definitions, coil domains, and so on.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 4, 2012, 3:14 a.m. EST
Once you have a named selection, you can use it throughout the model for materials definitions, coil domains, and so on.

But you cannot use that selection in the geometry sequence — which I think was the intent of the original question.
[QUOTE]Once you have a named selection, you can use it throughout the model for materials definitions, coil domains, and so on. [/QUOTE] But you cannot use that selection in the geometry sequence — which I think was the intent of the original question.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 24, 2012, 5:31 a.m. EDT
Did somebody solve this problem? Is there a way to do this in Matlab?

--
mm
Did somebody solve this problem? Is there a way to do this in Matlab? -- mm

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Aug 7, 2012, 5:34 a.m. EDT
Hi,

I am trying to do something very similar. i want to create n copies of a circle using the 'copy' command and then manipulate only some of the copied objects using the 'compose' command. I have created a 'selection' for the copied objects but cannot find a way to automatically choose all the copied objects in the 'formula' for the 'compose' operation.
Has anyone have a found a solution to this?
Hi, I am trying to do something very similar. i want to create n copies of a circle using the 'copy' command and then manipulate only some of the copied objects using the 'compose' command. I have created a 'selection' for the copied objects but cannot find a way to automatically choose all the copied objects in the 'formula' for the 'compose' operation. Has anyone have a found a solution to this?

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Apr 19, 2017, 3:32 p.m. EDT
The trick is to use 'Selections of Resulting Entities' in the Array menu to 'Contribute to:' 'resulting selections'. You can then in the boolean menus select the cumulative selections you create from the Array sub menu. Cheers!
The trick is to use 'Selections of Resulting Entities' in the Array menu to 'Contribute to:' 'resulting selections'. You can then in the boolean menus select the cumulative selections you create from the Array sub menu. Cheers!

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.