adding interpolation to fire wind height
[wrf-fire-matlab.git] / femwind / femwind_solve.m
blob723605a1e8610ee0c84fb2f1a76b3f8ddaafa92a
1 function [W,rate]=femwind_solve(A,X,U0,params)
2     % assemble sparse system matrix
3     nel=size(X{1})-1;
4     lambda = zeros(prod(nel+1),1); % placeholder solution
5     [K,F,~] = sparse_assembly(A,X,U0,lambda,params);
7     % dirichlet boundary conditions
8     [K,~]=apply_boundary_conditions(K,[],X);   % to K - once
9     [~,F]=apply_boundary_conditions([],F,X);   % to F - every time
11     % solve the equations
12     % [lambda,it] = sparse_solve(K,F,X,'s');
13     [lambda,it,rate,XC] = sparse_solve(K,F,X,params);
15     % assemble final wind
16    [~,~,W] = sparse_assembly(A,X,U0,lambda,params);
17 end