C++ implementations of numerical methods for solving differential-algebraic equations: design and optimization considerations

Object-oriented programming can produce improved implementations of complex numerical methods, but it can also introduce a performance penalty. Since computational simulation often requires intricate and highly efficient codes, the performance penalty of high-level techniques must always be weighed against the improvements they enable. These issues are addressed in a general object-oriented (OO) toolkit for the numerical solution of differential-algebraic equations (DAEs). The toolkit can be configured in several different ways to solve DAE initial-value problems with an adaptive multistep method. It contains a wrapped version of the Fortran 77 code DASPK and a translation of this to C++. Two C++ constructs for assembling the tools are provided, as are two implementations an important DAE test problem. Multiple configurations of the toolkit for DAE test problems are compared in order to assess the performance penalties of C++. The mathematical methods and implementation techniques are discussed in detail in order to provide heuristics for efficient OO scientific programming and to demonstrate the effectiveness of OO techniques in managing complexity and producing better code. The codes were tested on a variety of problems using publicly available Fortran 77 and C++ compilers. Extensive effficiency comparisons are presented in order to isolate computationally inefficient OO techniques. Techniques that caused difficulty in implementation and maintenance are also highlighted. The comparisons demonstrate that the majority of C++'s built-in support for OO programming has a negligible effect on performance, when used at sufficiently high levels, and provides flexible and extensible software for numerical methods.

[1]  Terry Quatrani,et al.  Visual modeling with rational Rose and UML , 1998, Addison-Wesley object technology series.

[2]  Yuan Zheng Object-Oriented Finite Element Programming , 2000 .

[3]  C. W. Gear,et al.  Approximation methods for the consistent initialization of differential-algebraic equations , 1988 .

[4]  B. K. Karamete,et al.  UNSTRUCTURED GRID GENERATION AND A SIMPLE TRIANGULATION ALGORITHM FOR ARBITRARY 2-D GEOMETRIES USING OBJECT ORIENTED PROGRAMMING , 1997 .

[5]  E. H. Nordholt Classes and properties of multiloop negative-feedback amplifiers , 1981 .

[6]  Lee R. Nackman,et al.  Scientific and Engineering C++: An Introduction with Advanc , 1995, IEEE Computational Science and Engineering.

[7]  Ren-Chuen Chen,et al.  Object-oriented programming of adaptive finite element and finite volume methods , 1996 .

[8]  Boleslaw K. Szymanski,et al.  Expressing object-oriented concepts in Fortran 90 , 1997, FORF.

[9]  Y. Dubois-Pelerin Object-oriented finite elements , 1992 .

[10]  L. Petzold A description of dassl: a differential/algebraic system solver , 1982 .

[11]  R. Newcomb The semistate description of nonlinear time-variable circuits , 1981 .

[12]  Roland W. Lewis,et al.  AUTOMATIC TIMESTEP SELECTION FOR THE SUPER‐TIME‐STEPPING ACCELERATION ON UNSTRUCTURED GRIDS USING OBJECT‐ORIENTED PROGRAMMING , 1997 .

[13]  R. Roitzsch,et al.  KASKADE 3.0 - An Object Oriented Adaptive Finite Element Code , 1995 .

[14]  Hans Petter Langtangen,et al.  Object-oriented design of preconditioned iterative methods in diffpack , 1997, TOMS.

[15]  Jacques Besson,et al.  Large scale object-oriented finite element code design , 1997 .

[16]  C. Kelley Iterative Methods for Linear and Nonlinear Equations , 1987 .

[17]  Linda R. Petzold,et al.  Using Krylov Methods in the Solution of Large-Scale Differential-Algebraic Systems , 1994, SIAM J. Sci. Comput..

[18]  Thomas Zimmermann,et al.  Object-oriented finite element programming: I: Governing principles , 1992 .

[19]  Cass T. Miller,et al.  Accurate and economical solution of the pressure-head form of Richards' equation by the method of lines , 1997 .

[20]  Arch D. Robison,et al.  C++ gets faster for scientific computing , 1996 .

[21]  Bjarne Stroustrup,et al.  C++ : programovací jazyk : The C++ programming language (Orig.) , 1997 .

[22]  Jack Dongarra,et al.  LAPACK Working Note 74: A Sparse Matrix Library in C++ for High Performance Architectures , 1994 .

[23]  C. W. Gear,et al.  Differential-Algebraic Equations , 1984 .

[24]  Ron Sacks-Davis,et al.  An Alternative Implementation of Variable Step-Size Multistep Formulas for Stiff ODEs , 1980, TOMS.

[25]  P. Donescu,et al.  A generalized object-oriented approach to solving ordinary and partial differential equations using finite elements , 1996 .

[26]  Julian Cummings,et al.  Comparison of C++ and Fortran 90 for scientific computing , 1997 .

[27]  T. Zimmermann,et al.  Object-oriented finite elements I. Principles of symbolic derivations and automatic programming , 1996 .

[28]  T. Zimmermann,et al.  Object-oriented finite elements II. A symbolic environment for automatic programming , 1996 .

[29]  C. W. Gear,et al.  Simultaneous Numerical Solution of Differential-Algebraic Equations , 1971 .

[30]  C. T. Kelley,et al.  Termination of Newton/Chord Iterations and the Method of Lines , 1998, SIAM J. Sci. Comput..

[31]  Bjarne Stroustrup,et al.  The C++ programming language (2nd ed.) , 1991 .

[32]  D. W. Walker,et al.  LAPACK++: a design overview of object-oriented extensions for high performance linear algebra , 1993, Supercomputing '93.

[33]  C. W. Gear,et al.  Differential-algebraic equations index transformations , 1988 .

[34]  Lee R. Nackman,et al.  Scientific and Engineering C , 1995 .

[35]  Pierre Pegon,et al.  Improving modularity in object-oriented finite element programming , 1997 .

[36]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[37]  L. Petzold,et al.  Numerical methods and software for sensitivity analysis of differential-algebraic systems , 1986 .

[38]  Linda R. Petzold,et al.  Numerical solution of initial-value problems in differential-algebraic equations , 1996, Classics in applied mathematics.

[39]  Jack Dongarra,et al.  IML++ v. 1.2 Iterative Methods Library Reference Guide | NIST , 1996 .

[40]  Thomas Zimmermann,et al.  Object-oriented finite element in programming: II: A prototype program in Smalltalk , 1992 .

[41]  Dominique Eyheramendy,et al.  Object-oriented finite element programming: an interactive environment for symbolic derivations, application to an initial boundary value problem , 1996 .

[42]  Hans Petter Langtangen,et al.  On the Numerical Efficiency of C++ in Scientific Computing , 1997 .

[43]  C. W. Gear,et al.  Automatic integration of Euler-Lagrange equations with constraints , 1985 .