// generation du maillage Q0 a 1 noeuds
// lx, ly dimension du rectangle
// nex,ney nonbre de quad suivant x et y
// CONNEC mat de conectivite
// COOR mat des coordonnees des noeuds

function [CONNEC,COOR,Nelt,Nno,Npt] = maillage_2D_Q0(lx,ly,nex,ney)
//
//
hx=lx/(2*nex);
hy=ly/(2*ney);

Npt = nex*ney;
Nelt = nex*ney;
Nno = 1;
//
// coordonnees des noeuds
//---------------------
//
COOR = zeros(Npt,2);
for  iy = 1:ney;
  for ix = 1:nex
    INN=(iy-1)*nex+ix
    COOR(INN,1)= hx+2*(ix-1)*hx
    COOR(INN,2)= hy+2*(iy-1)*hy
  end;
end;  
//
// connectivite
//---------------------
//
CONNEC=zeros(Nelt,Nno);
it = nex;
for iy = 1:ney
    for ix = 1:nex
      inel=(iy-1)*nex+ix;
      i1 = (iy-1)*it + ix;
      CONNEC(inel,1)=i1;
   end
end

endfunction

