3 % Initialization of the Mesh structure from a FreeFEM++ mesh file
6 % cFileName: file name (
string)
9 % Mesh: mesh structure (see report)
11 % Generated fields of Mesh:
15 % Usage: Th=GetMesh('carre.msh')
16 [fid,message]=fopen(cFileName,'r');
18 error([message,
' : ',cFileName]);
21 [n]=fscanf(fid,
'%d %d %d',3);
23 R=fscanf(fid,
'%f %f %d',[3,n(1)]);
26 R=fscanf(fid,
'%d %d %d %d',[4,n(2)]);
30 R=fscanf(fid,
'%d %d %d',[3,n(3)]);
35 n=textscan(fid,
'%d %d %d',1); % n(1) -> number of vertices
36 % n(2) -> number of triangles
37 % n(3) -> number of boundary edges
39 R=textscan(fid,
'%f %f %d',n{1});
42 R=textscan(fid,
'%d %d %d %d',n{2});
46 R=textscan(fid,
'%d %d %d',n{3});
52 Mesh=
struct(
'q',q,
'me',me,
'ql',ql,
'mel',mel,
'be',be,
'bel',bel, ...