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

Licencing

This software is released under a GNU GPLv3 license.

References

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

  1. K.H. Blixt and H. Hallberg, Phase Field Crystal Modeling of Grain Boundary Migration: Mobility, Energy and Structural Variability, Acta Materialia, 297:121318, 2025
  2. H. Hallberg and K.H. Blixt, Assessing grain boundary variability through phase field crystal simulations, Physical Review Materials, 8(3):113605, 2024
  3. K.H. Blixt and H. Hallberg, Phase field crystal modeling of grain boundary structures in diamond cubic systems, Physical Review Materials, 8(3):033606, 2024
  4. H. Hallberg and K.H. Blixt, Multiplicity of grain boundary structures and related energy variations, Materials Today Communications, 38:107724, 2024
  5. H. Hallberg and K.H. Blixt, Evaluation of Nanoscale Deformation Fields from Phase Field Crystal Simulations, Metals, 12(10):1630, 2022
  6. K.H. Blixt and H. Hallberg, Grain boundary and particle interaction: Enveloping and pass-through mechanisms studied by 3D phase field crystal simulations, Materials & Design, 220:110845, 2022
  7. K.H. Blixt and H. Hallberg, Grain boundary stiffness based on phase field crystal simulations, Materials Letters, 318:132178, 2022
  8. K.H. Blixt and H. Hallberg, Evaluation of grain boundary energy, structure and stiffness from phase field crystal simulations, Modelling and Simulation in Materials Science and Engineering, 30(1):014002, 2022