The formulation of the discretized differential operators is aided by the topological operations and the functional means of specification.
The underlying topological framework needs to provide edges and vertices (actually no cells) and for the sake of simplicity, even graph data structures providing incidence relations and traversal functions can be employed for the implementation. Furthermore, a geometrical algorithm for the determination of the areas and volumes of the dual surfaces and cells is required. Another requirement is that an orientation function is available which determines, if a vertex is a source or a sink of an edge. For the use within a formula the explicit orientation of the single edges is not relevant. The formula is said to be invariant with respect to changes of the topological orientation. There are containers to provide storage means for both, quantities on vertices as well as quantities on edges.
In contrast to the initial formulation of the Scharfetter Gummel scheme, an algorithm for the implementation of the discretization scheme can be directly derived from the given formula.