grad(f(i,j,k)) = (
(f(i+1,j ,k )-f(i-1,j ,k ))/delx, (f(i ,j+1,k )-f(i ,j-1,k ))/dely, (f(i ,j ,k+1)-f(i ,j ,k-1))/delz)
delx = x(i+1)-x(i-1) dely = y(j+1)-y(j-1) delz = z(k+1)-z(k-1)
For a two dimensional lattice f, the two component vector field is:
grad(f(i,j)) = (
(f(i+1,j )-f(i-1,j ))/delx, (f(i ,j+1)-f(i ,j-1))/dely)
At the lower (i=imin or j=jmin or k=kmin) boundaries of the lattice, a forward difference is used in the component on the boundary:
grad(imin,j,k) = (
(f(imin+1,j ,k )-f(imin,j ,k ))/delx, (f(imin ,j+1,k )-f(imin,j ,k ))/dely, (f(imin ,j ,k+1)=f(imin,j ,k ))/delz)
Similarly, at the upper boundaries (i=imax or j=jmax or k=kmax) a backward difference is used for the component on the boundary. The results can be converted into geometry by VectorGen for display in the Render module. The Scale parameter is used to scale the vector values at each node of the lattice. The Channel slider is used to select the desired component if the input lattice is a vector field.
This module has been replaced by GradientLat, which offers more functionality, but is retained for backwards compatibility. The module may be removed from future releases.
Port: Input Field
The input lattice.
A scale factor.
The vector component if the Input Field is a vector lattice. This is zero- based.
The output gradient.