function [nodes,elem,edges]=ReadMeshM(name)

[fid,msg]=fopen(strcat(name,".n"),"r");
n=fscanf(fid,"%d",1);
nodes=zeros(n,3);
for k=1:n;
  tmp=fscanf(fid,"%i",[1,1]);
  tmp=fscanf(fid,"%1c",[1,1]);
  nodes(k,:)=fscanf(fid,"%e",[1,3]);
endfor
fclose(fid);


[fid,msg]=fopen(strcat(name,".e"),"r");
n=fscanf(fid,"%d",1);
elem=zeros(n,4);
for k=1:n;
  tmp=fscanf(fid,"%i",[1,1]);
  tmp=fscanf(fid,"%1c",[1,1]);
  tmp=fscanf(fid,"%e",[1,12]);
  elem(k,:)=[tmp(1)+1,tmp(2)+1,tmp(3)+1,tmp(12)];
endfor
fclose(fid);

[fid,msg]=fopen(strcat(name,".s"),"r");
n=fscanf(fid,"%d",1);
edges=zeros(n,3);
for k=1:n;
  tmp=fscanf(fid,"%i",[1,1]);
  tmp=fscanf(fid,"%1c",[1,1]);
  tmp=fscanf(fid,"%e",[1,5]);
  edges(k,:)=[tmp(1)+1,tmp(2)+1,tmp(5)];
endfor
fclose(fid);

counter=1;
for k=1:n
  if edges(k,3)>0   
    edges(counter,:)=edges(k,:);
    counter++;
  endif;
endfor
edges=edges(1:counter-1,1:3);


endfunction




