Discussion Forum

Numbering of the boundaries in *.m file

Topics: no topics

Thread index  |  Previous thread  |  Next thread  |  Start a new discussion

RSS FeedRSS feed   |   Email notificationsTurn on email notifications   |   7 Replies   Last post: July 26, 2010 3:26pm UTC
Onur Ilkorur

Onur Ilkorur

August 28, 2009 1:01pm UTC

Numbering of the boundaries in *.m file

Hello all,

I am working on a parametric geometry model and I want to create my geometry/solution fully in script. I have to say that it is a rather complex geometry and till now I took the short and easy way by first creating my geometry in MatLab script with Comsol functions, exporting it to Comsol, doing the necessary subdomain and boundary settings there, exporting the model back to a "*.m" file (letting Comsol deal with the numbering for me) and proceeding with the solution.

Now, the geometry became more complex and the number of boundaries are not constant anymore and I need to understand how Comsol numbers the boundaries so that I can assign the correct boundary conditions without switching between Comsol and MatLab. When I look at bnd.ind=[] and equ.ind=[] there seems to be a logic behind the numbering but I couldn't be able to find any documentation explaining that systematic.

Thanks in advance,
Onur

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Jean Rubiella

Jean Rubiella

September 3, 2009 11:45am UTC in response to Onur Ilkorur

Re: Numbering of the boundaries in *.m file

Hi,
It seems that the index of boundary begins on the left bottom corner of your windows and then increase until the right top corner with priority to the horizontal boundaries.
It's what I noticed. I hope it can help you in your project.

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Yannick fargier

Yannick fargier

September 4, 2009 8:28am UTC in response to Onur Ilkorur

Re: Numbering of the boundaries in *.m file

Hello,

Comsol increment with a sort of triple loop (for x=1:end; for y=1:end; for z=1:end) to find the boundary number.

I have a matlab code which finds a face (or boundary) number (If you know the boundary position (x,y,z)).
the second matlab code finds vertex number.

I hope codes will help you,

Y.

Attachments:   face.m   vertex.m  

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Onur Ilkorur

Onur Ilkorur

September 4, 2009 12:52pm UTC in response to Yannick fargier

Re: Numbering of the boundaries in *.m file

Hello Jean and Yannick,

Thanks to both of you! It seems I am benefiting fully form the experiences of the users who have been there before.

/Onur

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Tom Myers

Tom Myers

November 3, 2009 5:42pm UTC in response to Onur Ilkorur

Re: Numbering of the boundaries in *.m file

Hi,

This is an excellent function! Just should have provided an example of its use.

function result = face(geometry,x,y,z,tol,density)


I would emphasis that the x,y,z co-ordinates are "rubberband" co-ordinates i.e.

face(fem.geom,[3.6e-6 3.8e-6],[4e-6 4.5e-6],[0 40e-6],1e-3,2)

Orginally I entered tol=1 which resulted in all the boundaries in the model being returned, this is because this is the tolerance and 1 = 1m which is larger than my model space.

I am still to work-out what the density is? I have it set to 2 and it is working well!

Good Work!!


Regards,
Tom

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Francis Généreux

Francis Généreux

March 15, 2010 4:04pm UTC in response to Yannick fargier

Re: Numbering of the boundaries in *.m file

Hi,

Thanks for the great functions. I have another problem setting the boundary of a complicated geometry in Matlab that is somewhat related to the above topic. The problem that I am trying to solve is involving more than 400 faces. A lot of them are in contact. I am wondering if there is function or list of commands able to find faces that are in contact.

Regards,

Francis

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

Jeremy Teo

Jeremy Teo

April 13, 2010 3:59am UTC in response to Yannick fargier

Re: Numbering of the boundaries in *.m file

Hi Yannick,

This is amazing, but I cannot seem to get it to work in 2D :( can you advise me on how to get it done into2D? and it will give me the index of boundaries if I'm not wrong.

Thanks!

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse

MOhmesICx

MOhmesICx

July 26, 2010 3:26pm UTC in response to Jeremy Teo

Re: Numbering of the boundaries in *.m file

In 3.5a I was able to do this using a combination of geomcsg and flgeomnbs. However, I cannot figure out how to do this with version 4.0a? Has anyone figured out how to track the boundaries or more specifically how to determine what boundary numbers are assigned to a specific geometry feature?

Reply  |  Reply with Quote  |  Send private message  |  Report Abuse


Rules and guidelines