Skip to content

pyPFC logo

A Python package for GPU-accelerated 3D Phase Field Crystal simulations

PFC atoms

Overview

pyPFC is a high-performance simulation framework designed for modeling crystal structures and their evolution using the Phase Field Crystal (PFC) method. The code uses PyTorch to allow execution on both CPUs and GPUs, with particularly efficiency gained on GPU platforms. pyPFC is developed with a combined focus on computational efficiency, flexibility and accessibility, making it suitable for both research and educational purposes. Areas of application include:

  • Materials Science: Crystal growth and microstructure evolution
  • Computational Physics: Pattern formation, defect evolution and elastic interactions
  • Metallurgy: Grain boundary and dislocation mechanics

Key Features

  • GPU Acceleration: Full GPU support using PyTorch for large-scale simulations
  • Adjustable Floating Point Precision: Permits optimized use of GPU memory resources and execution efficiency
  • Flexible I/O: VTK, Extended XYZ and pickle format support for data exchange
  • Advanced Data Processing: Built-in functionalities as well as interfaces to OVITO libraries (optional)
  • Memory Optimization: Efficient memory management for large 3D grids
  • Density Field Evolution: Different time integration schemes are available

Getting Started

  1. Installation Guide - Setup instructions and dependencies
  2. Quick Start Tutorial - Run your first pyPFC simulation
  3. Examples - Comprehensive examples and use cases
  4. API Reference - Detailed class and method documentation
  5. Troubleshooting - Q&A

Acknowledegment

If you use pyPFC or any of its components for a publication or presentation you are kindly asked to include a reference to:

H. Hallberg and K.H. Blixt, pyPFC: an open-source Python package for phase field crystal simulations, Modelling and Simulation in Materials Science and Engineering, 34(1):015004, 2026

BibTeX entry:

@Article{pypfc,
   Author         = {H. Hallberg and K. H. Blixt},
   Title          = {py{PFC}: an open-source {P}ython package for phase field crystal simulations},
   Journal        = {Modelling and Simulation in Materials Science and Engineering},
   Year           = {2026},
   Volume         = {34},
   Number         = {1},
   Month          = {January},
   Pages          = {1--14},
   DOI            = {10.1088/1361-651X/ae2599},
   Article-Number = {015004},
   ISSN           = {0965-0393},
   EISSN          = {1361-651X},
}

Licencing

This software is released under a GNU GPLv3 license.

References

Further details on PFC modeling and example applications can be found in: