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

📄 fmg_cycle.m

📁 五点差分型多重网格方法:各种插值算子的比较)
💻 M
字号:
%FMG_CYCLE Full Multigrid Algorithm
%
%       U_OUT = FMG_CYCLE(LEVEL, B) uses the full-multigrid cycle to 
%       recursively solve the linear system AX=B at the given level.
%
%       No global variables are accessed.

% James Bordner and Faisal Saied
% Department of Computer Science
% University of Illinois at Urbana-Champaign
% 10 April 1995

% Modified for Matlab Version 6 Compatability
% Ryan McKenzie
% University of Kentucky Center for Computational Sciences
% May 2004
%
% Minor changes made in determining if we are on the coursest level currently.

function u_out = fmg_cycle(level, b)

C_level=coarsest;
if level==C_level
   u_out   = coarse_grid_solve(level,b);
else
   b_c	   = restrict(level, b);
   u_c_out = fmg_cycle(level+1, b_c);
   u_f_in  = interpolate(level, u_c_out);
   u_out   = mg_cycle(level, b, u_f_in);
end

⌨️ 快捷键说明

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