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.
creating 2D-domains with curved boundaries defined by data points
Posted 15 feb 2010, 16:18 GMT-5 0 Replies
Please login with a confirmed email address before reporting spam
please help, I am stuck with the following (simple) task: I want to create a 2D-mesh with 4 curved boundaries (the domain can be thought of as a deformed rectangle). Later on, I want to impose different boundary conditions on each of the 4 curves. My problem is that, while creating this geometry, the 4 curved boundaries get subdivided in to many boundary edges. Later on, as far as I understand, I have to define the boundary conditions on the many little boundary edges. This is a real pain since there are many boundary edges and, in addition, it is not clear to me how to track which boundary edge belongs to which of the 4 boundary curves.
So my question is: how can I create a 2D-domain defined by (e.g. 4) curves and how can I address these curves as the boundary domains in a convenient way.
In the following I describe how far I get. I use Matlab for scripting:
The 4 curves are defined by measured data points, here is a simple example where only one edge of the rectangle is actually curved:
myCurveL =[20 20
770 20];
myCurveR =[134 179 205 269 258 254 264 266 281 273
20 57 106 453 486 545 617 684 737 770];
myCurveT =[20 134
20 20];
myCurveB =[273 20
770 770];
That's how the domain should look like:
figure(1)
plot(myCurveL(1,:),myCurveL(2,:))
hold on
plot(myCurveR(1,:),myCurveR(2,:))
plot(myCurveT(1,:),myCurveT(2,:))
plot(myCurveB(1,:),myCurveB(2,:))
hold off
Now I create curve2 objects using the geomspline function:
cL=geomspline(myCurveL,'splinemethod','chordlength','closed','off');
cT=geomspline(myCurveT,'splinemethod','chordlength','closed','off');
cB=geomspline(myCurveB,'splinemethod','chordlength','closed','off');
cR=geomspline(myCurveR,'splinemethod','chordlength','closed','off');
Now I create the solid 2D domain using the function geomcoerce:
subDom = geomcoerce('solid',{cL,cR,cT,cB});
The result can be plotted using geomplot:
geomplot(subDom,'edgelabel','on');
Here you see my problem: the curve on the right is fragmented in to many small edges. However, each of these edges belong to the same boundary domain, the "right curve". On these edges, the same boundary condition will be imposed. So how can I regroup them or at least track their membership in a convenient way?
Thanks for your help,
AB
Hello Achim Besser
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.