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 to identify subdomains after geomcsg()
Posted 14.04.2010, 07:30 GMT-4 2 Replies
Please login with a confirmed email address before reporting spam
Hello Comsol community,
I want to identify subdomains I built with an m-file.
What I do is to build objects, e.g. block3. Then I create arrays out of these blocks. Finally I create the "fem"-geometry by using geomcsg.
Afterwards I need complicated algorithms to identify my single subdomains (e.g. I want to access the first block3 in the first array). The order of these objects has regularities but it would be easier for me, if I could define the order to know that object 5 is the fifth object in array 1.
Why do I need to know the order of objects? For example to define subdomain conditions or to calculate results for a certain object. Additionally, when I add one object to the geometry I do not know whether it is first, last or at whatever position.
Is there any possibility to define the order of these objects?
Thanks for your help!
Clemens
Example:
b1=block3(1,1,1,'base','center','pos',{'1','1','1'},'rot','0');
b1_a = geomarrayr(b1,0,2,0,1,2,1);
b2=block3(1,1,1,'base','center','pos',{'1','1','3'},'rot','0');
b2_a = geomarrayr(b2,2,0,0,2,1,1);
b3=block3(3,3,1,'base','corner','pos',{'1','1','5;},'axis',{'0','0','1'},'rot','0');
clear fem;
geom = geomcsg({geomcsg(b1_a),geomcsg(b2_a),b3});
fem.geom = geom;
fem.draw = geom;
I want to identify subdomains I built with an m-file.
What I do is to build objects, e.g. block3. Then I create arrays out of these blocks. Finally I create the "fem"-geometry by using geomcsg.
Afterwards I need complicated algorithms to identify my single subdomains (e.g. I want to access the first block3 in the first array). The order of these objects has regularities but it would be easier for me, if I could define the order to know that object 5 is the fifth object in array 1.
Why do I need to know the order of objects? For example to define subdomain conditions or to calculate results for a certain object. Additionally, when I add one object to the geometry I do not know whether it is first, last or at whatever position.
Is there any possibility to define the order of these objects?
Thanks for your help!
Clemens
Example:
b1=block3(1,1,1,'base','center','pos',{'1','1','1'},'rot','0');
b1_a = geomarrayr(b1,0,2,0,1,2,1);
b2=block3(1,1,1,'base','center','pos',{'1','1','3'},'rot','0');
b2_a = geomarrayr(b2,2,0,0,2,1,1);
b3=block3(3,3,1,'base','corner','pos',{'1','1','5;},'axis',{'0','0','1'},'rot','0');
clear fem;
geom = geomcsg({geomcsg(b1_a),geomcsg(b2_a),b3});
fem.geom = geom;
fem.draw = geom;
2 Replies Last Post 14.04.2010, 12:03 GMT-4