Commit d2006f7b authored by Cassio Kirch's avatar Cassio Kirch
Browse files

Gamma != 0 for isolated cells

parent 864ff4b3
...@@ -19,7 +19,8 @@ getGamma (const struct Boid* const boids) ...@@ -19,7 +19,8 @@ getGamma (const struct Boid* const boids)
do do
{ {
boidCount--; boidCount--;
gamma += boids[boidCount].gamma/endoBoids; if (boids[boidCount].gamma <= 1.01)
gamma += boids[boidCount].gamma/endoBoids;
} }
while(boidCount != 0); while(boidCount != 0);
...@@ -33,14 +34,16 @@ one_system () ...@@ -33,14 +34,16 @@ one_system ()
struct Box box[BOXES]; struct Box box[BOXES];
unsigned int boidCount, boxID, threadCount; unsigned int boidCount, boxID, threadCount;
unsigned long long int step, continuousStep = 0; unsigned long long int step, continuousStep = 0;
FILE* dat = initializeSingleFile(); //FILE* dat = initializeSingleFile();
FILE* finalConfigurationFile; FILE* finalConfigurationFile;
char finalConfigurationFileName[FILENAME_SIZE]; char finalConfigurationFileName[FILENAME_SIZE];
#ifdef PLOT_EXIT_FILES #ifdef PLOT_EXIT_FILES
FILE* endoFile; FILE* endoFile;
FILE* ectoFile; FILE* ectoFile;
#endif #endif
#ifdef GAMMA_FILE
FILE* gammaFile = initializeGammaFile(); FILE* gammaFile = initializeGammaFile();
#endif
/* Set the pthread_create parameters. */ /* Set the pthread_create parameters. */
struct Parameters parametersStruct[NUM_THREADS]; struct Parameters parametersStruct[NUM_THREADS];
...@@ -65,10 +68,11 @@ one_system () ...@@ -65,10 +68,11 @@ one_system ()
initializeBoid (&boid[boidCount]); initializeBoid (&boid[boidCount]);
checkLimits(&(boid[boidCount])); checkLimits(&(boid[boidCount]));
} }
initializeBoxes(box);
initializeBoxes(box);
for (boidCount=0; boidCount<N; boidCount++) for (boidCount=0; boidCount<N; boidCount++)
appendBoid(&(boid[boidCount]), box); appendBoid(&(boid[boidCount]), box);
for (step=0; step<STEPS; ++step) for (step=0; step<STEPS; ++step)
{ {
nextStep(parameters); nextStep(parameters);
...@@ -110,12 +114,17 @@ one_system () ...@@ -110,12 +114,17 @@ one_system ()
fclose(endoFile); fclose(endoFile);
fclose(ectoFile); fclose(ectoFile);
#endif #endif
#ifdef GAMMA_FILE
fprintf(gammaFile, "%llu\t%lf\n", step, getGamma(boid)); fprintf(gammaFile, "%llu\t%lf\n", step, getGamma(boid));
#endif
++continuousStep; ++continuousStep;
} }
} }
#ifdef GAMMA_FILE
fclose (gammaFile); fclose (gammaFile);
fclose (dat); #endif
//fclose (dat);
sprintf(finalConfigurationFileName, "final_%s.dat", getDate()); sprintf(finalConfigurationFileName, "final_%s.dat", getDate());
finalConfigurationFile = fopen(finalConfigurationFileName, "w"); finalConfigurationFile = fopen(finalConfigurationFileName, "w");
for (boidCount=0; boidCount<N; boidCount++) for (boidCount=0; boidCount<N; boidCount++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment