//  trace la Pression P
//
function [u,x,y]=trace_p_2D(U,COOR,NUMER,Npt_u,no,Nx,Ny)
//
//  calcule le maillage initial
//
   [Npt_p bid] = size(COOR);
   x0 = min(COOR(:,1)); x1 = max(COOR(:,1));
   y0 = min(COOR(:,2)); y1 = max(COOR(:,2));
   
   Dx = (x1-x0)/(Nx-1); Dy = (y1-y0)/(Ny-1);
   x = x0 + (0:Nx-1)*Dx; 
   y = y0 + (0:Ny-1)*Dy;

//  on evalue la fonction au points du maillage
//
   p = zeros(Nx,Ny);
   for i = 1:Nx
      xi = x(i);
      for j = 1:Ny
        yj = y(j)
// verifie si (xi, yj) n'est pas un noeud
        indice = find(and([COOR(:,1) == xi, COOR(:,2) == yj],2)); 
        if indice == [] 
           indice = cal_indice(COOR,[xi yj])
           Uno = U(NUMER(2*Npt_u+indice));
           Point = [xi yj]; Triangle = COOR(indice,:);
           FP = interpol(Point,Triangle);
           p(i,j) = Uno'*FP;
        else
           p(i,j)= U(NUMER(2*Npt_u+indice));       
        end;  
      end;
   end;
  
    
    xbasc(no);
    xset("window",no);
    rect = [x0,x1,y0,y1,0,max(u)]; 
    xtitle("P"); 

    contour2d(x,y,p,10)

endfunction
         
      
