Design Patterns for Scientific Software

Class HierarchyI’ve been reading a really interesting paper out of a group that’s just across campus from me. The paper is called Design Patterns for Generic Object-Oriented Scientific Software and it comes out of the Izaguirre Group.

Design patterns have a long history in the object-oriented software community. The idea originally came from an amazing book on architecture and urban planning (A Pattern Language by Christopher Alexander), but was transformed into a major area of software design by the famous “Gang of Four” book (Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides). In this book, they outline some of the fundamental roles various software objects can play (and these are now quite famous: Factory Methods, Singletons, Composites, Iterators, etc.)

I’ve only seen a few people floating ideas for design patterns for scientific software. Cickovski, Matthey, and Izaguirre suggest a few in their paper, and I’ve seen some others suggested as a pattern language for parallel programming. So, to add to the discussion, here are my candidates:

  • Fundamental Objects
    • Particle (e.g. atoms, planets, etc.)
    • Mesh (e.g. representations of wavefunctions, continuum fluids, etc.)
  • Interaction Patterns
    • Particle-particle (i.e. the Double Loop)
    • Particle-mesh
    • Mesh-mesh
    • Multi-level Grid
    • Multiple Space (i.e. real vs. inverse space interactions)
  • Propagator Patterns
    • Synchronous Propagator
      • Regular Stepping
      • Adaptive Stepping
      • Multiple Stepping
    • Asynchronous Propagator
    • Event-Driven Propagator
    • Markov Chain Propagator
  • Analysis Patterns
    • Ensemble Average
    • Correlation Functions
      • Autocorrelation (single property, multiple time)
      • Cross correlation (multiple property, multiple time)
    • Overlap-related Analysis Patterns
  • Linear System Pattern
    • Inversion
    • Diagonalization
    • Singular Value Decomposition
  • Transformational Patterns
    • Spectral
    • coordinate
  • Time-saving Patterns
    • Neighbor Lists
    • Cutoffs / Switching functions
    • Interpolation

This list is very chem-centric. I’m sure I’m leaving out other very important and common object structures from other fields. So, what would you add? If a code library was constructed which implemented the skeletal patterns in C++, would the scientific community use it?

[tags]design patterns, scientific software[/tags]

No votes yet.
Please wait...
Share
This entry was posted in Science, Software. Bookmark the permalink.

One Response to Design Patterns for Scientific Software

  1. Dear Dan,
    besides listing the patterns, could you in these years try to define them ? I would really like to see whatever you (or other) did. Thank you in advance for any hint, riccardo

    Rating: 5.0/5. From 1 vote.
    Please wait...

Leave a Reply

Your email address will not be published. Required fields are marked *