freefrem_msh_io
freefrem_msh_io,
an Octave code which
reads and writes files used by the FreeFem++ finite element program
to store mesh information.
Note that the GMSH program creates mesh files that use the ".msh"
extension, but which are an entirely different format.
The msh file format is obliquely described in section 12.5 of the
FreeFem++ documentation.
At least for the 2D case of a triangular mesh, the format seems
to be as follows:
-
a single line giving NV, NE, NT, the number of vertices, boundary edges, and triangles
-
NV lines, each containing the (X,Y) coordinates and integer label for a node.
-
NT lines, each containing three vertex indices and integer label for a triangle.
-
NE lines, each containing two vertex indices and integer label for a boundary edge.
The "labels" seem to be "0" for interior objects and 1 for boundary objects.
All edges are boundary objects. (This might not be true. A geometry
might include internal edges, and perhaps these count as interior objects,
but definitely, the edge list does not include arbitrary triangle edges,
only those on the boundary.) All triangles are interior objects.
Vertices may be boundary or interior objects.
Licensing:
The information on this web page is distributed under the MIT license.
Languages:
freefem_msh_io is available in
a C version and
a C++ version and
a Fortran90 version and
a MATLAB version and
an Octave version and
a Python version.
Related Data and Programs:
freefrem_msh_io_test
freefem_msh,
a data directory which
contains examples of the mesh files created by the FreeFem++ program,
which use the extension ".msh".
Reference:
-
Frederic Hecht,
New development in FreeFem++,
Journal of Numerical Mathematics,
Volume 20, Number 3-4, 2012, pages 251-265.
-
Frederic Hecht,
BAMG: Bidimensional Anisotropic Mesh Generator,
draft version v1.00, December 2006.
Source Code:
-
freefrem_msh_io_2d_data_example.m,
sets data for a 2D example.
-
freefrem_msh_io_2d_data_print.m,
prints data.
-
freefrem_msh_io_2d_data_read.m,
reads data from an FFMSH file.
-
freefrem_msh_io_2d_size_example.m,
sets sizes for a 2D example.
-
freefrem_msh_io_2d_size_print.m,
prints sizes.
-
freefrem_msh_io_2d_sizes_read.m,
reads sizes from an FFMSH file.
-
freefrem_msh_io_2d_write.m,
writes sizes and data to an FFMSH file.
-
i4mat_transpose_print.m,
prints an I4MAT, transposed.
-
i4mat_transpose_print_some.m,
prints some of the transpose of an I4MAT.
-
i4vec_print.m,
prints an I4VEC.
-
mesh_base_one.m
adjusts a mesh to use 1-based indexing.
-
r8mat_transpose_print.m,
prints an R8MAT, transposed.
-
r8mat_transpose_print_some.m,
prints some of an R8MAT, transposed.
Last revised on 22 June 2024.