Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project 1: Liang Peng #20

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix brute-force rule1 & rule3 bugs
Liang Peng committed Sep 9, 2016
commit cef0231f0a763dcf8a01e5844748e0f341cb0be7
6 changes: 2 additions & 4 deletions src/kernel.cu
Original file line number Diff line number Diff line change
@@ -254,9 +254,8 @@ __device__ glm::vec3 computeVelocityChange(int N, int iSelf, const glm::vec3 *po

if (numOfNeighbors1 > 0) {
centerOfMass /= numOfNeighbors1 + 0.f;
vDelta += (centerOfMass - pos[iSelf]) * rule1Scale;
}

vDelta += (centerOfMass - pos[iSelf]) * rule1Scale;
#endif

#ifndef RULE2
@@ -296,9 +295,8 @@ __device__ glm::vec3 computeVelocityChange(int N, int iSelf, const glm::vec3 *po

if (numOfNeighbor3 > 0) {
vAverage /= numOfNeighbor3 + 0.f;
vDelta += vAverage * rule3Scale;
}

vDelta += vAverage * rule3Scale;
#endif

return vDelta;