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

📄 testmglab.m

📁 五点差分型多重网格方法:各种插值算子的比较)
💻 M
字号:
% The commads in this file, when executed, test the capabilities of MGLab
% by running each problem, and solver combination possible. Note that 
% issues with the visualization of results and the smoother demos cannot 
% be seen using just this test, but must be manually inspected from 
% within MGLab.
%       -Ryan McKenzie

% Note: Problems are run with the smallest problem size ,most trivial
% parameters, and no preconditioning in order to save time.
include_flags
include_globals
include_figs 

num_problems = 4;
num_solvers = 7;
    
MGLab

i=0;
j=0;
count=1;
%while(count<=num_problems * num_solvers)
    i=mod(i,num_problems);
    j=mod(j,num_solvers);
    
    nx1=7;ny1=7;
    generate_matrix=1; generate_rhs=1;
    precon_flag = NONE;
    
    rtol=1e-4; prtol=1e-4;
    max_it=50; max_time=10;
    coarse_level=min([5,max_level(nx1)]);
    
    if(i==0) problem_flag = POISSON; end
    if(i==1) problem_flag = HELMHOLTZ; prob_args(1) = 0; end
    if(i==2) problem_flag=CONVECT_DIFFUSE; generate_matrix=1; prob_args(1)=10; prob_args(2)=10; end
    if(i==3) problem_flag = CUT_SQUARE; generate_matrix=1; prob_args(1) = 10; end

    if(j==0) solver_flag = VMG_SOLVE; end
    if(j==1) solver_flag = PCG_SOLVE; end
    if(j==2) solver_flag = BICG_STAB_SOLVE; end
    if(j==3) solver_flag = CGS_SOLVE; end
    if(j==4) solver_flag = GMRES_SOLVE; restart=5; end
    if(j==5) solver_flag = SOR_SOLVE;SOR_omega=1; end
    if(j==6) solver_flag = FMG_SOLVE; end
    
    run;
    count=count+1;
    %i=i+1;
    %j=j+1;
%end

close(main_fig); close

⌨️ 快捷键说明

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