OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
10_complete_pfc_model.cpp File Reference

Complete Phase Field Crystal simulation demonstrating all OpenPFC APIs. More...

#include <cmath>
#include <iostream>
#include <memory>
#include <mpi.h>
#include <openpfc/boundary_conditions/fixed_bc.hpp>
#include <openpfc/initial_conditions/constant.hpp>
#include <openpfc/initial_conditions/single_seed.hpp>
#include <openpfc/openpfc.hpp>
Include dependency graph for 10_complete_pfc_model.cpp:

Classes

class  PFCModel
 Phase Field Crystal model for solidification simulations. More...
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Complete Phase Field Crystal simulation demonstrating all OpenPFC APIs.

This comprehensive example demonstrates:

  1. World - Domain geometry and coordinate system
  2. Decomposition - MPI domain decomposition for parallelism
  3. FFT - Spectral transforms and k-space operations
  4. Model - Custom PFC model with field management
  5. Initial Conditions - Seed-based nucleation
  6. Boundary Conditions - Fixed walls
  7. Time - Time stepping and output scheduling
  8. Simulator - Orchestration of the simulation loop
  9. ResultsWriter - Parallel output to binary files
  10. Full integration - Production-quality PFC simulation

Physical System: Phase Field Crystal (PFC) model for solidification Single-mode approximation with periodic boundary conditions Liquid → Solid phase transition driven by undercooling

Compile and run: mpicxx -std=c++17 -I/path/to/openpfc/include 10_complete_pfc_model.cpp \ -L/path/to/openpfc/lib -lopenpfc -lheffte -o 10_complete_pfc_model mpirun -np 4 ./10_complete_pfc_model