Engineering model -- Numerical Method Interface

Engng model is an abstraction for the type of analysis, that will be done. Base class offers basic general services for assembling characteristic components and services for starting the solution step and its termination. Derived classes ``know'' the form of governing equation and the physical meaning of particular components. They are responsible for forming the governing equation for each solution step, which may represent either a time step, a load increment, or a load case, usually by summing contributions from particular elements and nodes. In order to solve the governing equation, a suitable instance of Numerical Method class is created. Engng model may use different numerical methods, depending, for example, on problem size or previous convergence. Engng model first maps its components of the governing equation (for example stiffness matrix, load vector) to corresponding numerical components (LHS, RHS), and then sends a message to the appropriate numerical method to solve the problem (see Fig. 4). Engng model must also provide services for updating its components, if this is necessary. These are used, when the Numerical Method instance needs to update some components during solution (for example in the Newton Raphson algorithm for the solution of non-linear equations, stiffness has to be updated after each iteration). Similarly, a high-level numerical method may use the services of another low-level numerical method (solver for non-linear system of equations uses another linear solver for linearized problem). Numerical method instance may also represent an interface to some procedure in C or Fortran (see Fig. 4.).

One important aspect, which should be mentioned here, is that all numerical methods solving the same problem use the same names for numerical components. This is important, because the situation, where different numerical methods use different message names and parameter ordering for the same service is avoided. This is necessary, otherwise any future introduction of numerical method could require some necessary code changes. However, by using the proposed compulsory mapping of each component separately to compulsory (and common) component names, it is possible to create a new instance of Numerical method, and leaving the whole engineering model code including mapping unchanged.

This concept is further enhanced by introduction of base abstract class for all sparse matrices. This class only declares the basic required services provided by all sparse matrices (like multiplication by a vector, possible factorization, etc). The implementation is left on derived classes. Numerical methods are then implemented only using basic services declared by Sparse Matrix class. Thus, numerical methods class instances will work with any sparse matrix class, even those added in the future, without changing any code, because all derived classes of Sparse Matrix class implement the same interface.



Subsections
Borek Patzak 2013-03-10