ouput with XLONG XLAT
[wrf-fire-matlab.git] / femwind / sparse_solve.m
blob8443a643229626c8fc8236a6e23d438dc801f244
1 function [lambda,it,rate,XC]=sparse_solve(K,F,X,params)
2 n = size(X{1});
3 nn = size(K,1);
4 fprintf('sparse_solve: problem size %g mesh %g %g %g\n',nn,n)
5 rate=0;
6 XC={};
7 switch params.solver
8     case {'d','direct'}
9         disp('sparse direct solver')
10         lambda = K\F;
11         it=0;
12     case {'r','red-black'}
13         [lambda,it] = rb_line_gs_solve(K,F,X);
14     case {'2','2-level'}
15         [lambda,it,rate,XC] = multigrid_solve(K,F,X,params);
16     case {'s','schwarz'}
17         [lambda,it] = rb_schwarz_solve(K,F,X);
18     otherwise
19         error('unknown method')
20 end
21 end