3% Saves the 2D triangular mesh in the minimal way (only coordinates, vertex
connectivity, minimal boundary edge info)
5% Matlab indexing is stored (starts with 1).
7% The output file format is compatible with Mesh_2d_3_matlab:Mesh_2d_3_matlab(std::string
const &fname) in jacobi_oo_stl/geom.h
10% coordinates
xc: [2][nnode]
12% edges e: [7][nedges] boundary edges
13% e([1,2],:) - start/end vertex of edge
14% e([3,4],:) - start/end values
15% e(5,:) - segment number
16% e([6,7],:) - left/right subdomain
17% basename: file name without extension
19% Data have been generated via <https:
21fname = [basename,
'.txt'];
30dlmwrite(fname,
ndim,
'-append',
'delimiter',
'\t',
'precision',16) % space dimension
31dlmwrite(fname,
nelem,
'-append',
'delimiter',
'\t',
'precision',16) % number of elements
32dlmwrite(fname,
nvert_e,
'-append',
'delimiter',
'\t',
'precision',16) % number of vertices per element
34%
dlmwrite(fname,
xc(:),
'-append',
'delimiter',
'\t',
'precision',16) % coordinates
35dlmwrite(fname,
xc([1,2],:).
','-append
','delimiter
','\t
','precision
',16) % coordinates
37% no subdomain info transferred
39% dlmwrite(fname,tmp(:),'-append
','delimiter
','\t
','precision
',16) % connectivity in Matlab indexing
40dlmwrite(fname,tmp(:,:).',
'-append',
'delimiter',
'\t',
'precision',16) %
connectivity in Matlab indexing
42% store only start and end point of boundary edges,
44dlmwrite(fname,nbedges,
'-append',
'delimiter',
'\t',
'precision',16) % number boundary edges
46%
dlmwrite(fname,
tmp(:),
'-append',
'delimiter',
'\t',
'precision',16) % boundary edges in Matlab indexing
47dlmwrite(fname,
tmp(:,:).
','-append
','delimiter
','\t
','precision
',16) % boundary edges in Matlab indexing
dlmwrite(fname, nnode, 'delimiter','\t', 'precision', 16) % number of nodes dlmwrite(fname
function ascii_write_mesh(xc, ia, e, basename) % % Saves the 2D triangular mesh in the minimal way(only coordinates
function vertex minimal boundary edge info in an ASCII file Matlab indexing is stored(starts with 1). % % The output file format is compatible with Mesh_2d_3_matlab nnode
function vertex connectivity