makeplots=0;
function res = aF(xy)
res=xy(:,1);
endfunction

function res = volt(xy)
global h=0.2;
[n,m]=size(xy);
res=zeros(n,1);
for k=1:n
  if (xy(k,2)<h/2) res(k)=0;
  else res(k)=1;endif
endfor
endfunction

[nodes,elem,edges]=ReadMeshTriangle("./cap.1");
[A,b,n2d]=FEMEquation(nodes,elem,edges,'aF',0,0,'volt',0);
tic
u=FEMSolveSym(nodes,A,b,n2d,'volt');
solve=toc
sizeA=size(A)
nn=length(A);
As=BandToSparse(A);
As\ones(nn,1);
SolveSparse=toc
Af=full(As);
tic;
Af\ones(nn,1);
SolveFull=toc


[nodes,elem,edges]=ReadMeshTriangle("./capMK.1");
[A,b,n2d]=FEMEquation(nodes,elem,edges,'aF',0,0,'volt',0);
u=FEMSolveSym(nodes,A,b,n2d,'volt');
solveMK=toc
sizeA=size(A)
nn=length(A);
As=BandToSparse(A);
tic;
As\ones(nn,1);
solveSparse=toc
