23.1 Introduction and Objectives
In this chapter we discuss how to analyse, design and implement a C++ software framework for a class of partial differential equations (an exemplar of which is discussed in Wilmott, Lewis and Duffy, 2014 (subsequently called WLD, 2014)). The focus is on applying the author's system decomposition techniques (Duffy, 2004) in combination with the new features in C++11 to produce a customisable software framework that reproduces the numerical results in WLD (2014) and that can also be extended to other kinds of PDEs and finite difference schemes. We realise a certain level of flexibility in the new framework due to the following features:
- Each subsystem has a single major responsibility and well-defined and narrow interfaces. Complex mathematical operations are hidden behind these interfaces.
- We model PDEs as compositions of universal function wrappers using the functional programming model. In this way we avoid code bloat and proliferation of classes that arise when creating traditional class hierarchies based on subtype polymorphism or by using the curiously recurring template pattern (CRTP).
- We begin with the C++ code that we used to implement the Alternating Direction Explicit (ADE) in WLD (2014) and we port it to code that fits into the new software framework.
- Lambda functions help reduce code bloat, especially when configuring the application. Their use promotes ...