[Gmsh] Comments in .msh files

Robert Funnell robert.funnell at mcgill.ca
Sun Dec 28 13:47:44 CET 2008


On Sun, 28 Dec 2008, Christophe Geuzaine wrote:

> Robert Funnell wrote:
>> In Section 1.8 of the manual dated 2008 Nov 21 it says 'All Gmsh ASCII text 
>> input files support both C and C++ style comments' but a message dated 2008 
>> Nov 19 says 'you cannot add comments in .msh files! (I've added a note in 
>> the doc to make this clear.)'. Is that added note in the documentation 
>> somewhere that I haven't found?
>> 
>
> Indeed, I forgot to commit the change. We don't support C/C++ style
> comments in .msh files for performance reasons. However, you can simply
> add a section with a dummy header (after the format section), and it
> will be ignored by Gmsh.
(...)
> You can add comments in a mesh file (@file{.msh}) by adding a section
> with an unrecognized label (e.g., @code{$Comments}/@code{$EndComments})
> after the @code{$MeshFormat}/@code{$EndMeshFormat} section: see @ref{MSH
> ASCII file format}.
(...)

Perfect! Merci beaucoup.

On a related note, I have not found any explicit explanation of what a 
.geo file is in the manual. Would it make sense to add a brief section 
to Chapter 9, explaining that it is a script file containing Gmsh 
commands and comments? This would clarify things for beginners. 
Perhaps Section 1.8 could be moved into such a new section.

Still on the subject of the file formats, I am confused about the 
relationship between the statement just before Section 6.1, 
recommending the use of .pos files, and the statement in Section 9.4.2 
that .pos files have been superseded by .msh files. The new .pos 
format does not seem to be explicitly defined anywhere.

- Robert