1 |
francois |
979 |
// 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 |
6 |
|
|
|
7 |
|
|
/** \file config.hh |
8 |
|
|
* \brief Master configuration file for setting various compile-time options. */ |
9 |
|
|
|
10 |
|
|
#ifndef VOROPP_CONFIG_HH |
11 |
|
|
#define VOROPP_CONFIG_HH |
12 |
|
|
|
13 |
|
|
namespace voro { |
14 |
|
|
|
15 |
|
|
// These constants set the initial memory allocation for the Voronoi cell |
16 |
|
|
/** The initial memory allocation for the number of vertices. */ |
17 |
|
|
const int init_vertices=256; |
18 |
|
|
/** The initial memory allocation for the maximum vertex order. */ |
19 |
|
|
const int init_vertex_order=64; |
20 |
|
|
/** The initial memory allocation for the number of regular vertices of order |
21 |
|
|
* 3. */ |
22 |
|
|
const int init_3_vertices=256; |
23 |
|
|
/** The initial memory allocation for the number of vertices of higher order. |
24 |
|
|
*/ |
25 |
|
|
const int init_n_vertices=8; |
26 |
|
|
/** The initial buffer size for marginal cases used by the suretest class. */ |
27 |
|
|
const int init_marginal=64; |
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 wall pointer array. */ |
33 |
|
|
const int init_wall_size=32; |
34 |
|
|
/** The default initial size for the ordering class. */ |
35 |
|
|
const int init_ordering_size=4096; |
36 |
|
|
/** The initial size of the pre_container chunk index. */ |
37 |
|
|
const int init_chunk_size=256; |
38 |
|
|
|
39 |
|
|
// If the initial memory is too small, the program dynamically allocates more. |
40 |
|
|
// However, if the limits below are reached, then the program bails out. |
41 |
|
|
/** The maximum memory allocation for the number of vertices. */ |
42 |
|
|
const int max_vertices=16777216; |
43 |
|
|
/** The maximum memory allocation for the maximum vertex order. */ |
44 |
|
|
const int max_vertex_order=2048; |
45 |
|
|
/** The maximum memory allocation for the any particular order of vertex. */ |
46 |
|
|
const int max_n_vertices=16777216; |
47 |
|
|
/** The maximum buffer size for marginal cases used by the suretest class. */ |
48 |
|
|
const int max_marginal=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 amount of particle memory allocated for a single region. */ |
54 |
|
|
const int max_particle_memory=16777216; |
55 |
|
|
/** The maximum size for the wall pointer array. */ |
56 |
|
|
const int max_wall_size=2048; |
57 |
|
|
/** The maximum size for the ordering class. */ |
58 |
|
|
const int max_ordering_size=67108864; |
59 |
|
|
/** The maximum size for the pre_container chunk index. */ |
60 |
|
|
const int max_chunk_size=65536; |
61 |
|
|
|
62 |
|
|
/** The chunk size in the pre_container classes. */ |
63 |
|
|
const int pre_container_chunk_size=1024; |
64 |
|
|
|
65 |
|
|
#ifndef VOROPP_VERBOSE |
66 |
|
|
/** Voro++ can print a number of different status and debugging messages to |
67 |
|
|
* notify the user of special behavior, and this macro sets the amount which |
68 |
|
|
* are displayed. At level 0, no messages are printed. At level 1, messages |
69 |
|
|
* about unusual cases during cell construction are printed, such as when the |
70 |
|
|
* plane routine bails out due to floating point problems. At level 2, general |
71 |
|
|
* messages about memory expansion are printed. At level 3, technical details |
72 |
|
|
* about memory management are printed. */ |
73 |
|
|
#define VOROPP_VERBOSE 0 |
74 |
|
|
#endif |
75 |
|
|
|
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 |
|
|
const double tolerance=1e-11; |
79 |
|
|
|
80 |
|
|
/** If a point is within this distance of a cutting plane, then the code stores |
81 |
|
|
* whether this point is inside, outside, or exactly on the cutting plane in |
82 |
|
|
* the marginal cases buffer, to prevent the test giving a different result on |
83 |
|
|
* a subsequent evaluation due to floating point rounding errors. */ |
84 |
|
|
const double tolerance2=2e-11; |
85 |
|
|
|
86 |
|
|
/** The square of the tolerance, used when deciding whether some squared |
87 |
|
|
* quantities are large enough to be used. */ |
88 |
|
|
const double tolerance_sq=tolerance*tolerance; |
89 |
|
|
|
90 |
|
|
/** A large number that is used in the computation. */ |
91 |
|
|
const double large_number=1e30; |
92 |
|
|
|
93 |
|
|
/** A radius to use as a placeholder when no other information is available. */ |
94 |
|
|
const double default_radius=0.5; |
95 |
|
|
|
96 |
|
|
/** The maximum number of shells of periodic images to test over. */ |
97 |
|
|
const int max_unit_voro_shells=10; |
98 |
|
|
|
99 |
|
|
/** A guess for the optimal number of particles per block, used to set up the |
100 |
|
|
* container grid. */ |
101 |
|
|
const double optimal_particles=5.6; |
102 |
|
|
|
103 |
|
|
/** If this is set to 1, then the code reports any instances of particles being |
104 |
|
|
* put outside of the container geometry. */ |
105 |
|
|
#define VOROPP_REPORT_OUT_OF_BOUNDS 0 |
106 |
|
|
|
107 |
|
|
/** Voro++ returns this status code if there is a file-related error, such as |
108 |
|
|
* not being able to open file. */ |
109 |
|
|
#define VOROPP_FILE_ERROR 1 |
110 |
|
|
|
111 |
|
|
/** Voro++ returns this status code if there is a memory allocation error, if |
112 |
|
|
* one of the safe memory limits is exceeded. */ |
113 |
|
|
#define VOROPP_MEMORY_ERROR 2 |
114 |
|
|
|
115 |
|
|
/** Voro++ returns this status code if there is any type of internal error, if |
116 |
|
|
* it detects that representation of the Voronoi cell is inconsistent. This |
117 |
|
|
* status code will generally indicate a bug, and the developer should be |
118 |
|
|
* contacted. */ |
119 |
|
|
#define VOROPP_INTERNAL_ERROR 3 |
120 |
|
|
|
121 |
|
|
/** Voro++ returns this status code if it could not interpret the command line |
122 |
|
|
* arguments passed to the command line utility. */ |
123 |
|
|
#define VOROPP_CMD_LINE_ERROR 4 |
124 |
|
|
|
125 |
|
|
} |
126 |
|
|
|
127 |
|
|
#endif |