Skip to content
Snippets Groups Projects
Commit f65aab18 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

more work on docs

parent 044f261b
No related branches found
No related tags found
No related merge requests found
......@@ -4607,11 +4607,11 @@ svn commit
@node Source code structure, Coding style, Getting the source, Information for developers
@section Source code structure
Gmsh's code is structured in several libraries, roughly separated
between the three main core modules (@file{Geo}, @file{Mesh},
@file{Post}) and associated utility libraries (@file{Common},
@file{Numeric}) on one hand, and graphics (@file{Graphics}) and
interface (@file{Fltk}, @file{Parser}) libraries on the other.
Gmsh's code is structured in several subdirectories, roughly separated
between the four core modules (@file{Geo}, @file{Mesh}, @file{Solver},
@file{Post}) and associated utilities (@file{Common}, @file{Numeric}) on
one hand, and the graphics (@file{Graphics}) and interface (@file{Fltk},
@file{Parser}) code on the other.
The geometry and mesh modules are based on an object-oriented model
class (@file{Geo/GModel.h}), built upon abstract geometrical entity
......@@ -4636,14 +4636,43 @@ to make the code easy to read/debug/maintain:
@enumerate
@item
please enable full warnings for your compiler (e.g., add @code{-Wall} to
@code{FLAGS} in the @file{variables} file);
Please enable full warnings for your compiler (e.g. @code{-Wall} with
@code{g++}) and don't commit until there is no warning left.
@item
always use the @code{Msg::} class to print information, errors, @dots{};
Use memory checking tools to detect memory leaks and other nasty memory
problems. For example, you can use
@itemize @bullet
@item
Valgrind on Linux:
@example
valgrind --leak-check=yes --show-reachable=yes gmsh file.geo -3
@end example
@item
GMALLOC on Mac OS X:
@example
(gdb) set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib
@end example
@item
LIBNJAMD:
@example
export LD_PRELOAD=libnjamd.so
kill -USR1
@end example
@item
Purify
@item
indent your files (2 spaces)
Memprof
@item
convert all tabs to spaces.
@dots{}
@end itemize
@item
always use the @code{Msg::} class to print information or errors
@item
indent your files (2 spaces) and convert all tabs to spaces
@item
follow the style used in the existing code when adding something new
(spaces after commas, opening braces for functions on a separate line,
opening braces for loops and tests on the same line, etc.)
@end enumerate
@c -------------------------------------------------------------------------
......@@ -4672,23 +4701,18 @@ add the prototype in @file{Common/Options.h});
optional: create the associated widget in @file{Fltk/optionWindow.cpp};
@end enumerate
@c todo:
@c Tools to check memory leaks
@c * on mac: use GMALLOC
@c (gdb) set env DYLD_INSERT_LIBRARIES /usr/lib/libgmalloc.dylib
@c * LIBNJAMD
@c export LD_PRELOAD=libnjamd.so
@c kill -USR1
@c * valgrind --leak-check=yes --show-reachable=yes gmsh file.geo -3
@c * purify
@c * memprof
@c
@c -------------------------------------------------------------------------
@c Using Gmsh as a library
@c -------------------------------------------------------------------------
@c @node Using Gmsh as a library, , Coding style, Information for developers
@c @section Using Gmsh as a library
@c Notes on thread-safety
@c All the operations in the Gmsh library are not thread safe.
@c For example, the MeshAdapt algorithm is, while the Delaunay/Frontal
@c are not.
@c -------------------------------------------------------------------------
@c Compiling with OpenCASCADE
@c -------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment