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.

Finding face numbers after revolution

Please login with a confirmed email address before reporting spam

If I define a series of curves, and then make them solid, and revolve them, how do I go about figuring out which faces correspond to which curves?

For example, if I have cur1 through cur6 defined previously, and I use:

carr = {cur1,cur2,cur3,cur4,cur5,cur6};
g1 = geomcoerce('solid',carr);
g2 = revolve(g2,'revaxis',[0 1;0 0],'wrkpln',[0 0 1;0 0 0;0 1 0]);

How do I determine which face numbers of g2 correspond to cur4?
I know I can change the second line to

[g1 ctx] = geomcoerce('solid',carr,'out','ctx');

To get which curves in the solid object correspond to each of the initial curves, and use:

[c4,~] = find(ctx{4});

to extract this information regarding curve 4. But I don't know how to take this information and get the face number out. Any help woulud be greatly appreciated.

1 Reply Last Post Mar 12, 2012, 7:47 p.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Mar 12, 2012, 7:47 p.m. EDT
If anyone else is having trouble with something similar, I figured out a solution for this particular issue.

I looped over each of the curves to form an array of faces in 3D, then coerced them to a 3D solid. (rather than forming a 2D solid and revolving it)

carr = {cur1,cur2,cur3,cur4,cur5,cur6};
for i = 1:length(carr)
g2{i} = revolve(carr{i},'revaxis',[0 1;0 0],'wrkpln',[0 0 1;0 0 0;0 1 0]);
end
[g3 ftx] = geomcoerce('solid',g2,'out','ftx');
[f4,~] = find(ftx{4});

After this code, f4 contains a list of the faces which were formed by the revolution of cur4.
If anyone else is having trouble with something similar, I figured out a solution for this particular issue. I looped over each of the curves to form an array of faces in 3D, then coerced them to a 3D solid. (rather than forming a 2D solid and revolving it) carr = {cur1,cur2,cur3,cur4,cur5,cur6}; for i = 1:length(carr) g2{i} = revolve(carr{i},'revaxis',[0 1;0 0],'wrkpln',[0 0 1;0 0 0;0 1 0]); end [g3 ftx] = geomcoerce('solid',g2,'out','ftx'); [f4,~] = find(ftx{4}); After this code, f4 contains a list of the faces which were formed by the revolution of cur4.

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.