Next: Explanation of key Up: Finite difference theory Previous: Derivation of finite
When two cubic pixels share a face, and are of the same material, the conductance of the bond connecting them is just the conductance of the pixel,
| Σm = σ m · (pixel length) | (34) |
concentrated into a conducting bond (for a cubic pixel). The situation when two pixels share a face, and are of two different materials A and B, is shown in Fig. 3. Node and pixel j is on the left of the interface, and node and pixel j + 1 is on the right side of the interface. In the figure, the conductivity of material A is shown as being different than that of material B. If one were to think of a bond connecting j and j + 1, the conductance of that bond is just a series combination of one half the conductance of each pixel,

Figure 3: Illustration of nodes near a boundary in the finite difference method.
This construction approximates boundaries. For a pure series situation, this construction is perfectly accurate, and enables the program to give the correct answer. For a curved boundary, like across a spherical inclusion, the answer will not be perfectly accurate. For two adjoining pixels, this construction is, however, the best possible approximation.
The derivation of this condition is simple. Choose the pixel length to be unity, as is done in all the programs. Consider the point P that is exactly on the boundary and halfway between nodes j and j + 1. The voltage at P is VP. The boundary condition at the interface is that the normal current across the interface must be continuous. In finite difference terms, that means that
| ΣA (VP − Vj) = ΣB (Vj + 1 − VP) | (36) |
which gives an equation for VP in terms of Vj and Vj + 1. Now one must build up the appropriate finite difference equations, but being careful of the boundary. One uses non- centered difference equations for j and j − 1. The two expansions hold:
Eliminating the first derivative from this pair of equations, and using the boundary condition equation to eliminate VP, results in the same kind of equation as eq. (33) for node j, but with eq. (35) for the conductivity across the interface. Since in a digital image, all boundaries are locally oriented in the x, y, or z directions, and are essentially 1-D, the formalism in eqs. (35) -(38) above holds generally and is incorporated into the finite difference programs in subroutine BOND.
In all the finite difference programs, periodic boundary conditions are used with the application of an electric field, with its appropriate voltage gradient. Periodic boundary conditions are maintained using a shell of imaginary sites around the main system, as shown in Fig. 4. In Fig. 4, there are nine real sites in this 3 x 3 pixel system, labelled 1-9, and 12 imaginary sites, labelled in italics according to which real site they correspond. Suppose that a field is applied from left to right in Fig. 4. The strength of the field is 1/3, so that there is a voltage step of one placed across the sample. Therefore, the node with italic label 6 has a voltage equal to the voltage at real node 6, but exactly one unit higher. The node with italic label 4 has the same voltage as that at real node 4, but one unit lower. Vertically, since there is no applied field, the nodes with italic labels 2 and 8 have the same voltages as real nodes 2 and 8, respectively. Any update vector coming from the conjugate gradient relaxation routine that is added to the voltage must obey pure periodic boundary conditions (no applied field), so that the inital applied voltage gradient (applied field) is maintained. In subroutine PROD in the finite difference programs, there are DO loops that explicitly maintain this periodicity after every multiplication of the main matrix.
Figure 4: Illustration of how periodic boundary conditions are implemented
in the finite difference programs.