Lars Gregersen
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年6月8日 GMT-4 08:48
Hi
Just a teaser for those of you who haven't received Comsol 4.2 yet: Comsol 4.2 has a totally new set of coordinate based selection methods built-in. This means that these new selection methods can be used both from the Comsol Desktop and when using Matlab.
Both for Comsol 4.1 and Comsol 4.2 there are sometimes a need for low level functions such as mphselectcoords. The important thing to notice is that the function is entirely based on the coordinates of the vertices of the boundaries you are trying to identify.
E.g. instead of specifying a coordinate on the middle of your boundary like this:
mphselectcoords(model,'geom1',[0.25,1,0.7],'boundary','radius',0.001)
you could do
mphselectcoords(model,'geom1',[0 1 0.5;0.5 1 1]','boundary')
I.e. by picking opposite coordinates of vertices on the boundary you can uniquely identify the boundary.
You can also use mphselectbox instead:
mphselectbox(model,'geom1',[-0.1 0.9 0.4;0.6 1.1 1.1]','boundary')
where the third argument is used to define a box that is slightly larger than the boundary you are trying to identify. mphselectbox is usually easier to understand and easier to work with than mphselectcoords - as long as you are working with geometries that fit nicely within boxes.
Lars Gregersen
Comsol Denmark
Hi
Just a teaser for those of you who haven't received Comsol 4.2 yet: Comsol 4.2 has a totally new set of coordinate based selection methods built-in. This means that these new selection methods can be used both from the Comsol Desktop and when using Matlab.
Both for Comsol 4.1 and Comsol 4.2 there are sometimes a need for low level functions such as mphselectcoords. The important thing to notice is that the function is entirely based on the coordinates of the vertices of the boundaries you are trying to identify.
E.g. instead of specifying a coordinate on the middle of your boundary like this:
mphselectcoords(model,'geom1',[0.25,1,0.7],'boundary','radius',0.001)
you could do
mphselectcoords(model,'geom1',[0 1 0.5;0.5 1 1]','boundary')
I.e. by picking opposite coordinates of vertices on the boundary you can uniquely identify the boundary.
You can also use mphselectbox instead:
mphselectbox(model,'geom1',[-0.1 0.9 0.4;0.6 1.1 1.1]','boundary')
where the third argument is used to define a box that is slightly larger than the boundary you are trying to identify. mphselectbox is usually easier to understand and easier to work with than mphselectcoords - as long as you are working with geometries that fit nicely within boxes.
Lars Gregersen
Comsol Denmark
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年6月8日 GMT-4 10:20
Hi,
thank you for the explanation on how mphselectcoords manages the vertices. I'll work on it -> the difficulty is that I have only coordinate for a single measure point. I'll work on it.
I look forward to version 4.2 :)
Regards,
Gabriel
Hi,
thank you for the explanation on how mphselectcoords manages the vertices. I'll work on it -> the difficulty is that I have only coordinate for a single measure point. I'll work on it.
I look forward to version 4.2 :)
Regards,
Gabriel
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2011年6月8日 GMT-4 10:21
Hi,
thank you for the explanation on how mphselectcoords manages the vertices. I'll work on it -> the difficulty is that I have only coordinate for a single measure point. I'll work on it.
I look forward to version 4.2 :)
Regards,
Gabriel
Hi,
thank you for the explanation on how mphselectcoords manages the vertices. I'll work on it -> the difficulty is that I have only coordinate for a single measure point. I'll work on it.
I look forward to version 4.2 :)
Regards,
Gabriel
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
2012年9月7日 GMT-4 16:19
I am having difficulty in getting the top, bottom faces/boundaries of a cylinder.
Lets say the cylinder is positioned at (x,y,z) and has radius=r and height=h.
I tried to use following command:
bottom = mphselectcoords(model, 'geom1', [x-r, x+r; y-r, y+r; z , z], 'boundary')
But, it didn't work. Similarly, I couldn't get the top and side faces too.
Also, how do we get the domain number for a cylindrical domain, (say for above-mentioned example)?
Thanks,
Kapil
I am having difficulty in getting the top, bottom faces/boundaries of a cylinder.
Lets say the cylinder is positioned at (x,y,z) and has radius=r and height=h.
I tried to use following command:
bottom = mphselectcoords(model, 'geom1', [x-r, x+r; y-r, y+r; z , z], 'boundary')
But, it didn't work. Similarly, I couldn't get the top and side faces too.
Also, how do we get the domain number for a cylindrical domain, (say for above-mentioned example)?
Thanks,
Kapil