Skip to content

Latest commit

 

History

History

C++-openmp-cuda

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
========================INTRODUCTION==================================================
This C++ code is used to implement Phase-field simulations for phase transformations.
Both 2D and 3D simulations can be carried out by configuring the computational domain.
The code is parallelized with OpenMP and thus can be run on multicore systems. It also includes a GPU solver that can be used on a platform with a CUDA-enabled GPU. If no GPU available, the program will use the CPU only.
The logical workflow of the code is:
    START MAIN PROGRAM
    -->INITIALIZE OBJECTS
    -->TIME-FOR-LOOPS
       {
        CALL PHASE-FIELD SOLVER
        -->CALL DIFFUSION SOLVER
        }
    -->CLEAN UP MEMORY& RESET GPU
    -->TERMINATE PROGRAM.
    
There are two solvers in the code: the phase-field solver and the diffusion solver.
The phase-field solver solves the phase-field equations (partial differential equations) on the CPU.
The diffusion solver solves the multi-phase diffusion on either CPU or GPU using Cuda.
The user can control whether to use Cuda-enabled GPU for computing or not by indicating it in the input file.

========================PREREQUISITE=============================================
1) a Linux OS.
2) a C++ compiler: g++ by default or intel C++.
3) In order to use GPU solver, CUDA Toolkit should be installed so that "nvcc" compilation command is applicable.
   compute capability of >1.3 is required for double-presion floating-point computing.
4) Blitz++ library (http://sourceforge.net/projects/blitz/) should be installed. Please indicate the installation directory in the makefile.
   The Blitz++ is a library of high-performance multi-dimensional arrays that is suitable for storing multi-dimensional finite difference data.   

=========================COMPLICATION INSTRUCTION=========================================
Go to the /build subdirectory;
Make necessary changes of the makefiles, e.g. compiler, blitz++ installation directory, and compilation options;
Type "make" to get the executable "PFM".

=========================IMPLEMENTATION INSTRUCTION========================================
There are at least two input files required, one is the computation-configuration file, the other is the thermodynamic file.
For example, the computation-configuration file is "config.txt", then the program should run like "./PFM config.txt".
In the computation-configuration file, you should indicate the name of the thermodynamic file.
There are samples in the /build subdirectory.