00001 // Voro++, a 3D cell-based Voronoi library 00002 // 00003 // Author : Chris H. Rycroft (LBL / UC Berkeley) 00004 // Email : [email protected] 00005 // Date : July 1st 2008 00006 00007 /** \file config.hh 00008 * \brief Master configuration file for setting various compile-time options. */ 00009 00010 #ifndef VOROPP_CONFIG_HH 00011 #define VOROPP_CONFIG_HH 00012 00013 // These constants set the initial memory allocation for the Voronoi cell 00014 /** The initial memory allocation for the number of vertices. */ 00015 const int init_vertices=256; 00016 /** The initial memory allocation for the maximum vertex order. */ 00017 const int init_vertex_order=64; 00018 /** The initial memory allocation for the number of regular vertices of order 00019 * 3. */ 00020 const int init_3_vertices=256; 00021 /** The initial memory allocation for the number of vertices of higher order. 00022 */ 00023 const int init_n_vertices=8; 00024 /** The initial buffer size for marginal cases used by the suretest class. */ 00025 const int init_marginal=256; 00026 /** The initial size for the delete stack. */ 00027 const int init_delete_size=256; 00028 /** The initial size for the auxiliary delete stack. */ 00029 const int init_delete2_size=256; 00030 /** The initial size for the facets evaluation. */ 00031 const int init_facet_size=32; 00032 /** The initial size for the wall pointer array. */ 00033 const int init_wall_size=32; 00034 00035 // If the initial memory is too small, the program dynamically allocates more. 00036 // However, if the limits below are reached, then the program bails out. 00037 /** The maximum memory allocation for the number of vertices. */ 00038 const int max_vertices=16777216; 00039 /** The maximum memory allocation for the maximum vertex order. */ 00040 const int max_vertex_order=2048; 00041 /** The maximum memory allocation for the any particular order of vertex. */ 00042 const int max_n_vertices=16777216; 00043 /** The maximum buffer size for marginal cases used by the suretest class. */ 00044 const int max_marginal=16777216; 00045 /** The maximum size for the delete stack. */ 00046 const int max_delete_size=16777216; 00047 /** The maximum size for the auxiliary delete stack. */ 00048 const int max_delete2_size=16777216; 00049 /** The maximum amount of particle memory allocated for a single region. */ 00050 const int max_particle_memory=16777216; 00051 /** The maximum size for the wall pointer array. */ 00052 const int max_wall_size=2048; 00053 00054 #ifndef VOROPP_VERBOSE 00055 /** Voro++ can print a number of different status and debugging messages to 00056 * notify the user of special behavior, and this macro sets the amount which 00057 * are displayed. At level 0, no messages are printed. At level 1, messages 00058 * about unusual cases during cell construction are printed, such as when the 00059 * plane routine bails out due to floating point problems. At level 2, general 00060 * messages about memory expansion are printed. At level 3, technical details 00061 * about memory management are printed. */ 00062 #define VOROPP_VERBOSE 0 00063 #endif 00064 00065 /** The declaration of fpoint allows that code to be compiled both using single 00066 * precision numbers and double precision numbers. Under normal usage fpoint is 00067 * set be a double precision floating point number, but defining the 00068 * preprocessor macro VOROPP_SINGLE_PRECISION will switch it to single 00069 * precision and make the code tolerances larger. */ 00070 #ifdef VOROPP_SINGLE_PRECISION 00071 typedef float fpoint; 00072 #else 00073 typedef double fpoint; 00074 #endif 00075 00076 /** If a point is within this distance of a cutting plane, then the code 00077 * assumes that point exactly lies on the plane. */ 00078 #ifdef VOROPP_SINGLE_PRECISION 00079 const fpoint tolerance=1e-5; 00080 #else 00081 const fpoint tolerance=1e-10; 00082 #endif 00083 00084 /** If a point is within this distance of a cutting plane, then the code stores 00085 * whether this point is inside, outside, or exactly on the cutting plane in 00086 * the marginal cases buffer, to prevent the test giving a different result on 00087 * a subsequent evaluation due to floating point rounding errors. */ 00088 #ifdef VOROPP_SINGLE_PRECISION 00089 const fpoint tolerance2=2e-5; 00090 #else 00091 const fpoint tolerance2=2e-10; 00092 #endif 00093 00094 /** The square of the tolerance, used when deciding whether some squared 00095 * quantities are large enough to be used. */ 00096 const fpoint tolerance_sq=tolerance*tolerance; 00097 00098 /** A large number that is used in the computation. */ 00099 const fpoint large_number=1e30; 00100 00101 /** Voro++ returns this status code if there is a file-related error, such as 00102 * not being able to open file. */ 00103 #define VOROPP_FILE_ERROR 1 00104 00105 /** Voro++ returns this status code if there is a memory allocation error, if 00106 * one of the safe memory limits is exceeded. */ 00107 #define VOROPP_MEMORY_ERROR 2 00108 00109 /** Voro++ returns this status code if there is any type of internal error, if 00110 * it detects that representation of the Voronoi cell is inconsistent. This 00111 * status code will generally indicate a bug, and the developer should be 00112 * contacted. */ 00113 #define VOROPP_INTERNAL_ERROR 3 00114 00115 /** Voro++ returns this status code if it could not interpret to the command 00116 * line arguments passed to the command line utility. */ 00117 #define VOROPP_CMD_LINE_ERROR 4 00118 00119 #endif