diff options
Diffstat (limited to 'src/CODESTYLE')
-rw-r--r-- | src/CODESTYLE | 57 |
1 files changed, 5 insertions, 52 deletions
diff --git a/src/CODESTYLE b/src/CODESTYLE index 1488481..d0233eb 100644 --- a/src/CODESTYLE +++ b/src/CODESTYLE @@ -1,6 +1,6 @@ AHFinderDirect Code Style ========================= -$Header: /usr/local/svn/cvs-repositories/numrelcvs/AEIThorns/AHFinderDirect/src/CODESTYLE,v 1.10 2005-05-02 16:18:25 jthorn Exp $ +$Header: /usr/local/svn/cvs-repositories/numrelcvs/AEIThorns/AHFinderDirect/src/CODESTYLE,v 1.6 2003-08-18 10:01:01 jthorn Exp $ This file documents some general programming conventions used in this thorn. @@ -31,38 +31,6 @@ Only a few options are configured at compile-time; these use #defines in src/include/config.h. -Variable Names -============== - -Most of the code uses the generic floating-point data type - typedef CCTK_REAL fp; - -The code uses a number of standard variable names, which reference -data structures in the ./patch/ subdirectory: - patch_system& ps; // patch_system.{cc,hh} - patch& p; // patch.{cc,hh}, fd_grid.{cc,hh}, grid.{cc,hh} - int pn; // 0-origin patch number, - // cf. patch_system.{cc,hh} - ghost_zone& gz; // ghost_zone.{cc,hh} - interpatch_ghost_zone& ipgz; // ghost_zone.{cc,hh} - symmetry_ghost_zone& sgz; // ghost_zone.{cc,hh} - int gfn; // small-integer gridfn number, cf. grid.hh - // and the definitions in ../gr/gfns.hh - int iwr; // integer gridfn-array indices - // in the wr (radial) direction - int irho, isigma; // integer gridfn-array indices - // in the (rho,sigma) directions - int iperp, ipar; // integer gridfn-array indices in the - // (perpendicular,parallel) directions along a - // given min/max rho/sigma side of a patch, - // cf. patch_edge.{cc,hh} - bool want_min, want_rho; // Boolean flags to specify a single min/max - // rho/sigma side of a patch -In the ./driver/ subdirectory, the code also uses - int hn; // horizon number - // (runs from 1 to N_horizons inclusive) - - Code Layout/Indentation ======================== @@ -75,6 +43,9 @@ so I use #define then /* empty */ with usage as shown below. +A lot of the code uses the generic floating-point data type + typedef CCTK_REAL fp; + Almost (but not quite) all the code fits into 80 columns. The indentation style is a bit unusual, and is best described by the @@ -187,23 +158,6 @@ printf()-style printing, eg } -C++ Namespaces -============== - -All this thorn's C++ code is in the AHFinderDirect:: C++ namespace. -Alas, the C and Fortran code under ./sparse-matrix/*/ doesn't enjoy -such protection. :( - - -C++ Exceptions -============== - -This thorn doesn't explicitly use C++ exceptions: no code in this thorn -explicitly throws or catches an exception, and no function has an exception -specification. However, this thorn does use new and new[] , which may -throw an exception to report out-of-memory. - - Error Handling ============== @@ -257,8 +211,7 @@ C++ Templates ============= I use C++ templates, but not for anything fancy, just simple containers. -I instantiate all templates explicitly. I'm not (yet) using any of the -STL containers in this thorn. +I instantiate all templates explicitly. Some C++ compilers offer "automatic" template instantiation. In practice this often causes compilation to fail when the compiler can't find .cc |