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

📄 get_matrix_fem.asv

📁 五点差分型多重网格方法:各种插值算子的比较)
💻 ASV
字号:
function get_matrix_fem(nx,ny)
gauss = [-1/sqrt(3), 1/sqrt(3)]; % Gaussian quadrature point
% construct Q1 mesh
[x,y,conn,ne,np] = getQ1mesh(nx,ny);
Ag = zeros(np);
bg=zeros(np,1);
nloc = 4; % number of nodes per element
for ie = 1:ne % loop over all elements
rhs= (feval(@SRC,x(conn(ie,1)),y(conn(ie,1)))...
+ feval(@SRC,x(conn(ie,2)),y(conn(ie,2)))...
+ feval(@SRC,x(conn(ie,3)),y(conn(ie,3)))...
+ feval(@SRC,x(conn(ie,4)),y(conn(ie,4))))/nloc;
[A_loc,rhse] = elemA(conn,x,y,gauss,rhs,ie);
% assemble local matrices into the global matrix
for i=1:nloc;
irow = conn(ie,i); % global row index
bg(irow)=bg(irow) + rhse(i);
for j=1:nloc;
icol = conn(ie,j); %global column index
Ag(irow, icol) = Ag(irow, icol) + A_loc(i,j);
end;
end;
end;

⌨️ 快捷键说明

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