Is the ordering of dependent variables important?

The only place in SUNDIALS where ordering is important is the banded linear system solver — either as used directly or as used on a preconditioner. For band matrices, ordering is critical — to get the bandwidth as small as possible, and hence maximize efficiency. For example, a pair of coupled PDEs, discretized in space, gives a system of ODEs that could be ordered either (a) first by PDE component then by spatial index, or (b) the reverse. For ordering (b) the Jacobian is not banded at all; there are elements in the upper right and lower left corners from the coupling of the two PDE components. For ordering (a) the Jacobian is banded, according to the nearest-neighbor coupling in the discretized spatial operator.

SUNDIALS does not do any actual reordering of dependent variables on its own. (It does partial pivoting in the dense and banded solvers, but that is for numerical stability, not for bandwidth reduction.) So, when the banded solver is involved, pay attention to ordering. Otherwise, use whatever ordering is natural for the application.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.