Remarks on rectangular elements


Do it yourself-style

Make a rectangular grid and number it in the canonical way (left to rigt, bottom to top). Build a p-matrix of edges as in triangular case:

>> x=linspace(0,1,6);
>> y=linspace(0,1,5);
>> [X,Y]=meshgrid(x,y)

X =

         0    0.2000    0.4000    0.6000    0.8000    1.0000
         0    0.2000    0.4000    0.6000    0.8000    1.0000
         0    0.2000    0.4000    0.6000    0.8000    1.0000
         0    0.2000    0.4000    0.6000    0.8000    1.0000
         0    0.2000    0.4000    0.6000    0.8000    1.0000

Y =

         0         0         0         0         0         0
    0.2500    0.2500    0.2500    0.2500    0.2500    0.2500
    0.5000    0.5000    0.5000    0.5000    0.5000    0.5000
    0.7500    0.7500    0.7500    0.7500    0.7500    0.7500
    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000

>> Xt=X';
>> px=Xt(:)';

>> Yt=Y';
>> py=Yt(:)';
>> plot(px,py,'o')

>> p=[px;py]

Thus, at least the p-matrix is easy.

'poimesh'-style

>> lowleftx=...,...;
>> pderect([lowleftx,lowrightx,lowrighty,highrighty])
%% Export geometry and boundary
>> [p,e,t]=poimesh(g,4)
>> pdemesh(p,e,t)

The rectangle-info can be obtained from p and t. (Think of the boundary- edge-info.)
This page created by <Heikki.Apiola@hut.fi>
Last update 15.4.97