The change of a dopant profile through a diffusion process occurs either as a parasitic effect (e.g. during thermal oxidation or during annealing) or is intentionally used to move or change the shape of a dopant profile (drive in diffusion).
The physical diffusion process follows the entropy principle, where the flow always takes place from regions of high concentration to regions of lower concentration. Over time an equilibrium concentration must appear. This behavior is expressed as the (continuous) maximum principle for parabolic differential operators. A physical interpretation thereof states that the maximum must occur either at the initial time or at the boundary in case mass flows from the outside. The dual minimum principle states that also the minimum occurs at the initial time or at the boundary. Compliance with the maximum and minimum principle (Minimax principle) guaranties that the maximum and the minimum will stay below and above the initial values, respectively. Thus, positive concentrations at all time-steps during the simulation are necessary that the Minimax principle be fulfilled. In a diffusion simulation with homogeneous Neumann boundary conditions (no mass flux through the boundary of the simulation domain) the mass (i.e. dopant dose) is conserved, thus the maximum and minimum must occur at the initial time.
The core algorithm of the simulator was designed to use the Finite-Element method to solve the underlying equation system.Although the box integration method is generally better suited for all kinds of mass conservation laws (Diffusion equation), a treatment of stress models as they are used in the simulation of oxidation is not easy. Thus, since a parasitic diffusion occurs in any kind of thermal oxidation step, this can be treated somewhat easier by a simulator based on the Finite-Element method.
The discretization by the Finite-Element discretization scheme can result in an algebraic system the solution of which violates the discrete Minimax principle. Sometimes this is observed as negative concentrations that emerge during the simulation. It was shown that traditional Delaunay meshes (necessary for two-dimensional diffusion simulations) are neither sufficient nor necessary for three-dimensional diffusion simulations based on the Finite-Element method . A mesh that is obtuse angle free satisfies the Minimax principle, however, this is a too strong criterion. A weaker mesh criterion was derived by Xu and Zikatanov 
As a solution to reduce the introduced discretization error the simulation mesh can be refined based on various error estimators. A better approach would be to use an initial gridding step to enforce the dihedral angle criterion on the mesh prior to refining it. However, the author does not know of any existing meshing tools that support the generation of a mesh that complies with this criterion. Additionally, even if a stand-alone gridding tool becomes available, it can only be used in an initial pre-processing step. If one considers oxidation simulations, however, a gridding algorithm must be tightly integrated with the simulator's internal data structures and must be used regularly during the simulation to repair violations of mesh criteria that are introduced by the topography change.
An algorithm to adaptively refine the mesh based on the resulting concentration of a previously computed time step is implemented in the simulator and described in the following section.