S0540101 CPU and GPU Implementation of Finite Difference Method for Vorticity Equation based on Object-Oriented Programming
Tomohiro Degawa, Yoshiyuki Nakamichi · The Proceedings of Mechanical Engineering Congress Japan · 2015
This study concerns an implementation technique of scientific programs based on Object-Oriented Programming via Modern Fortran, well-known as Fortran 2003. Object-Oriented Programming features make maintain, reuse and extend of existing program source codes easy. A program calculating two-dimensional incompressible viscous flow is implemented on a CPU based on Object-Oriented Programming. The Fractional step method and SOR method are adopted as a numerical simulation and solver for the pressure Poisson equation. The implemented program is simpler than that based on the procedural programming which is popularly used for the programming of numerical simulation methods, confirming the Object-Oriented Programming's suitability for the scientific programming including fluid flow simulations. A porting of the CPU program to CUDA Fortran is successfully completed, avoiding some restrictions attributed to PGI compiler's features. This porting process discovers reuse technique of existing FORTRAN 77 codes.