High‐performance Java codes for computational fluid dynamics
The computational science community is reluctant to write large‐scale computationally‐intensive applications in Java due to concerns over Java's poor performance, despite the claimed software engineering advantages of its object‐oriented features. Naive Java implementations of numerical algorithms can perform poorly compared to corresponding Fortran or C implementations. To achieve high performance, Java applications must be designed with good performance as a primary goal. This paper presents the object‐oriented design and implementation of two real‐world applications from the field of computational fluid dynamics (CFD): a finite‐volume fluid flow solver (LAURA, from NASA Langley Research Center) and an unstructured mesh adaptation algorithm (2D_TAG, from NASA Ames Research Center). This work builds on our previous experience with the design of high‐performance numerical libraries in Java. We examine the performance of the applications using the currently available Java infrastructure and show that the Java version of the flow solver LAURA performs almost within a factor of 2 of the original procedural version. Our Java version of the mesh adaptation algorithm 2D_TAG performs within a factor of 1.5 of its original procedural version on certain platforms. Our results demonstrate that object‐oriented software design principles are not necessarily inimical to high performance. Copyright © 2003 John Wiley & Sons, Ltd.