%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%EQ Chaleur 2-d
%
%Theta-schema
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all
global S N f dt Npdt X Y;

        %Données numériques en temps et en espace

n=50;h=1/(n+1);x=h:h:1-h;y=x;
[X,Y]=meshgrid(x,y);

dt=0.01;Npdt=1000;
theta=0.5000;
        % matrices
        A=gallery('poisson',n)/h^2;
        nt=n*n;
        M=speye(nt,nt)+theta*dt*A;
        N=speye(nt,nt)-(1-theta)*dt*A;
        %factorisation de cholesky
        S=chol(M);
        %initialisation
        f=ones(n*n,1);
        U=rand(n*n,1);;
        %$$$$$$$$$$$$$$$$$$$$$$$$$$$
        %Resolution par theta-schema
        %$$$$$$$$$$$$$$$$$$$$$$$$$$$
        sol2d(U,f,n)
        