Science note: Cahn–Hilliard (examples/) vs Allen–Cahn (apps/)

Both names describe interface-driven continuum models, but the shipped OpenPFC entry points differ in dimensionality, numerics, and how you run them.

12_cahn_hilliard (example)

What

Spectral Cahn–Hilliard–style split operator on a structured grid; nonlinear + biharmonic-type stiffening via operators in Fourier space.

Dimension

Often 2D slab (Lz = 1) in the source; grid sizes set in C++.

Driver

Custom main + MPI_Workernot JSON App.

Output

VTK time series (.vti) — good for ParaView (tutorials/vtk_paraview_workflow.md).

Use

Learn spectral Model + VTK together; see spectral_examples_sequence.md.

allen_cahn (application)

What

2D Allen–Cahn-type reaction–diffusion with a double-well potential; finite differences with halos on a 2D grid.

Driver

CLI arguments (no JSON App).

Output

Optional PNG snapshots (gather to rank 0) for quick visuals (io_results.md).

Checks

The shipped app can verify seed growth (see apps/allen_cahn/README.md); exit code may be non-zero if thresholds are not met.

Use

Lightweight visual sanity check, FD + halo patterns (halo_exchange.md), GPU variants when built.

Choosing one

See also