Fixed computation of the maximum number of particles accepted by Qhull

This commit is contained in:
Guilhem Lavaux 2013-03-30 15:26:37 -05:00
parent 7770f40aff
commit 9c329086af

View file

@ -5,7 +5,7 @@
#define DL for (d=0;d<3;d++) #define DL for (d=0;d<3;d++)
#define BF 1e30 #define BF 1e30
#define QHULL_MAX_PARTICLES (1L<<24-1) #define QHULL_MAX_PARTICLES ((1L<<24)-1)
int posread(char *posfile, float ***p, float fact); int posread(char *posfile, float ***p, float fact);
@ -149,9 +149,10 @@ int main(int argc, char *argv[]) {
printf("Nvpbuf range: %d,%d\n",nvpbufmin,nvpbufmax); printf("Nvpbuf range: %d,%d\n",nvpbufmin,nvpbufmax);
numGuards = 6*(NGUARD+1)*(NGUARD+1); numGuards = 6*(NGUARD+1)*(NGUARD+1);
printf("Total max particles: %d\n" , nvpbufmax+numGuards);
if (nvpbufmax+numGuards >= QHULL_MAX_PARTICLES) if (nvpbufmax+numGuards >= QHULL_MAX_PARTICLES)
{ {
printf("Too many particles to tesselate per division (Qhull will overflow). Increase divisions or reduce buffer size."); printf("Too many particles to tesselate per division (Qhull will overflow). Increase divisions or reduce buffer size.\n");
fflush(stdout); fflush(stdout);
exit(1); exit(1);
} }