Skip to content

Instantly share code, notes, and snippets.

@nervoussystem
Created June 8, 2010 00:21
Show Gist options
  • Save nervoussystem/429413 to your computer and use it in GitHub Desktop.
Save nervoussystem/429413 to your computer and use it in GitHub Desktop.
for(int i=0;i<F.length;++i) {
for(int j=0;j<F[0].length;++j) {
F_next[i][j] = F[i][j]+deltaT*diffusionRate/deltaXSq*(F[(i+1)%F.length][j]+
F[(i-1+F.length)%F.length][j]+
F[i][(j+1)%F[0].length]+
F[i][(j-1+F[0].length)%F[0].length]-
4*F[i][j]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment