Uppsala University Department of Information Technology

Technical Report 2007-007

Composable Difference Operators for Coordinate Invariant Partial Differential Equations

Malin Ljungberg

February 2007


Computer simulations are a cost efficient complement to laboratory experiments. Software for the solution of partial differential equations is part of the basic infrastructure for the evolving field of Computational Science and Engineering. Numerical analysts are involved in the development of suitable methods and algorithms for the solution of a wide range of partial differential equations.

Based on the needs of a numerical analyst, we here identify requirements on software for the solution of partial differential equations. In particular, we look at support for flexible formulations of finite difference methods on curvilinear structured grids.

We present FlexOp, a software solution that meets the requirements that have been identified. The semantics of the FlexOp is highly mathematical, and includes coordinate invariant operators. The discretization strategy is specified using parameterized classes, and can be chosen independently for different instances of the same operator. The use of static polymorphism allows for a flexible and efficient implementation of the application of the discretized operator.

In order to assess the FlexOp, we use them to implement a compact fourth-order Numerov method, using the TENGOME infrastructure as a basis and C++ as the implementation language.

We find that the FlexOp are easy to use, because of the high agreement between mathematical derivation and implementation of the method. Compared with a special purpose implementation for a particular discretization scheme, we find that FlexOp offer a significant reduction in the number of lines of code, together with an associated enhanced maintainability. The increased flexibility comes without a cost in the form of an increase of execution time, when compared with the special purpose application.

Available as PDF (215 kB, no cover)

Download BibTeX entry.

Uppsala Universitet