Voro++
config.hh
Go to the documentation of this file.
00001 // Voro++, a 3D cell-based Voronoi library
00002 //
00003 // Author   : Chris H. Rycroft (LBL / UC Berkeley)
00004 // Email    : chr@alum.mit.edu
00005 // Date     : August 30th 2011
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 namespace voro {
00014 
00015 // These constants set the initial memory allocation for the Voronoi cell
00016 /** The initial memory allocation for the number of vertices. */
00017 const int init_vertices=256;
00018 /** The initial memory allocation for the maximum vertex order. */
00019 const int init_vertex_order=64;
00020 /** The initial memory allocation for the number of regular vertices of order
00021  * 3. */
00022 const int init_3_vertices=256;
00023 /** The initial memory allocation for the number of vertices of higher order.
00024  */
00025 const int init_n_vertices=8;
00026 /** The initial buffer size for marginal cases used by the suretest class. */
00027 const int init_marginal=64;
00028 /** The initial size for the delete stack. */
00029 const int init_delete_size=256;
00030 /** The initial size for the auxiliary delete stack. */
00031 const int init_delete2_size=256;
00032 /** The initial size for the wall pointer array. */
00033 const int init_wall_size=32;
00034 /** The default initial size for the ordering class. */
00035 const int init_ordering_size=4096;
00036 /** The initial size of the pre_container chunk index. */
00037 const int init_chunk_size=256;
00038 
00039 // If the initial memory is too small, the program dynamically allocates more.
00040 // However, if the limits below are reached, then the program bails out.
00041 /** The maximum memory allocation for the number of vertices. */
00042 const int max_vertices=16777216;
00043 /** The maximum memory allocation for the maximum vertex order. */
00044 const int max_vertex_order=2048;
00045 /** The maximum memory allocation for the any particular order of vertex. */
00046 const int max_n_vertices=16777216;
00047 /** The maximum buffer size for marginal cases used by the suretest class. */
00048 const int max_marginal=16777216;
00049 /** The maximum size for the delete stack. */
00050 const int max_delete_size=16777216;
00051 /** The maximum size for the auxiliary delete stack. */
00052 const int max_delete2_size=16777216;
00053 /** The maximum amount of particle memory allocated for a single region. */
00054 const int max_particle_memory=16777216;
00055 /** The maximum size for the wall pointer array. */
00056 const int max_wall_size=2048;
00057 /** The maximum size for the ordering class. */
00058 const int max_ordering_size=67108864;
00059 /** The maximum size for the pre_container chunk index. */
00060 const int max_chunk_size=65536;
00061 
00062 /** The chunk size in the pre_container classes. */
00063 const int pre_container_chunk_size=1024;
00064 
00065 #ifndef VOROPP_VERBOSE
00066 /** Voro++ can print a number of different status and debugging messages to
00067  * notify the user of special behavior, and this macro sets the amount which
00068  * are displayed. At level 0, no messages are printed. At level 1, messages
00069  * about unusual cases during cell construction are printed, such as when the
00070  * plane routine bails out due to floating point problems. At level 2, general
00071  * messages about memory expansion are printed. At level 3, technical details
00072  * about memory management are printed. */
00073 #define VOROPP_VERBOSE 0
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 const double tolerance=1e-11;
00079 
00080 /** If a point is within this distance of a cutting plane, then the code stores
00081  * whether this point is inside, outside, or exactly on the cutting plane in
00082  * the marginal cases buffer, to prevent the test giving a different result on
00083  * a subsequent evaluation due to floating point rounding errors. */
00084 const double tolerance2=2e-11;
00085 
00086 /** The square of the tolerance, used when deciding whether some squared
00087  * quantities are large enough to be used. */
00088 const double tolerance_sq=tolerance*tolerance;
00089 
00090 /** A large number that is used in the computation. */
00091 const double large_number=1e30;
00092 
00093 /** A radius to use as a placeholder when no other information is available. */
00094 const double default_radius=0.5;
00095 
00096 /** The maximum number of shells of periodic images to test over. */
00097 const int max_unit_voro_shells=10;
00098 
00099 /** A guess for the optimal number of particles per block, used to set up the
00100  * container grid. */
00101 const double optimal_particles=5.6;
00102 
00103 /** If this is set to 1, then the code reports any instances of particles being
00104  * put outside of the container geometry. */
00105 #define VOROPP_REPORT_OUT_OF_BOUNDS 0
00106 
00107 /** Voro++ returns this status code if there is a file-related error, such as
00108  * not being able to open file. */
00109 #define VOROPP_FILE_ERROR 1
00110 
00111 /** Voro++ returns this status code if there is a memory allocation error, if
00112  * one of the safe memory limits is exceeded. */
00113 #define VOROPP_MEMORY_ERROR 2
00114 
00115 /** Voro++ returns this status code if there is any type of internal error, if
00116  * it detects that representation of the Voronoi cell is inconsistent. This
00117  * status code will generally indicate a bug, and the developer should be
00118  * contacted. */
00119 #define VOROPP_INTERNAL_ERROR 3
00120 
00121 /** Voro++ returns this status code if it could not interpret the command line
00122  * arguments passed to the command line utility. */
00123 #define VOROPP_CMD_LINE_ERROR 4
00124 
00125 }
00126 
00127 #endif