Minkowski test code.
[voro++.git] / trunk / src / config.hh
blobda8856aee42af888fe622629bbc61778e6931872
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 : August 30th 2011
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 #include <limits>
15 namespace voro {
17 // These constants set the initial memory allocation for the Voronoi cell
18 /** The initial memory allocation for the number of vertices. */
19 const int init_vertices=256;
20 /** The initial memory allocation for the maximum vertex order. */
21 const int init_vertex_order=64;
22 /** The initial memory allocation for the number of regular vertices of order
23 * 3. */
24 const int init_3_vertices=256;
25 /** The initial memory allocation for the number of vertices of higher order.
27 const int init_n_vertices=8;
28 /** The initial size for the delete stack. */
29 const int init_delete_size=256;
30 /** The initial size for the auxiliary delete stack. */
31 const int init_delete2_size=256;
32 /** The initial size for the extra search stack. */
33 const int init_xsearch_size=32;
34 /** The initial size for the wall pointer array. */
35 const int init_wall_size=32;
36 /** The default initial size for the ordering class. */
37 const int init_ordering_size=4096;
38 /** The initial size of the pre_container chunk index. */
39 const int init_chunk_size=256;
41 // If the initial memory is too small, the program dynamically allocates more.
42 // However, if the limits below are reached, then the program bails out.
43 /** The maximum memory allocation for the number of vertices. */
44 const int max_vertices=16777216;
45 /** The maximum memory allocation for the maximum vertex order. */
46 const int max_vertex_order=2048;
47 /** The maximum memory allocation for the any particular order of vertex. */
48 const int max_n_vertices=16777216;
49 /** The maximum size for the delete stack. */
50 const int max_delete_size=16777216;
51 /** The maximum size for the auxiliary delete stack. */
52 const int max_delete2_size=16777216;
53 /** The maximum size for the extra search stack. */
54 const int max_xsearch_size=16777216;
55 /** The maximum amount of particle memory allocated for a single region. */
56 const int max_particle_memory=16777216;
57 /** The maximum size for the wall pointer array. */
58 const int max_wall_size=2048;
59 /** The maximum size for the ordering class. */
60 const int max_ordering_size=67108864;
61 /** The maximum size for the pre_container chunk index. */
62 const int max_chunk_size=65536;
64 /** The chunk size in the pre_container classes. */
65 const int pre_container_chunk_size=1024;
67 #ifndef VOROPP_VERBOSE
68 /** Voro++ can print a number of different status and debugging messages to
69 * notify the user of special behavior, and this macro sets the amount which
70 * are displayed. At level 0, no messages are printed. At level 1, messages
71 * about unusual cases during cell construction are printed, such as when the
72 * plane routine bails out due to floating point problems. At level 2, general
73 * messages about memory expansion are printed. At level 3, technical details
74 * about memory management are printed. */
75 #define VOROPP_VERBOSE 2
76 #endif
78 /** If a point is within this distance of a cutting plane, then the code
79 * assumes that point exactly lies on the plane. */
80 const double tolerance=10.*std::numeric_limits<double>::epsilon();
82 const double big_tolerance_fac=20.;
84 const double default_length=1000.;
86 /** A large number that is used in the computation. */
87 const double large_number=std::numeric_limits<double>::max();
89 /** A radius to use as a placeholder when no other information is available. */
90 const double default_radius=0.5;
92 /** The maximum number of shells of periodic images to test over. */
93 const int max_unit_voro_shells=10;
95 /** A guess for the optimal number of particles per block, used to set up the
96 * container grid. */
97 const double optimal_particles=5.6;
99 /** If this is set to 1, then the code reports any instances of particles being
100 * put outside of the container geometry. */
101 #define VOROPP_REPORT_OUT_OF_BOUNDS 0
103 /** Voro++ returns this status code if there is a file-related error, such as
104 * not being able to open file. */
105 #define VOROPP_FILE_ERROR 1
107 /** Voro++ returns this status code if there is a memory allocation error, if
108 * one of the safe memory limits is exceeded. */
109 #define VOROPP_MEMORY_ERROR 2
111 /** Voro++ returns this status code if there is any type of internal error, if
112 * it detects that representation of the Voronoi cell is inconsistent. This
113 * status code will generally indicate a bug, and the developer should be
114 * contacted. */
115 #define VOROPP_INTERNAL_ERROR 3
117 /** Voro++ returns this status code if it could not interpret the command line
118 * arguments passed to the command line utility. */
119 #define VOROPP_CMD_LINE_ERROR 4
123 #endif