metis_edp.edp

load "metis" 
mesh Th=square(100,100); 
fespace Ph(Th,P0); 
int[int] nupart(Th.nt); 
Ph  part; 

metisnodal(nupart,Th,100); 
for(int i=0;i<nupart.n;++i) 
  part[][i]=nupart[i]; 
plot(part,fill=1,cmm="nodal",wait=1); 

metisdual(nupart,Th,100); 
for(int i=0;i<nupart.n;++i) 
  part[][i]=nupart[i]; 
plot(part,fill=1,cmm="dual",wait=1);