ENH: No verbose a2x output when building UserGuide
[freefoam.git] / HACKING
blobd65bc162e340cadda48380b53ded9e1d95735de5
1 FreeFOAM hackers informations
2 =============================
3 Michael Wild <themiwi@users.sourceforge.net>
4 :Author Initials: MW
5 v{fullver}, {localdate}
6 {homepage}
8 :cmake: http://www.cmake.org[CMake]
9 :gitdocs: http://www.kernel.org/pub/software/scm/git/docs
10 :gitworkflows: {gitdocs}/gitworkflows.html[gitworkflows(7)]
11 :pythondoc: http://www.python.org/doc
13 Copyright
14 ---------
15 FreeFOAM is free software; you can redistribute it and/or modify it under the
16 terms of the GNU General Public License as published by the Free Software
17 Foundation; either version 2 of the License, or (at your option) any later
18 version.  See the file COPYING in this directory, for a description of the GNU
19 General Public License terms under which you can copy the files.
21 Recommended Reading
22 -------------------
24 Before you participate in the FreeFOAM project and start away hacking, you
25 should make yourself familiar with the tools. The following sections name the
26 most important of them and give you a few references I used to learn them.
28 Git
29 ~~~
30 To work on the FreeFOAM source base, you need to know your 'Git-foo'. Git is
31 the distributed source control system used by the FreeFOAM project, and feeling
32 comfortable using Git is germane to participating in the project. The official
33 documentation (either available through extensive man-pages or from
34 {gitdocs}) is of course the
35 authoritative source. Especially the manual page {gitworkflows} is of interest
36 with respect to the work flow used by the FreeFOAM project. If you prefer to
37 learn Git reading a book, there are the freely available online books
38 <<ProGit>> and <<GitCommBook>>. Learners desiring to hold a book in their hands
39 can either print the PDF version of <<GitCommBook>> or buy a hard-copy of
40 <<ProGit>> or <<VCGit>>.
42 CMake
43 ~~~~~
44 The build system used by FreeFOAM is {cmake}. Being able to
45 use it on a user-level is a hard requirement for working on FreeFOAM. Pretty
46 quickly, though, contributors will need more understanding of the topic and
47 should get their hands on a copy of <<MasteringCMake>>.
49 Python
50 ~~~~~~
51 All the 'user-land' scripts and many of the scripts used during the build of
52 FreeFOAM are written in Python. So, you definitely should know how to read it.
53 There is a good tutorial (and of course the ever-so-important reference) at
54 {pythondoc}. There is no book I can recommend, since I haven't read any myself.
56 {cpp}
57 ~~~~~
58 FreeFOAM is a large {cpp} project which makes use of almost any language
59 feature there is. Thus it is *strongly* recommended you have a good
60 understanding of {cpp} in general (e.g. you should be familiar with function
61 overloading and polymorphism) and you absolutely *must* understand function and
62 class templates. So far I did not come across a single book which covers all of
63 these topics satisfactorily. For the more traditional {cpp} topics (i.e.
64 non-templated code), <<EffCXX>> and <<ExceptCXX>> are very good resources and
65 should also cover template programming in sufficient detail to work on the
66 FreeFOAM code base. If you want to know the ins and outs of {cpp} templates,
67 refer to <<CXXTemplates>> and to get an inkling of all the fancy stuff you can
68 do with them, read <<CXXMeta>>.
70 Coding Practices and Style
71 --------------------------
72 Follow the instructions outlined in the file 'doc/codingStyleGuide.pdf'
73 contained in the source distribution. Additionally, pay special attention to
74 the following points:
76 * In general, lines shouldn't be longer than 80 characters and they *must* be
77   terminated by a LF. Windows-style line endings (CR+LF) are not acceptable.
78 * Indentation for {cpp} is 4 spaces, for Python code 3 or 2 spaces and
79   CMake-code uses 2 spaces only. Never use tab characters (except where
80   required by syntax).
81 * Avoid trailing whitespace at all costs. It is considered to be a programming
82   error. However, only remove it from existing code if you change that line
83   anyways. Otherwise the version control log will be very noisy and the 'blame'
84   operation useless.
85 * Make sure that file and directory names differ not just in their
86   capitalization. Also, for libraries a header name must be unique within the
87   whole library, but preferably all file names are unique throughout the whole
88   code base.
89 * New applications must provide header documentation describing *all* available
90   options and arguments. Also, there must be a brief description (1-2 lines
91   maximum) and an extended, informative description. Somebody reading it should
92   know what to expect from this application without having to read its whole
93   code.
94 * New applications must provide a tutorial case that can be run as a basic
95   test to ensure that it runs (although, without checking the validity of the
96   results).
97 * New CMake-Modules and functions must be documented using a header comment.
99 'Tour de Code'
100 --------------
101 This section describes each of the libraries briefly. This is an ongoing effort
102 and below items are by no means complete. The listing is alphabetical.
104 autoMesh::
105   This library handles adaptive mesh refinement, e.g. layer insertion/deletion.
106 barotropicCompressibilityModel::
107   Provides barotropic compressibility models (a linear model, the one by Wallis
108   and another by Chung).
109 basicThermophysicalModels::
110   Provides classes to store and compute derived thermophysical properties (such
111   as sensible enthalpy, inner energy, temperature, pressure or heat capacity)
112   based on the density or compressibility for pure fluids or mixtures.
113 chemistryModel::
114   This library contains various chemistry models (e.g. based on density or
115   compressibility, but also an ODE systems solver).
116 coalCombustion::
117   Contains classes relevant to the simulation of coal combustion (specialised
118   particle cloud coal parcel, surface reaction models).
119 compressibleLESModels::
120   Provides a large variety of compressible LES subgrid-scale models.
121 compressibleRASModels::
122   Supplies various compressible RANS turbulence models.
123 compressibleTurbulenceModel::
124   Contains a common interface and infrastructure for compressible turbulence
125   models.
126 conversion::
127   This library comprises several file-format conversion classes (e.g. for
128   Ensight and Star-CD).
129 decompositionMethods::
130   The library contains common infrastructure and interfaces for decomposition
131   domain methods, as well as several actual decomposition methods
132   (geometrical, hierarchical, manual and one using the 'scotch' graph library).
133 dieselSpray::
134   Provides classes relevant to Diesel-spray modelling (breakup, atomization,
135   evaporation, drag, collision, wall interaction etc.).
136 dsmc::
137   This library contains classes for 'Direct Simulation Monte Carlo'.
138 dummyPstream::
139   This is the serial implementation of the 'Pstream' communications library.
140 dynamicFvMesh::
141   Provides classes for dynamic and topology-changing finite volume meshes.
142 dynamicMesh::
143   This library provides mesh manipulation methods (e.g. addition/removal of
144   cell layers, mesh-motion solvers, sliding interfaces etc.)
145 edgeMesh::
146   A simple mesh type consisting of points connected by edges.
147 engine::
148   This is a support-library for internal combustion engine solvers.
149 errorEstimation::
150   Residual error estimation and error-driven mesh refinement classes.
151 fieldFunctionObjects::
152   Runtime-loadable function objects for the extraction statistics/diagnostics
153   from a field.
154 finiteVolume::
155   This library contains everything related to the finite volume (FV) method,
156   such as mesh classes, discretisation and interpolation schemes, matrices and
157   other basic CFD related tools.
158 foamCalcFunctions::
159   Functions for the 'foamCalc' utility application.
160 forces::
161   Runtime-loadable function objects used to extract forces and
162   force-coefficients on selected patches.
163 fvMotionSolvers::
164   Library containing various finite volume mesh motion solvers where the motion
165   velocity is set as a boundary condition.
166 genericPatchFields::
167   Generic finite volume and point patch field types.
168 incompressibleLESModels::
169   Large Eddy Simulation (LES) models for incompressible flow.
170 incompressibleRASModels::
171   Reynolds Averaged Simulation (RAS) models for incompressible flow.
172 incompressibleTransportModels::
173   Transport model classes for incompressible flow.
174 incompressibleTurbulenceModel::
175   Base classes for the incompressible turbulence models.
176 interfaceProperties::
177   Classes describing interface properties and compression for two-phase flows.
178 IOFunctionObjects::
179   A function object to write registered objects which would otherwise not be
180   written.
181 lagrangian::
182   Basic classes for Lagrangian particle tracking.
183 lagrangianIntermediate::
184   Advance classes for Lagrangian particle tracking.
185 laminarFlameSpeedModels::
186   Laminar flame speed models.
187 LESdeltas::
188   Various LES delta models.
189 LESfilters::
190   Various LES filters.
191 liquidMixture::
192   A class representing a mixture of liquids.
193 liquids::
194   Thermophysical properties of various liquids.
195 meshTools::
196   A collection of classes and functions of mesh-related tasks, such as
197   searching, splitting into regions, creating sets etc.
198 metisDecomp::
199   Domain decomposition method using the 'METIS' graph library.
200 MGridGenGAMGAgglomeration::
201   Cell-agglomeration for the 'GAMG' solver using the 'MGridGen' library.
202 molecularMeasurements::
203   Statistic extraction library for molecular dynamics simulations.
204 molecule::
205   Library containing classes for molecular dynamics (MD) simulations.
206 mpiPstream::
207   This is the MPI-parallel implementation of the 'Pstream' communications
208   library.
209 ODE::
210   Library to solve ODE's for each cell.
211 OpenFOAM::
212   Basic infrastructure, such as containers, primitive types, streams, fields
213   and meshes.
214 OSspecific::
215   Functions wrapping operating-system specific functionality.
216 parMetisDecomp::
217   Domain decomposition method using the 'ParMetis' library.
218 pdf::
219   Provides various probability density functions (PDF).
220 postCalc::
221   Generic wrapper to calculate quantities in a post-processing step.
222 potential::
223   Models for various potentials in molecular dynamics simulations.
224 radiation::
225   Various radiation models.
226 randomProcesses::
227   A library to create a turbulent velocity and pressure field according to a
228   wave-number spectrum and which is divergence-free.
229 reactionThermophysicalModels::
230   Reaction- and combustion-thermophysical models.
231 sampling::
232   A data-sampling library (extraction along a line, on a plane, patch etc.).
233 scotchDecomp::
234   Domain decomposition method using the 'SCOTCH' graph library.
235 solidMixture::
236   A class for the thermophysical properties of a solid mixture.
237 solidParticle::
238   A simple solid, spherical particle class with one-way coupling with the
239   continuous phase.
240 solids::
241   Thermophysical properties models for various solid materials.
242 specie::
243   Basic classes for thermphysical properties models.
244 surfMesh::
245   A library with classes for many surface-mesh formats.
246 systemCall::
247   A function object allowing the user to call an external program at run-time.
248 thermophysicalFunctions::
249   A collection of thermophysical functions.
250 topoChangerFvMesh::
251   Classes to support topology-changing finite volume meshes.
252 triSurface::
253   Triangulated surface description and patch information classes.
254 utilityFunctionObjects::
255   Miscellaneous function objects (static pressure computation, calculation of
256   intensive fields in DSMC simulations)
258 Merging Guide
259 -------------
260 These are notes mainly concerning the FreeFOAM maintainers performing the
261 merges with the upstream repository (currently, that is me). Other may find
262 this informative, though, and I realized that I need a checklist...
264 * Create a clone on a case-sensitive file system and check out the upstream
265   tracking branch 'upstream/OpenFOAM-1.7.x' and +git pull+.
266 * Check out the branch with the unified history, 'upstream/OpenFOAM' and merge
267   in the versioned upstream branch.
268 * Get an overview of what has been added and removed using
269   +git show -m --name-status --no-renames --diff-filter=AD+. Of special
270   interest are 'wmake' related files, new or removed sources, new scripts in
271   'bin', added or removed libraries, applications and tutorials.
272 * Check out the branch you want to merge into (usually that is 'pu') and merge
273   with 'upstream/OpenFOAM'. There will be many merge conflicts.
274 * Use the following checklist while merging:
275   - Changes to 'Make/files' usually only map to the corresponding 'files.cmake'
276     file. New source files are added to the 'SRCS' list.
277   - New source and header files ('.C' and '.H') belonging to a library that
278     are not mentioned in the 'Make/files' file must be added to the 'HDRS'
279     list. This usually is not reflected by a conflict!
280   - New link libraries added in 'Make/options' should be ported to the
281     'CMakeLists.txt' file. New include directories should only be ported if
282     they are 'relative includes'.
283   - Check the 'diff' of all modified/added source files for '#include'
284     directives. Find whether the included file belongs to a library and if so,
285     change the '#include "header.H"' to '#include <libname/header.H>'.
286   - Add modelines to added files.
287   - Complete/fix the header comment of new applications.
288   - Usually, changes inside the 'wmake' directory can be discarded.
289   - More often than not, added scripts in 'bin' are useless to the FreeFOAM
290     project. If not, port the script to Python if it is to be distributed in a
291     binary package.
292   - Newly added tutorials must be furnished with their own 'CMakeLists.txt'
293     file and a new +add_subdirectory+ call needs to be added. Port new 'Allrun'
294     and 'Allclean' scripts to a 'Allrun.py.in' script.
296 Release Guide
297 -------------
298 The following lists things to remember when creating a new release.
300 * Update 'ChangeLog' and 'ReleaseNotes'
301 * Update version information in 'CMakeLists.txt' and
302   'data/asciidoc/common.conf'
303 * Use the 'data/utilities/foamPackSource' script to create a new, signed tag,
304   create a tar-ball with an external signature and check-sum files.
306 Bibliography
307 ------------
308 [bibliography]
309 * [[[ProGit]]] Scott Chacon. http://progit.org/['Pro Git']. Apress 2009.
310   ISBN http://isbndb.com/search-all.html?kw=1-430-21833-9[1-430-21833-9].
311 * [[[GitCommBook]]] Scott Chacon and many others.
312   http://book.git-scm.com['The Git Community Book'].
313 * [[[VCGit]]] Jon Loeliger. 'Version Control with Git'. O'Reilly 2009.
314   ISBN http://isbndb.com/search-all.html?kw=0-596-52012-3[0-596-52012-3].
315 * [[[MasteringCMake]]] Ken Martin, Bill Hoffman. 'Mastering CMake'.
316   Kitware Inc. 2010.
317   ISBN http://isbndb.com/search-all.html?kw=1-930-93422-X[1-930-93422-X]
318 * [[[EffCXX]]] Scott Meyers. 'Effective {cpp}'. Addison-Wesley 2005.
319   ISBN http://isbndb.com/search-all.html?kw=0-321-33487-6[0-321-33487-6].
320 * [[[ExceptCXX]]] Herb Sutter. 'Exceptional {cpp}'. Addison-Wesley 2000.
321   ISBN http://isbndb.com/search-all.html?kw=0-201-61562-2[0-201-61562-2].
322 * [[[CXXTemplates]]] David Vandevoorde, Nicolai M. Josutis.
323   '{cpp} Templates - The Complete Guide'. Addison-Wesley 2003.
324   ISBN http://isbndb.com/search-all.html?kw=0-201-73484-2[0-201-73484-2].
325 * [[[CXXMeta]]] David Abrahams
326   David Abrahams, Aleksey Gurtovoy. '{cpp} Template Metaprogramming: Concepts,
327   Tools, and Techniques from Boost and Beyond'. Addison-Wesley 2005.
328   ISBN http://isbndb.com/search-all.html?kw=0-321-22725-5[0-321-22725-5]
330 ////////////////////////////////////////////////////////////////////
331 Process with: asciidoc -a toc -f data/asciidoc/html.conf HACKING
333 Vim users, this is for you:
334 vim: ft=asciidoc sw=2 expandtab fenc=utf-8
335 ////////////////////////////////////////////////////////////////////