[CSC 435] Diffusion Assistance
Andrew J. Pounds
pounds_aj at mercer.edu
Sun May 1 14:28:26 EDT 2016
So apparently you guys can't get the diffusion code to work using the 3D
Jacobi update algorithm. Since you are using a cube and the dx=dy=dz,
you can do something like this... which is a simple extension of
equation 3.7 in your text to 3D
scalar = diffusion_coefficient * timestep / distance_between_blocks**2
do i = 1, msize
do j = 1, msize
do k = 1, msize
tempbox(k,j,i) = box(k,j,i) + &
( ( box(k,j,i-1) + box(k,j,i+1) - 2.0D0*
box(k,j,i)) &
* mask(k,j,i-1) * mask(k,j,i+1) + &
( box(k,j-1,i) + box(k,j+1,i) - 2.0D0*
box(k,j,i)) &
* mask(k,j-1,i) * mask(k,j+1,i) + &
( box(k-1,j,i) + box(k+1,j,i) - 2.0D0*
box(k,j,i)) &
* mask(k-1,j,i) * mask(k+1,j,i) ) &
* scalar
end do
end do
end do
Hope that helps...
--
Andrew J. Pounds, Ph.D. (pounds_aj at mercer.edu)
Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
http://faculty.mercer.edu/pounds_aj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc435/attachments/20160501/15f80af9/attachment.html>
More information about the csc435
mailing list