Minor changes

This commit is contained in:
Joshua Coles 2023-02-19 18:59:53 +00:00
parent c1b4b6bab1
commit dacfff3e96
2 changed files with 6 additions and 7 deletions

View File

@ -148,12 +148,12 @@ void DLASystem::updateClusterRadius(double pos[]) {
// make a random move of the last particle in the particleList // make a random move of the last particle in the particleList
void DLASystem::moveLastParticle() { void DLASystem::moveLastParticle() {
int rr = rgen.randomInt(4); // pick a random number in the range 0-3, which direction do we hop? int direction = rgen.randomInt(4); // pick a random number in the range 0-3, which direction do we hop?
double newpos[2]; double newpos[2];
Particle *lastP = particleList[this->particleList.size() - 1]; Particle *lastP = particleList[this->particleList.size() - 1];
setPosNeighbour(newpos, lastP->pos, rr); setPosNeighbour(newpos, lastP->pos, direction);
if (distanceFromOrigin(newpos) > killCircle) { if (distanceFromOrigin(newpos) > killCircle) {
setGrid(lastP->pos, 0); setGrid(lastP->pos, 0);
@ -173,10 +173,9 @@ void DLASystem::moveLastParticle() {
updateClusterRadius(lastP->pos); // update the cluster radius, addCircle, etc. updateClusterRadius(lastP->pos); // update the cluster radius, addCircle, etc.
} }
} else { } else {
// if we get to here then we are trying to move to an occupied site // If we get to here then we are trying to move to an occupied site
// (this should never happen as long as the sticking probability is 1.0) cout << "reject " << direction << endl
cout << "reject " << rr << endl; << lastP->pos[0] << "," << lastP->pos[1] << endl;
cout << lastP->pos[0] << " " << lastP->pos[1] << endl;
} }
} }

View File

@ -10,7 +10,7 @@
CXX = clang++ CXX = clang++
CXXFLAGS = -Wall -Wextra -g -O0 CXXFLAGS = -Wall -Wextra -g -O0 -std=c++20 -stdlib=libc++
IFLAGS = -I/usr/local/include -I/usr/include IFLAGS = -I/usr/local/include -I/usr/include