⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mesh2d.m

📁 The Finite Element Method Usign MATLAB.pdf
💻 M
字号:

function mesh2d;
include_flags;

lp = sqrt(nnp);             % number of nodes in the x and y 
x0 = linspace(0,2,lp);      % equal bisection of the x nodes

y0 = 0.5*x0/2;              % the bottom line  

x = [];    
for i = 1:lp                
x = [x x0];                 % define x coordinates

y1 = linspace(y0(i),1,lp);  % bisection of y coodinates starting from a new location   
y(i:lp:lp*(lp-1)+i) = y1;   % collection of y coordinates to the appropriate location

end

% generate the IEN  array
rowcount = 0;
for elementcount = 1:nel
    IEN(1,elementcount) = elementcount + rowcount;
    IEN(2,elementcount) = elementcount + 1 + rowcount;
    IEN(3,elementcount) = elementcount + (lp + 1) + rowcount;
    IEN(4,elementcount) = elementcount + (lp) + rowcount;
    if mod(elementcount,lp-1) == 0
        rowcount = rowcount + 1;
    end
end

% plot mesh and natural boundary conditions
plotmesh;




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -