Reset platonic code.
[voro++.git] / branches / dynamic / src / config.hh
blob4dfca5c167d0c9eb13b9a3588deef301a7dcbf98
1 // Voro++, a 3D cell-based Voronoi library
2 //
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : July 1st 2008
7 /** \file config.hh
8 * \brief Master configuration file for setting various compile-time options. */
10 #ifndef VOROPP_CONFIG_HH
11 #define VOROPP_CONFIG_HH
13 // These constants set the initial memory allocation for the Voronoi cell
14 /** The initial memory allocation for the number of vertices. */
15 const int init_vertices=256;
16 /** The initial memory allocation for the maximum vertex order. */
17 const int init_vertex_order=64;
18 /** The initial memory allocation for the number of regular vertices of order
19 * 3. */
20 const int init_3_vertices=256;
21 /** The initial memory allocation for the number of vertices of higher order.
23 const int init_n_vertices=8;
24 /** The initial buffer size for marginal cases used by the suretest class. */
25 const int init_marginal=256;
26 /** The initial size for the delete stack. */
27 const int init_delete_size=256;
28 /** The initial size for the auxiliary delete stack. */
29 const int init_delete2_size=256;
30 /** The initial size for the facets evaluation. */
31 const int init_facet_size=32;
32 /** The initial size for the wall pointer array. */
33 const int init_wall_size=32;
35 // If the initial memory is too small, the program dynamically allocates more.
36 // However, if the limits below are reached, then the program bails out.
37 /** The maximum memory allocation for the number of vertices. */
38 const int max_vertices=16777216;
39 /** The maximum memory allocation for the maximum vertex order. */
40 const int max_vertex_order=2048;
41 /** The maximum memory allocation for the any particular order of vertex. */
42 const int max_n_vertices=16777216;
43 /** The maximum buffer size for marginal cases used by the suretest class. */
44 const int max_marginal=16777216;
45 /** The maximum size for the delete stack. */
46 const int max_delete_size=16777216;
47 /** The maximum size for the auxiliary delete stack. */
48 const int max_delete2_size=16777216;
49 /** The maximum amount of particle memory allocated for a single region. */
50 const int max_particle_memory=16777216;
51 /** The maximum size for the wall pointer array. */
52 const int max_wall_size=2048;
54 #ifndef VOROPP_VERBOSE
55 /** Voro++ can print a number of different status and debugging messages to
56 * notify the user of special behavior, and this macro sets the amount which
57 * are displayed. At level 0, no messages are printed. At level 1, messages
58 * about unusual cases during cell construction are printed, such as when the
59 * plane routine bails out due to floating point problems. At level 2, general
60 * messages about memory expansion are printed. At level 3, technical details
61 * about memory management are printed. */
62 #define VOROPP_VERBOSE 0
63 #endif
65 /** The declaration of fpoint allows that code to be compiled both using single
66 * precision numbers and double precision numbers. Under normal usage fpoint is
67 * set be a double precision floating point number, but defining the
68 * preprocessor macro VOROPP_SINGLE_PRECISION will switch it to single
69 * precision and make the code tolerances larger. */
70 #ifdef VOROPP_SINGLE_PRECISION
71 typedef float fpoint;
72 #else
73 typedef double fpoint;
74 #endif
76 /** If a point is within this distance of a cutting plane, then the code
77 * assumes that point exactly lies on the plane. */
78 #ifdef VOROPP_SINGLE_PRECISION
79 const fpoint tolerance=1e-5;
80 #else
81 const fpoint tolerance=1e-10;
82 #endif
84 /** If a point is within this distance of a cutting plane, then the code stores
85 * whether this point is inside, outside, or exactly on the cutting plane in
86 * the marginal cases buffer, to prevent the test giving a different result on
87 * a subsequent evaluation due to floating point rounding errors. */
88 #ifdef VOROPP_SINGLE_PRECISION
89 const fpoint tolerance2=2e-5;
90 #else
91 const fpoint tolerance2=2e-10;
92 #endif
94 #ifndef VOROPP_WALLS_SPECIFIED
95 #define VOROPP_AUTO_X_WALL
96 #define VOROPP_AUTO_Y_WALL
97 #define VOROPP_AUTO_Z_WALL
98 #endif
100 /** A large number that is used in the computation. */
101 const fpoint large_number=1e30;
103 #endif