?? vmg_cycle.asv
字號:
%VMG_CYCLE V-Cycle algorithm.
%
% U_OUT = VMG_CYCLE(LEVEL, B, U_IN) uses the V-cycle to recursively
% solve the linear system AX=B at the given level. If the optional
% starting value U_IN is not passed then U_IN is set to 0's.
%
% zhiyongfinish 2008
% Department of Computer Science
% University of xiangtan in China
function u_out = vmg_cycle(level, b1, t1)
if nargin == 2,
t1 = zeros(size(b1));
end
C_level = coarsest;
u1 = smooth(level, b1, t1, 'pre');
r1 = residual(level, b1, u1);
b2 = restrict(level, r1);
t2 = zeros(size(b2));
u2 =smooth(level+1,b2,t2,'pre'); % 殘量方程的解:2水平上
r2 = residual(level+1, b2, u2);
b3 = restrict(level+1, r2);
% ucc = coarse_grid_solve(level+2, b3);% 殘量方程的解:3水平上
uc = interpolate(level+1,ucc); %傳遞到2水平上
u2 = u2 + uc;
uc = smooth(level+1,b2,u2,'post');
correct = extrapolate(level, u2,ucc); % 3 + 2 --->1 extrapolate
u1 = u1 + correct;
u_out = smooth(level, b1, u1, 'post');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -