Abstract
We outline an approach for extending procedural finite-element software components using generic programming. A layer of generic software components consisting of C++ containers and algorithms is used for parallelization of the finite-element solver and for solver coupling in multi-physics applications. The advantages of generic programming in connection with finite-element codes are discussed and compared with those of object-oriented programming. The use of the proposed generic programming techniques is demonstrated in a tutorial fashion through basic illustrative examples as well as code excerpts from a large-scale finite-element program for serial and parallel computing platforms.








Similar content being viewed by others
Notes
Public inheritance with virtual member functions in C++.
If shared libraries are used, the framework user does not even need to create a new executable.
One may, however, pre-instantiate a templated function or class with specific template arguments and compile such instantiations into a library. This can be helpful in cases where particular instantiations are commonly used.
Note that in OOP, a pointer to a base class may contain the address of an object of a derived class. Consequently, the actual type of the object referred to by the pointer can be known only at run time.
The keyword typename is used to clarify that the entity Compare qualified by the type parameter PT is itself a type.
In order to avoid the successive memory reallocations during the collection process with the STL vector container, one can use the reserve method.
The axis-aligned bounding box of a subdomain is the smallest rectangular box with sides parallel to the x, y, and z axes that encloses the subdomain.
References
Schroeder W, Martin K, Lorensen B (1998) The visualization toolkit—an object-oriented approach to 3D graphics, 2nd edn. Prentice Hall, Englewood Cliffs
Mackie RI (1992) Object oriented programming of the finite-element method. Int J Numer Method Eng 35(2):425–436
Stroustrup B (1997) The C++ programming language, 3rd edn. Addison-Wesley, Reading
Josuttis NM (1999) The C++ standard library: a tutorial and reference. Addison-Wesley, Reading
Karlsson B (2005) Beyond the C++ standard library—an introduction to boost. Addison-Wesley, Reading
Fabri A, Giezeman GJ, Kettner L, Schirra S, Schönherr S (2000) On the design of cgal, a computational geometry algorithms library. Softw-Pract Exp 30:1167–1202
Veldhuizen T Blitz++. http://www.oonumerics.org/blitz/
Renard Y, Pommier J Getfem++. http://www.gmm.insa-toulouse.fr/getfem/
Cirak F, Ortiz M, Schröder P (2000) Subdivision surfaces: a new paradigm for thin-shell finite-element analysis. Int J Numer Method Eng 47(12):2039–2072
JF Remacle, Shephard MS (2003) An algorithm oriented mesh database. Int J Numer Method Eng 58(2):349–374
Lakos J (1996) Large-scale C++ software design. Addison-Wesley, Reading
Gamma E, Helm R, Johnson R, Vlissides J (1995) Design patterns: elements of reusable object-oriented software. Addison-Wesley, Reading
Vandevoorde D, Josuttis NM (2002) C++ templates: the complete guide. Addison-Wesley, Reading
Austern MH(1998) Generic programming and the STL. Addison-Wesley, Reading
Alexandrescu A (2001) Modern C++ design: generic programming and design patterns applied. Addison-Wesley, Reading
Heinstein MW, Mello FJ, Attaway SW, Laursen TA (2000) Contact-impact modeling in explicit transient dynamics. Comput Method Appl Mech Eng 187:621–640
Cirak F, West M (2005) Decomposition-based contact response (dcr) for explicit finite element dynamics. Int J Numer Method Eng 64:1078–1110
Mauch SP (2003) Efficient algorithms for solving static Hamilton–Jacobi equations. PhD thesis, California Institute of Technology, Pasadena
Myers NC (1995) Traits: a new and useful template technique. C++ Report, June 1995
Veldhuizen T (1995) Using C++ template metaprograms. C++ report, May 1995
Veldhuizen T (1995) Expression templates. C++ report, June 1995
Quarteroni A, Valli A (1999) Domain decomposition methods for partial differential equations. Oxford University Press, Oxford
Cirak F, Ortiz M (2001) Fully c 1-conforming subdivision elements for finite deformation thin-shell analysis. Int J Numer Method Eng 51(7):813–833
Cirak F, Ortiz M, Pandolfi A (2005) A cohesive approach to thin-shell fracture and fragmentation. Comput Method Appl Mech Eng 194:2604–2618
Berger MJ, Bokhari SH (1987) A partitioning strategy for nonuniform problems on multiprocessors. IEEE Trans Comput 36:570–580
Hendrickson B, Devine K (2000) Dynamic load balancing in computational mechanics. Comput Method Appl Mech Eng 184:485–500
Stewart JR, Edwards HC (2004) A framework approach for developing parallel adaptive multiphysics applications. Finite Elem Anal Des 40:1599–1617
Beall MW, Shephard MS (1999) An object-oriented framework for reliable numerical simulations. Eng Comput 15:61–72
Cuitino A, Ortiz M (1992) A material-independent method for extending stress update algorithms from small-strain plasticity to finite plasticity with multiplicative kinematics. Eng Comput 9:437–451
Deiterding R (2003) Parallel adaptive simulation of multi-dimensional detonation structures. PhD thesis, Brandenburgische Technische Universität Cottbus, September
Cirak F, Radovitzky R (2005) A lagrangian-eulerian shell-fluid coupling algorithm based on level sets. Comput Struct 83:491–498
Cirak F, Deiterding R, Mauch SP (2006) Large-scale fluid-structure interaction simulation of viscoplastic, and fracturing thin-shells subjected to shocks and detonations. Comput Struct (in press)
Deiterding R, Radovitzky R, Mauch SP, Noels L, Cummings JC, Meiron DI (2006) A virtual test facility for the efficient simulation of solid material response under strong shock and detonation wave loading. Eng Comput 22:325–347
Acknowledgments
The support of DoE through Caltech’s ASCI Center is gratefully acknowledged (DOE W-7405-ENG-48, B523297).
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Cirak, F., Cummings, J.C. Generic programming techniques for parallelizing and extending procedural finite element programs. Engineering with Computers 24, 1–16 (2008). https://doi.org/10.1007/s00366-007-0058-x
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00366-007-0058-x