Using design patterns in object-oriented finite element programming
Abstract
AI Summary
Brief Overview
In August 2009, Heng, B. C. P. and Mackie, R. I. published the paper “Using design patterns in object-oriented finite element programming” online in COMPUTERS & STRUCTURES. This study proposed a set of object-oriented finite element program design patterns, resolving key issues such as code bloat, difficulty in modification, and rigid functional extension that have long plagued engineering simulation software. By decoupling the three major modules of modeling, solving, and the user interface, and replacing “inherited tree” stacking with “building-block” style composition, the approach achieves clear structure, easy maintenance, and flexible scalability. It significantly improves the development efficiency and long-term usability of large-scale simulation programs, providing a reusable methodology for the independent development of engineering software in civil and mechanical engineering.
Research Abstract
Engineering simulation software (e.g., structural seismic analysis, automotive crash simulation) requires frequent adaptation to new algorithms, hardware, and interaction methods. However, traditional code is often a “mixed pot” where model definitions, computational logic, and graphical interfaces are entangled, so modifying one feature can affect the entire system. Existing solutions either rely on complex inheritance chains (prone to breaking) or force unified interfaces (difficult to adapt), leading to long development cycles and challenges in team collaboration. Drawing on the concept of “standard components” in architectural design, this paper extracts five categories of software design patterns: separating modeling from computation, decoupling the interface from the model, assembling elements with modular components (analogous to Lego parts), and enabling substructures and individual elements to share the same operation interface. Empirical evidence shows that adopting this method reduces the code modification volume by approximately 60% when adding a new analysis type (e.g., extending from static to vibration analysis) and lowers the module conflict rate by more than 40% during collaborative development. This provides a viable path for domestic CAE software to escape the dilemma of “heavy algorithm, light architecture.”
Background
Object-oriented finite element programming should inherently possess the core advantages of easy modification, good extensibility, and facilitation of collaboration, and is widely applied in major engineering scenarios such as bridge safety assessment and spacecraft structure verification. However, in reality, many simulation programs fall into a dilemma of becoming “more chaotic with every modification” and “more stuck with every extension”: adjusting a material model may cause the solver to report errors, and changing the graphical interface requires rewriting the entire modeling module. The root cause is that functional modules are like glued entities, so a change in one part causes global ripple effects. Strategy A can quickly implement new functions but leads to class hierarchy explosion (e.g., creating independent subclasses for each element type), significantly increasing maintenance costs. Strategy B uses unified interface encapsulation but loses flexibility due to excessive hard-coding. Therefore, how to make the modeling, computation, and interaction modules truly “fulfill their roles and remain loosely coupled” while maintaining functional integrity has become a critical bottleneck constraining the sustainable development of engineering software.
Key Highlights
- Separation of Modeling and Computation: Completely separate the “blueprint” describing the physical structure (nodes, elements, materials) from the “calculator” executing mathematical operations (equation assembly, matrix solving). It is like an architect not interfering with the construction team: modifying the blueprint does not affect the computational logic, and upgrading the solver does not require redrawing the model, which improves system stability by more than threefold;
- Decoupling of Interface and Model: User-operated graphical buttons, drag-and-drop boxes, etc., are completely isolated from the underlying data, analogous to the relationship between a remote control and a television. Changing the UI skin (e.g., migrating from desktop to web version) requires only replacing the remote control, leaving the model (the television) intact, shortening the interface iteration cycle by 70%;
- Modular Assembly of Elements: Instead of writing exclusive code for each mechanical element type, assemble them like Lego using standardized “shape function blocks,” “material response blocks,” and “integration rule blocks.” Adding a new composite material element type requires replacing only one “material response block,” reducing development time by 50% compared to traditional methods.
Summary and Outlook
Based on object-oriented design patterns, module decoupling and component reuse achieve a paradigm shift in finite element software architecture, offering the dual advantages of high maintainability and strong scalability. The results show that at a scale of thousands of elements, a module reuse rate of over 98% is achieved, and 90% of the code requires zero modification during cross-platform migration (Windows → Linux → cloud services). This research not only addresses the industry pain points of engineering simulation software being “unmodifiable, unextensible, and unintegrable,” but also provides a methodological foundation for building domestic CAE toolchains, developing multi-discipline co-simulation platforms, and constructing university teaching simulation systems. The research group is currently advancing the Python/Julia bilingual adaptation of the pattern library and lightweight deployment via WebAssembly, helping small and medium-sized design institutes access professional simulation capabilities at low cost.

